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

# Create static site

> Create a new static site from a Git repository. An initial deployment is triggered automatically after creation.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json post /static-sites
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:
    post:
      tags:
        - Static sites
      summary: Create static site
      description: >-
        Create a new static site from a Git repository. An initial deployment is
        triggered automatically after creation.
      operationId: createStaticSiteV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                display_name:
                  type: string
                  minLength: 2
                  maxLength: 64
                  description: >-
                    Human-readable name for the new static site. Must be between
                    2 and 64 characters.
                  example: My Static Site
                repo_url:
                  type: string
                  maxLength: 2048
                  description: >-
                    Full URL of the Git repository containing the static site
                    source code
                  example: https://github.com/user/static-site
                default_branch:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Git branch used for deployments
                  example: main
                source:
                  default: privateGit
                  description: >-
                    Where the static site source code comes from. `privateGit` -
                    private Git repository connected via OAuth. `publicGit` -
                    public Git repository URL.
                  example: privateGit
                  type: string
                  enum:
                    - privateGit
                    - publicGit
                git_type:
                  description: >-
                    Git hosting provider for the repository. `github` - GitHub.
                    `bitbucket` - Bitbucket. `gitlab` - GitLab. Required for
                    private git sources when the provider cannot be
                    auto-detected.
                  example: github
                  type: string
                  enum:
                    - github
                    - bitbucket
                    - gitlab
                auto_deploy:
                  description: >-
                    Enable or disable automatic deployments on every push to the
                    default branch
                  example: true
                  type: boolean
                is_preview_enabled:
                  description: >-
                    Enable or disable preview deployments for pull requests
                    targeting the default branch
                  example: false
                  type: boolean
                install_command:
                  description: >-
                    Command used to install dependencies before building the
                    static site
                  example: npm install
                  type: string
                  maxLength: 1024
                build_command:
                  description: Command used to build the static site
                  example: npm run build
                  type: string
                  maxLength: 1024
                published_directory:
                  description: Directory containing the built files to publish
                  example: dist
                  type: string
                  maxLength: 500
                root_directory:
                  description: Root directory of the project within the repository
                  example: /
                  type: string
                  maxLength: 500
                node_version:
                  description: Node.js version used to build the static site
                  example: '20'
                  type: string
                  maxLength: 20
                index_file:
                  description: >-
                    Custom index file served as the entry point for the static
                    site
                  example: index.html
                  type: string
                  maxLength: 255
                error_file:
                  description: >-
                    Custom error page file served when a requested path is not
                    found
                  example: 404.html
                  type: string
                  maxLength: 255
                project_id:
                  description: >-
                    Identifier of the project to group this static site under.
                    When omitted, the static site is not assigned to any
                    project.
                  example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  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)$
                allow_deploy_paths:
                  description: >-
                    Glob patterns for file paths that trigger a deployment. When
                    set, only commits touching these paths trigger auto deploy.
                    Mutually exclusive with ignore_deploy_paths.
                  example:
                    - src/**
                    - package.json
                  type: array
                  items:
                    type: string
                ignore_deploy_paths:
                  description: >-
                    Glob patterns for file paths to exclude from deployment
                    triggers. Commits that only touch ignored paths will not
                    trigger auto deploy. Mutually exclusive with
                    allow_deploy_paths.
                  example:
                    - docs/**
                    - README.md
                  type: array
                  items:
                    type: string
              required:
                - display_name
                - repo_url
                - default_branch
              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 static site
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  company_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Identifier of the company that owns this static site
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  project_id:
                    anyOf:
                      - 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)$
                      - type: 'null'
                    description: >-
                      Identifier of the project this static site is grouped
                      under
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  name:
                    type: string
                    description: >-
                      Unique system name used in URLs and internal references.
                      Auto-generated from the display name and cannot be changed
                      after creation.
                    example: my-static-site
                  display_name:
                    type: string
                    description: >-
                      Human-readable name shown in the dashboard and API
                      responses
                    example: My Static Site
                  status:
                    anyOf:
                      - type: string
                        enum:
                          - deploymentInProgress
                          - deploymentFailed
                          - deploymentSuccess
                          - deploymentCancelled
                          - deleting
                          - deletionFailed
                      - type: 'null'
                    description: >-
                      Current status of the static site reflecting the most
                      recent deployment or lifecycle operation
                    example: deploymentSuccess
                  source:
                    type: string
                    enum:
                      - privateGit
                      - publicGit
                    description: >-
                      Where the static site source code comes from. `privateGit`
                      - private Git repository connected via OAuth. `publicGit`
                      - public Git repository URL.
                    example: privateGit
                  repo_url:
                    type: string
                    description: Full URL of the Git repository
                    example: https://github.com/user/static-site
                  default_branch:
                    type: string
                    description: >-
                      Git branch used for automatic and manual deployments when
                      no branch is explicitly specified
                    example: main
                  auto_deploy:
                    type: boolean
                    description: >-
                      When enabled, a new deployment is automatically triggered
                      on every push to the default branch
                    example: true
                  is_preview_enabled:
                    type: boolean
                    description: >-
                      When enabled, preview deployments are created for pull
                      requests targeting the default branch
                    example: false
                  git_lfs_enabled:
                    type: boolean
                    description: >-
                      When enabled, Git LFS objects are fetched during the
                      source checkout step of a deployment. Enabled by default.
                      Disable this to skip LFS downloads and speed up checkout
                      when the repository contains LFS files that are not needed
                      at build time.
                    example: true
                  git_type:
                    anyOf:
                      - type: string
                        enum:
                          - github
                          - bitbucket
                          - gitlab
                      - type: 'null'
                    description: >-
                      Git hosting provider for the repository. `github` -
                      GitHub. `bitbucket` - Bitbucket. `gitlab` - GitLab. Null
                      for public git sources.
                    example: github
                  hostname:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Primary hostname assigned to the static site
                    example: my-site.sevalla.app
                  install_command:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Command used to install dependencies before building the
                      static site
                    example: npm install
                  build_command:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Command used to build the static site
                    example: npm run build
                  published_directory:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Directory containing the built files to publish
                    example: dist
                  root_directory:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Root directory of the project within the repository
                    example: /
                  node_version:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Node.js version used to build the static site
                    example: '20'
                  index_file:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Custom index file served as the entry point for the static
                      site
                    example: index.html
                  error_file:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Custom error page file served when a requested path is not
                      found
                    example: 404.html
                  allow_deploy_paths:
                    type: array
                    items:
                      type: string
                    description: >-
                      Glob patterns for file paths that trigger a deployment
                      when changed. When set, only commits touching these paths
                      will trigger auto deploy.
                    example:
                      - src/**
                      - package.json
                  ignore_deploy_paths:
                    type: array
                    items:
                      type: string
                    description: >-
                      Glob patterns for file paths to exclude from deployment
                      triggers. Commits that only touch ignored paths will not
                      trigger auto deploy.
                    example:
                      - docs/**
                      - README.md
                  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 static site 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 static site was last modified, in ISO
                      8601 format
                    example: '2025-01-30T00:00:00.000Z'
                required:
                  - id
                  - company_id
                  - project_id
                  - name
                  - display_name
                  - status
                  - source
                  - repo_url
                  - default_branch
                  - auto_deploy
                  - is_preview_enabled
                  - git_lfs_enabled
                  - git_type
                  - hostname
                  - install_command
                  - build_command
                  - published_directory
                  - root_directory
                  - node_version
                  - index_file
                  - error_file
                  - allow_deploy_paths
                  - ignore_deploy_paths
                  - 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
        '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.

````