> ## 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.

# Set the default domain

> Set a domain as the default for new links.



## OpenAPI

````yaml POST /domains/{id}/set-default
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/{id}/set-default:
    post:
      tags:
        - Domains
      summary: Set the default domain
      description: Set a domain as the default for new links.
      operationId: setDefaultDomain
      parameters:
        - name: id
          in: path
          required: true
          description: Domain ID.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The domain that is now the workspace default.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domain'
        '400':
          description: The domain ID is not a valid UUID, or the domain is not verified.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message: Only verified domains can be set as default
                error: Bad Request
        '401':
          description: Missing, malformed, expired or revoked credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 401
                message: Invalid or expired API key
                error: Unauthorized
        '403':
          description: >-
            Authenticated, but the role, plan or workspace membership does not
            allow this call.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 403
                message: This domain cannot be deleted
                error: Forbidden
        '404':
          description: The resource does not exist, or belongs to another workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 404
                message: Domain not found
                error: Not Found
        '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.