> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkutm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a domain

> Create a custom domain for the workspace.



## OpenAPI

````yaml POST /domains
openapi: 3.0.3
info:
  title: linkutm API
  version: 1.0.0
  description: >-
    REST API for linkutm — short links, UTM tagging, custom domains, folders,
    tags and click analytics.


    Every endpoint documented here is served under
    `https://api.linkutm.com/api/v1`.
servers:
  - url: https://api.linkutm.com/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Links
    description: Create, read, update and delete short links, individually or in bulk.
  - name: Domains
    description: Register and verify the custom domains short links are served from.
  - name: Folders
    description: Group links into folders.
  - name: Tags
    description: Label links and manage which links carry which tag.
  - name: Analytics
    description: Click analytics for the workspace and for individual links.
  - name: Imports
    description: Migrate links in from Short.io, Bitly and Rebrandly.
paths:
  /domains:
    post:
      tags:
        - Domains
      summary: Create a domain
      description: Create a custom domain for the workspace.
      operationId: createDomain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - domain
              additionalProperties: false
              properties:
                domain:
                  type: string
                  maxLength: 253
                  description: Name of the domain, without `https://` or a path.
                  example: go.acme.com
            examples:
              minimal:
                summary: Create a domain
                value:
                  domain: go.acme.com
      responses:
        '201':
          description: The domain was created.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Domain'
                  - type: object
                    properties:
                      cnameTarget:
                        type: string
                        description: >-
                          Point the domain's CNAME record here, then verify the
                          domain.
                        example: cname.linkutm.com
              example:
                id: 6d40c0a2-5b1e-4f7a-9a43-2f1c8e9b7d10
                domain: go.acme.com
                verified: false
                primary: false
                createdAt: '2026-10-02T09:09:35.000Z'
                updatedAt: '2026-10-02T09:09:35.000Z'
                workspaceId: 0b8f3c1e-7d2a-4e6b-9c5d-1a2b3c4d5e6f
                canDelete: true
                canUpdate: true
                status: pending
                enabled: true
                createdById: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
                updatedById: null
                cnameTarget: cname.linkutm.com
        '400':
          description: The request is invalid or the domain is reserved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message:
                  - Enter a valid domain such as links.example.com
                error: Bad Request
        '401':
          description: The API key or token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 401
                message: Invalid or expired API key
                error: Unauthorized
        '403':
          description: The caller lacks permission or the plan's domain limit is reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 403
                message: Domain limit reached. Used 3 of 3. Please upgrade your plan.
                error: Forbidden
        '409':
          description: The domain is already in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 409
                message: This domain is already in use by another account or workspace
                error: Conflict
        '500':
          description: Unexpected server error. Safe to retry with backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 500
                message: Internal server error
components:
  schemas:
    Domain:
      type: object
      properties:
        id:
          type: string
          format: uuid
        domain:
          type: string
          example: go.acme.com
        verified:
          type: boolean
          description: '`true` once the CNAME record has been confirmed.'
        status:
          type: string
          enum:
            - pending
            - active
          description: >-
            `pending` until the CNAME is verified, then `active`. No other value
            is used.
          example: active
        enabled:
          type: boolean
          description: >-
            `false` when a plan downgrade disabled the domain. Disabled domains
            do not serve links.
        primary:
          type: boolean
        canUpdate:
          type: boolean
          description: '`false` for system domains.'
        canDelete:
          type: boolean
          description: '`false` for system domains.'
        workspaceId:
          type: string
          format: uuid
          nullable: true
          description: '`null` for shared system domains such as `telzi.com`.'
        createdById:
          type: string
          format: uuid
          nullable: true
        updatedById:
          type: string
          format: uuid
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      description: >-
        Standard NestJS error envelope. `message` is a string for exceptions
        thrown by a service, and an array of strings when the global
        ValidationPipe rejects the body.
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          description: Human-readable reason, or a list of field-level validation errors.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Link not found
        error:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: 'Workspace API key, sent as `Authorization: Bearer lk_live_…`.'
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Dashboard session token from `POST /auth/login`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.