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

# /v1/apps/{appId}/custom-domain/verify

> This endpoint confirms the pending custom domain of an application.

> [!WARNING]
>
> This endpoint has a rate limit of 1 request every 3 seconds.

**1. Set the domain**

Send `assignedCustomDomain` to [`POST /v1/apps/{appId}/update`](https://docs.camposcloud.com/api-reference/endpoint/v1/applications/update). The domain must use Cloudflare nameservers.

**2. Publish the TXT record**

The application now returns `customDomainTxtName` and `customDomainTxtValue`. Create a TXT record with that name and value in your DNS.

**3. Confirm**

Call this endpoint. While the record has not propagated yet it answers `400` with `code: "CUSTOM_DOMAIN_TXT_NOT_FOUND"`: wait a few minutes and try again.


## OpenAPI

````yaml POST /v1/apps/{appId}/custom-domain/verify
openapi: 3.1.0
info:
  title: CamposCloud API Documentation
  description: >-
    This documentation provides an overview of the CamposCloud API, including
    authentication, endpoints, and data structures. It is designed to help
    developers integrate with the CamposCloud platform effectively.
  version: 1.0.0
servers:
  - url: https://api.camposcloud.com
security:
  - bearerAuth: []
paths:
  /v1/apps/{appId}/custom-domain/verify:
    post:
      tags:
        - Applications
      description: >-
        Confirms the pending custom domain of an application. Set the domain
        with `POST /v1/apps/{appId}/update` (`assignedCustomDomain`), publish
        the TXT record from `customDomainTxtName` and `customDomainTxtValue` in
        your DNS, then call this endpoint. Once confirmed, the domain is routed
        to the application. On team applications it requires
        `canManageApplicationDomains`.
      parameters:
        - name: appId
          in: path
          required: true
          description: ID of the application
          schema:
            type: string
      responses:
        '200':
          description: Domain confirmed and routed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - verified
                properties:
                  verified:
                    type: boolean
                    example: true
        '400':
          description: >-
            Invalid ID, no pending domain (`CUSTOM_DOMAIN_NO_PENDING`), TXT
            record not found yet (`CUSTOM_DOMAIN_TXT_NOT_FOUND`) or domain taken
            meanwhile (`CUSTOM_DOMAIN_IN_USE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  Não encontramos o registro TXT de verificação. Crie o registro
                  e aguarde a propagação do DNS.
                code: CUSTOM_DOMAIN_TXT_NOT_FOUND
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: You are not allowed to manage the domains of this application.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  You do not have permission to perform this action on this
                  application.
        '404':
          description: Application not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Aplicação não encontrada.
                code: APPLICATION_NOT_FOUND
        '429':
          description: >-
            A rate limit was exceeded. This endpoint accepts 1 request every 3
            seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Application update limit reached, please try again later
components:
  schemas:
    Error:
      type: object
      description: >-
        Every error returned by the API has this shape. `error` is a human
        readable message (in English or in Portuguese, depending on the
        endpoint). Many errors also carry `code`, a stable identifier to rely on
        in your code, and sometimes extra fields with details (for example
        `requestedMB` and `availableMB` with `PLAN_MEMORY_LIMIT`). Resources you
        have no relation to answer `404`, not `403`.
      required:
        - error
      properties:
        error:
          type: string
          description: Human readable description of the error.
          example: Application not found.
        code:
          type: string
          description: >-
            Stable, machine-readable identifier of the error. Present on many
            errors; compare against it instead of the message. Examples:
            `PLAN_MEMORY_LIMIT`, `APPLICATION_NOT_FOUND`, `DATABASE_NOT_FOUND`,
            `MAIN_FILE_INVALID`, `ENV_DUPLICATE_KEY`, `CUSTOM_DOMAIN_IN_USE`,
            `CUSTOM_DOMAIN_RESERVED`, `CUSTOM_DOMAIN_NOT_CLOUDFLARE`,
            `CUSTOM_DOMAIN_NO_PENDING`, `CUSTOM_DOMAIN_TXT_NOT_FOUND`.
          example: PLAN_MEMORY_LIMIT
  responses:
    Unauthorized:
      description: >-
        The `Authorization` header is missing or malformed, or the API token is
        invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid developer token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your CamposCloud API token, sent as `Authorization: Bearer <token>`.'

````

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