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

# Add a domain



## OpenAPI

````yaml /openapi.yaml post /v1/domains
openapi: 3.1.0
info:
  title: VTurb API
  version: v1
  description: |
    Public REST API for VTurb. Dev-first and agents-first: every documented
    response is recorded from the API's real behavior.
  contact:
    name: VTurb API
    url: https://vturb.com
servers:
  - url: https://api.vturb.com
security:
  - bearerAuth: []
paths:
  /v1/domains:
    post:
      tags:
        - Domains
      summary: Add a domain
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                domain:
                  type: string
              required:
                - domain
            example:
              domain: checkout.example.com
      responses:
        '201':
          description: >-
            The domain is appended to the allowlist and returned with its id.
            Send a lowercase host such as shop.example.com, or *.example.com to
            allow every subdomain; a saved host already covers its subdomains
            and its www. form. The first domain added turns restricted on: from
            then on only listed sites embed. Players pick the change up within a
            few minutes.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  domain:
                    type: string
                required:
                  - id
                  - domain
              example:
                id: ccb1b6ac-0e0a-5890-bf7d-cf106d60f7bb
                domain: checkout.example.com
        '400':
          description: The body carries a field this endpoint does not accept.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  field:
                    type: string
                  request_id:
                    type: string
                required:
                  - type
                  - code
                  - message
                  - field
                  - request_id
              example:
                type: https://docs.vturb.com/errors/bad_request
                code: bad_request
                message: The request includes fields this endpoint does not accept.
                field: host
                request_id: 00000000-0000-0000-0000-000000000000
        '401':
          description: Missing API credential.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  request_id:
                    type: string
                required:
                  - type
                  - code
                  - message
                  - request_id
              example:
                type: https://docs.vturb.com/errors/unauthorized
                code: unauthorized
                message: >-
                  Missing or invalid API credential. Send a vt_ token in the
                  Authorization header.
                request_id: 00000000-0000-0000-0000-000000000000
        '403':
          description: The credential is missing the domains:write scope.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  request_id:
                    type: string
                required:
                  - type
                  - code
                  - message
                  - request_id
              example:
                type: https://docs.vturb.com/errors/forbidden
                code: forbidden
                message: The credential is missing the scope this action requires.
                request_id: 00000000-0000-0000-0000-000000000000
        '409':
          description: >-
            The host is already on the list, possibly saved under another
            spelling; domain_id is the entry that covers it.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  request_id:
                    type: string
                  domain_id:
                    type: string
                required:
                  - type
                  - code
                  - message
                  - request_id
                  - domain_id
              example:
                type: https://docs.vturb.com/errors/domain_already_exists
                code: domain_already_exists
                message: This domain is already in the list.
                request_id: 00000000-0000-0000-0000-000000000000
                domain_id: 9613208e-a5c4-595a-bb3d-5a68df160df0
        '422':
          description: >-
            domain must be a lowercase host with no scheme, path, port or www.,
            optionally prefixed by *. to cover every subdomain.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  request_id:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                      required:
                        - field
                        - message
                required:
                  - type
                  - code
                  - message
                  - request_id
                  - errors
              example:
                type: https://docs.vturb.com/errors/unprocessable_content
                code: unprocessable_content
                message: The request is invalid. See errors for the fields that failed.
                request_id: 00000000-0000-0000-0000-000000000000
                errors:
                  - field: domain
                    message: >-
                      must be a lowercase host such as shop.example.com or
                      *.example.com, with no scheme, path, port or www.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Paste your VTurb API token (vt_...). Sent as `Authorization: Bearer
        <token>`.

````