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

# Update a domain



## OpenAPI

````yaml /openapi.yaml patch /v1/domains/{id}
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/{id}:
    patch:
      tags:
        - Domains
      summary: Update a domain
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: 9d255865-0e24-5a44-a793-6d8e8b6e6009
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                domain:
                  type: string
            example:
              domain: promo.example.com
      responses:
        '200':
          description: >-
            The entry is replaced by the given domain, same rules as adding one.
            The id derives from the host, so changing the host changes the id:
            the response carries the new one and the old id stops resolving.
            Only a respelling of the same host, such as adding *., keeps the id.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  domain:
                    type: string
                required:
                  - id
                  - domain
              example:
                id: c9245587-11c1-599c-8a9a-b84442f02866
                domain: promo.example.com
        '204':
          description: The body carried no field to change.
        '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
        '404':
          description: No domain with that id.
          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/not_found
                code: not_found
                message: Resource not found.
                request_id: 00000000-0000-0000-0000-000000000000
        '409':
          description: >-
            Either another entry already covers that host
            (domain_already_exists, domain_id names it), or the list changed
            while the update ran (conflict): read it again and retry.
          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
              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: d8166a92-44c5-540d-9f25-2e25803bc9c5
        '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>`.

````