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

# Add Organization Domain

> Claim a domain (or start verifying an existing Keycloak one). Verified at once
(``parent_domain``) under a verified parent in this org, unless blocked.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/identity/public/v1/organizations/current/domains
openapi: 3.1.0
info:
  title: Barndoor.ai Public API
  description: Unified public API specification for Barndoor.ai platform
  version: 2.38.0
servers:
  - url: https://{host}
    description: Barndoor public API
    variables:
      host:
        default: platform.barndoor.ai
        description: >-
          The host serving your Barndoor deployment. Defaults to production;
          override it for another environment or a dedicated deployment.
security:
  - ApiKey: []
  - OAuth2:
      - openid
      - profile
      - email
tags:
  - name: dlp
    x-group: Data Control Center
  - name: identity
    x-group: Identity
  - name: llm-gateway
    x-group: LLM Gateway
  - name: notification
    x-group: Notifications
  - name: policy
    x-group: Policies
  - name: registry
    x-group: MCP Gateway
  - name: system-management
    x-group: Log Exports
paths:
  /api/identity/public/v1/organizations/current/domains:
    post:
      tags:
        - identity
      summary: Add Organization Domain
      description: >-
        Claim a domain (or start verifying an existing Keycloak one). Verified
        at once

        (``parent_domain``) under a verified parent in this org, unless blocked.
      operationId: public_add_organization_domain
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddOrganizationDomainRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationDomainResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AddOrganizationDomainRequest:
      properties:
        domain:
          type: string
          minLength: 1
          title: Domain
      type: object
      required:
        - domain
      title: AddOrganizationDomainRequest
      description: Request to claim a domain, or start verifying an existing Keycloak one.
    OrganizationDomainResponse:
      properties:
        domain:
          type: string
          title: Domain
        status:
          type: string
          title: Status
        claim_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Claim Id
        verification_method:
          anyOf:
            - type: string
            - type: 'null'
          title: Verification Method
        record_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Record Name
        record_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Record Value
        verified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Verified At
        last_checked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Checked At
        last_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error
      type: object
      required:
        - domain
        - status
      title: OrganizationDomainResponse
      description: >-
        One domain: either a claim (``pending``/``verified``/``failed``) or an
        existing

        Keycloak domain with no claim row (``unverified``).


        ``record_name``/``record_value`` are the TXT record to publish — present
        for

        every claim status so the UI can show/copy it even after a failed
        attempt.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        A Barndoor API key, sent as `Authorization: Bearer <key>`. Keys are
        prefixed `bdai_` and are opaque — do not attempt to decode one.
        Interchangeable with an OAuth 2.0 access token.
    OAuth2:
      type: oauth2
      x-issuer: https://auth.barndoor.ai/realms/barndoor
      description: >-
        An OAuth 2.0 access token from Barndoor's identity provider, sent as
        `Authorization: Bearer <token>`. Public clients must use PKCE.
        Interchangeable with an API key.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/auth
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.
        clientCredentials:
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.

````

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