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

# Deploy static site

> Trigger a new deployment for a static site. By default, deploys the latest commit on the default branch. You can optionally specify a different branch or roll back to a previous deployment by providing a deployment_id. The deployment runs asynchronously - use the list deployments endpoint to track progress.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json post /static-sites/{id}/deployments
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}/deployments:
    post:
      tags:
        - Static sites
      summary: Deploy static site
      description: >-
        Trigger a new deployment for a static site. By default, deploys the
        latest commit on the default branch. You can optionally specify a
        different branch or roll back to a previous deployment by providing a
        deployment_id. The deployment runs asynchronously - use the list
        deployments endpoint to track progress.
      operationId: deployStaticSiteV3
      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:
                branch:
                  description: >-
                    Git branch to deploy. When omitted, the static site default
                    branch is used.
                  type: string
                deployment_id:
                  description: >-
                    Identifier of a previous deployment to roll back to. When
                    provided, the branch field is ignored.
                  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)$
              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 deployment
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  static_site_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: Identifier of the static site this deployment belongs to
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  status:
                    anyOf:
                      - type: string
                        enum:
                          - waiting
                          - inProgress
                          - success
                          - failed
                          - cancelled
                          - skipped
                      - type: 'null'
                    description: >-
                      Current status of the deployment. `waiting` - queued for
                      processing. `inProgress` - build or publish is running.
                      `success` - deployed successfully. `failed` - deployment
                      failed. `cancelled` - cancelled before completion.
                      `skipped` - skipped because no changes were detected.
                    example: success
                  type:
                    anyOf:
                      - type: string
                        enum:
                          - manual
                          - automatic
                      - type: 'null'
                    description: >-
                      How the deployment was triggered. `manual` - triggered via
                      API or dashboard. `automatic` - triggered by a Git push.
                    example: manual
                  repo_url:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Full URL of the Git repository used for this deployment
                    example: https://github.com/user/static-site
                  branch:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Git branch deployed
                    example: main
                  is_preview:
                    anyOf:
                      - type: boolean
                      - type: 'null'
                    description: Whether this is a preview deployment for a pull request
                    example: false
                  author_login:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Git username of the commit author
                    example: octocat
                  author_img:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Avatar URL of the commit author
                    example: https://avatars.githubusercontent.com/u/1234
                  commit_sha:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Full SHA of the deployed commit
                    example: abc123def456
                  commit_message:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Commit message of the deployed commit
                    example: Update landing page
                  cloud_build_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Identifier of the cloud build job for this deployment
                    example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                  build_error:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Error message from the build step if the deployment failed
                    example: 'Build failed: exit code 1'
                  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 deployment 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 deployment was last modified, in ISO
                      8601 format
                    example: '2025-01-30T00:00:00.000Z'
                  finished_at:
                    anyOf:
                      - 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))$
                      - type: 'null'
                    description: Timestamp when the deployment finished, in ISO 8601 format
                    example: '2025-01-30T00:00:00.000Z'
                  started_at:
                    anyOf:
                      - 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))$
                      - type: 'null'
                    description: >-
                      Timestamp when the deployment started building, in ISO
                      8601 format
                    example: '2025-01-30T00:00:00.000Z'
                required:
                  - id
                  - static_site_id
                  - status
                  - type
                  - repo_url
                  - branch
                  - is_preview
                  - author_login
                  - author_img
                  - commit_sha
                  - commit_message
                  - cloud_build_id
                  - build_error
                  - created_at
                  - updated_at
                  - finished_at
                  - started_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.

````