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

# Add static site domain

> Add a custom domain to a static site. After adding, configure your DNS records as indicated in the response to complete domain verification. The domain status will transition from `verification` to `pointing` to `active` as DNS propagates.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json post /static-sites/{id}/domains
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /static-sites/{id}/domains:
    post:
      tags:
        - Static sites
      summary: Add static site domain
      description: >-
        Add a custom domain to a static site. After adding, configure your DNS
        records as indicated in the response to complete domain verification.
        The domain status will transition from `verification` to `pointing` to
        `active` as DNS propagates.
      operationId: addStaticSiteDomainV3
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            example: fb5e5168-4281-4bec-94c5-0d1584e9e657
          in: path
          name: id
          required: true
          description: Static site identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain_name:
                  type: string
                  minLength: 1
                  description: The custom domain name to add to the static site
                  example: site.example.com
                is_wildcard:
                  description: >-
                    Whether this should be a wildcard domain that matches all
                    subdomains
                  example: false
                  type: boolean
                custom_ssl_cert:
                  description: >-
                    Custom SSL certificate in PEM format. When provided, the
                    platform uses this certificate instead of auto-provisioning
                    one.
                  example: '-----BEGIN CERTIFICATE-----...'
                  type: string
                custom_ssl_key:
                  description: >-
                    Private key for the custom SSL certificate in PEM format.
                    Required when custom_ssl_cert is provided.
                  example: '-----BEGIN PRIVATE KEY-----...'
                  type: string
              required:
                - domain_name
              additionalProperties: false
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    description: Unique identifier for the domain
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  name:
                    type: string
                    description: >-
                      Domain name, either a custom domain or a system-assigned
                      subdomain
                    example: app.example.com
                  status:
                    type: string
                    description: >-
                      Current verification and pointing status of the domain.
                      `VERIFICATION` - domain ownership is being verified.
                      `POINTING` - domain is verified but DNS is not yet
                      pointing to the platform. `ACTIVE` - domain is fully
                      configured and serving traffic. `TIMED_OUT` - verification
                      or pointing timed out and needs to be refreshed.
                    example: ACTIVE
                  type:
                    type: string
                    description: >-
                      Domain type. `SYSTEM` - platform-assigned domain that can
                      be toggled on/off. `CUSTOM` - user-added domain with
                      custom DNS configuration.
                    example: CUSTOM
                  is_enabled:
                    type: boolean
                    description: >-
                      Whether the domain is currently enabled. Only applicable
                      to system domains.
                    example: true
                  is_wildcard:
                    type: boolean
                    description: >-
                      Whether this is a wildcard domain that matches all
                      subdomains
                    example: false
                  is_primary:
                    type: boolean
                    description: >-
                      Whether this domain is the primary domain for the service.
                      The primary domain is used for canonical URLs.
                    example: true
                  dns_records:
                    anyOf:
                      - {}
                      - type: 'null'
                    description: >-
                      DNS records that need to be configured for this domain.
                      Null when DNS configuration is not required.
                    example:
                      - type: CNAME
                        name: app.example.com
                        value: cname.sevalla.com
                  errors:
                    anyOf:
                      - {}
                      - type: 'null'
                    description: >-
                      Any errors encountered during domain verification or
                      configuration
                    example: null
                  created_at:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: Timestamp when the domain was created, in ISO 8601 format
                    example: '2025-01-30T00:00:00.000Z'
                  updated_at:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    description: >-
                      Timestamp when the domain was last modified, in ISO 8601
                      format
                    example: '2025-01-30T00:00:00.000Z'
                required:
                  - id
                  - name
                  - status
                  - type
                  - is_enabled
                  - is_wildcard
                  - is_primary
                  - dns_records
                  - errors
                  - created_at
                  - updated_at
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Bad request
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 400
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unauthorized
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 401
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Forbidden
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 403
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Not found
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 404
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Too many requests
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 429
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````