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

# List deployments

> Retrieve a paginated list of deployments within a workspace, newest first.

Filter by project, app, environment, and lifecycle status. All filters are
optional; with none set, every deployment in the workspace is returned.
Filters nest: `app` requires `project`, and `environment` requires both
`project` and `app`. Results are paginated; when `hasMore` is true, pass the
returned `cursor` to fetch the next page.

**Required Permissions**

Your root key must have the `environment.*.read_deployment` permission.
Listing spans environments, so a grant on a single environment is not
sufficient.




## OpenAPI

````yaml https://spec.speakeasy.com/unkey/unkey/openapi-json-with-code-samples post /v2/deployments.listDeployments
openapi: 3.1.0
info:
  description: >-
    Unkey's API provides programmatic access for all resources within our
    platform.



    ### Authentication

    #

    This API accepts HTTP Bearer credentials. Public integrations use root keys.
    Dashboard-originated requests use a short-lived dashboard proxy JWT minted
    by the dashboard server. Most endpoints require permissions associated with
    the authenticated principal. When making public API requests, include your
    root key in the `Authorization` header:

    ```

    Authorization: Bearer unkey_xxxxxxxxxxx

    ```


    All responses follow a consistent envelope structure that separates
    operational metadata from actual data. This design provides several
    benefits:

    - Debugging: Every response includes a unique requestId for tracing issues

    - Consistency: Predictable response format across all endpoints

    - Extensibility: Easy to add new metadata without breaking existing
    integrations

    - Error Handling: Unified error format with actionable information


    ### Success Response Format:

    ```json

    {
      "meta": {
        "requestId": "req_123456"
      },
      "data": {
        // Actual response data here
      }
    }

    ```


    The meta object contains operational information:

    - `requestId`: Unique identifier for this request (essential for support)


    The data object contains the actual response data specific to each endpoint.


    ### Paginated Response Format:

    ```json

    {
      "meta": {
        "requestId": "req_123456"
      },
      "data": [
        // Array of results
      ],
      "pagination": {
        "cursor": "next_page_token",
        "hasMore": true
      }
    }

    ```


    The pagination object appears on list endpoints and contains:

    - `cursor`: Token for requesting the next page

    - `hasMore`: Whether more results are available


    ### Error Response Format:

    ```json

    {
      "meta": {
        "requestId": "req_2c9a0jf23l4k567"
      },
      "error": {
        "detail": "The resource you are attempting to modify is protected and cannot be changed",
        "status": 403,
        "title": "Forbidden",
        "type": "https://unkey.com/docs/errors/unkey/application/protected_resource"
      }
    }

    ```


    Error responses include comprehensive diagnostic information:

    - `title`: Human-readable error summary

    - `detail`: Specific description of what went wrong

    - `status`: HTTP status code

    - `type`: Link to error documentation

    - `errors`: Array of validation errors (for 400 responses)


    This structure ensures you always have the context needed to debug issues
    and take corrective action.
  title: Unkey API
  version: 2.0.0
servers:
  - url: https://api.unkey.com
security:
  - bearer: []
tags:
  - description: Analytics query operations
    name: analytics
  - description: API management operations
    name: apis
  - description: App management operations
    name: apps
  - description: Deployment operations
    name: deploy
  - description: Deployment operations
    name: deployments
  - description: Environment management operations
    name: environments
  - description: Identity management operations
    name: identities
  - description: API key management operations
    name: keys
  - description: Health check operations
    name: liveness
  - description: Permission and role management operations
    name: permissions
  - description: Gateway policy operations
    name: gateway
  - description: Customer Portal session management
    name: portal
  - description: Rate limiting operations
    name: ratelimit
paths:
  /v2/deployments.listDeployments:
    post:
      tags:
        - deployments
      summary: List deployments
      description: >
        Retrieve a paginated list of deployments within a workspace, newest
        first.


        Filter by project, app, environment, and lifecycle status. All filters
        are

        optional; with none set, every deployment in the workspace is returned.

        Filters nest: `app` requires `project`, and `environment` requires both

        `project` and `app`. Results are paginated; when `hasMore` is true, pass
        the

        returned `cursor` to fetch the next page.


        **Required Permissions**


        Your root key must have the `environment.*.read_deployment` permission.

        Listing spans environments, so a grant on a single environment is not

        sufficient.
      operationId: deployments.listDeployments
      requestBody:
        content:
          application/json:
            examples:
              byEnvironment:
                description: Restrict to one environment, providing the full hierarchy
                summary: List an environment's deployments
                value:
                  app: payments-api
                  environment: production
                  project: payments-service
              workspaceWide:
                description: List the first page of deployments in the workspace
                summary: List all deployments
                value: {}
            schema:
              $ref: '#/components/schemas/V2DeploymentsListDeploymentsRequestBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                deploymentList:
                  description: Successfully retrieved a page of deployments
                  summary: Deployment list
                  value:
                    data:
                      - createdAt: 1704153600000
                        id: dep_1234abcd
                        runtime:
                          command:
                            - node
                            - server.js
                          cpuMillicores: 250
                          memoryMib: 256
                          port: 8080
                          shutdownSignal: SIGTERM
                          storageMib: 0
                          upstreamProtocol: http1
                        status: ready
                      - createdAt: 1704067200000
                        id: dep_5678efgh
                        runtime:
                          command: []
                          cpuMillicores: 250
                          memoryMib: 256
                          port: 8080
                          shutdownSignal: SIGTERM
                          storageMib: 0
                          upstreamProtocol: http1
                        status: failed
                    meta:
                      requestId: req_1234abcd
                    pagination:
                      hasMore: false
              schema:
                $ref: '#/components/schemas/V2DeploymentsListDeploymentsResponseBody'
          description: >
            Successfully retrieved a paginated list of deployments. Use the
            pagination cursor for additional results when `hasMore: true`.
        '400':
          content:
            application/json:
              examples:
                missingParent:
                  summary: Missing parent filter
                  value:
                    error:
                      detail: >-
                        The 'environment' filter requires both 'project' and
                        'app' to be set.
                      status: 400
                      title: Bad Request
                      type: validation-error
                    meta:
                      requestId: req_1234abcd
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponse'
          description: Bad request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              examples:
                missingPermission:
                  summary: Missing required permission
                  value:
                    error:
                      detail: >-
                        Your root key requires the
                        'environment.*.read_deployment' permission to perform
                        this operation
                      status: 403
                      title: Forbidden
                      type: forbidden
                    meta:
                      requestId: req_1234abcd
              schema:
                $ref: '#/components/schemas/ForbiddenErrorResponse'
          description: >-
            Forbidden - Insufficient permissions (requires
            `environment.*.read_deployment`)
        '404':
          content:
            application/json:
              examples:
                projectNotFound:
                  summary: Project not found
                  value:
                    error:
                      detail: The requested project does not exist.
                      status: 404
                      title: Not Found
                      type: not-found
                    meta:
                      requestId: req_1234abcd
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponse'
          description: >-
            Not Found - A referenced project, app, or environment does not exist
            in your workspace
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsErrorResponse'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
          description: Internal server error
      security:
        - bearer: []
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from unkey.py import Unkey, models


            with Unkey(
                root_key="<YOUR_BEARER_TOKEN_HERE>",
            ) as unkey:

                res = unkey.deployments.list_deployments(project="payments-service", app="payments-api", environment="production", status=[
                    models.DeploymentStatus.READY,
                    models.DeploymentStatus.FAILED,
                ], limit=100)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Unkey } from "@unkey/api";

            const unkey = new Unkey({
              rootKey: process.env["UNKEY_ROOT_KEY"] ?? "",
            });

            async function run() {
              const result = await unkey.deployments.listDeployments({
                project: "payments-service",
                app: "payments-api",
                environment: "production",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tunkey \"github.com/unkeyed/sdks/api/go/v2\"\n\t\"github.com/unkeyed/sdks/api/go/v2/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := unkey.New(\n        unkey.WithSecurity(os.Getenv(\"UNKEY_ROOT_KEY\")),\n    )\n\n    res, err := s.Deployments.ListDeployments(ctx, components.V2DeploymentsListDeploymentsRequestBody{\n        Project: unkey.Pointer(\"payments-service\"),\n        App: unkey.Pointer(\"payments-api\"),\n        Environment: unkey.Pointer(\"production\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.V2DeploymentsListDeploymentsResponseBody != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
components:
  schemas:
    V2DeploymentsListDeploymentsRequestBody:
      type: object
      properties:
        project:
          $ref: '#/components/schemas/ResourceIdentifier'
          description: |
            Restrict results to a single project, identified by its ID or slug.
            Required when filtering by `app` or `environment`.
        app:
          $ref: '#/components/schemas/ResourceIdentifier'
          description: |
            Restrict results to a single app, identified by its ID or slug.
            Requires `project` to also be set.
        environment:
          $ref: '#/components/schemas/ResourceIdentifier'
          description: >
            Restrict results to a single environment, identified by its ID or
            slug.

            Requires `project` and `app` to also be set.
        status:
          type: array
          maxItems: 13
          items:
            $ref: '#/components/schemas/DeploymentStatus'
          description: >
            Restrict results to deployments in any of the given lifecycle
            statuses.

            Omit to return deployments in every status.
          example:
            - ready
            - failed
        limit:
          type: integer
          description: |
            Maximum number of deployments to return per request.
            Balance between response size and number of pagination calls needed.
          default: 100
          minimum: 1
          maximum: 100
        cursor:
          type: string
          description: |
            Pagination cursor from a previous response to fetch the next page.
            Use when `hasMore: true` in the previous response.
      additionalProperties: false
      description: >
        Filter deployments within a workspace. All filters are optional; with
        none

        set, every deployment in the workspace is returned, newest first.
    V2DeploymentsListDeploymentsResponseBody:
      type: object
      required:
        - meta
        - data
        - pagination
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        data:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/Deployment'
          description: Array of deployments, ordered newest first.
        pagination:
          $ref: '#/components/schemas/Pagination'
      additionalProperties: false
    BadRequestErrorResponse:
      type: object
      required:
        - meta
        - error
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          $ref: '#/components/schemas/BadRequestErrorDetails'
      description: >-
        Error response for invalid requests that cannot be processed due to
        client-side errors. This typically occurs when request parameters are
        missing, malformed, or fail validation rules. The response includes
        detailed information about the specific errors in the request, including
        the location of each error and suggestions for fixing it. When receiving
        this error, check the 'errors' array in the response for specific
        validation issues that need to be addressed before retrying.
    UnauthorizedErrorResponse:
      type: object
      required:
        - meta
        - error
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          $ref: '#/components/schemas/BaseError'
      description: >-
        Error response when authentication has failed or credentials are
        missing. This occurs when:

        - No authentication token is provided in the request

        - The provided token is invalid, expired, or malformed

        - The token format doesn't match expected patterns


        To resolve this error, ensure you're including a valid root key in the
        Authorization header.
    ForbiddenErrorResponse:
      type: object
      required:
        - meta
        - error
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          $ref: '#/components/schemas/BaseError'
      description: >-
        Error response when the provided credentials are valid but lack
        sufficient permissions for the requested operation. This occurs when:

        - The root key doesn't have the required permissions for this endpoint

        - The operation requires elevated privileges that the current key lacks

        - Access to the requested resource is restricted based on workspace
        settings


        To resolve this error, ensure your root key has the necessary
        permissions or contact your workspace administrator.
    NotFoundErrorResponse:
      type: object
      required:
        - meta
        - error
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          $ref: '#/components/schemas/BaseError'
      description: >-
        Error response when the requested resource cannot be found. This occurs
        when:

        - The specified resource ID doesn't exist in your workspace

        - The resource has been deleted or moved

        - The resource exists but is not accessible with current permissions


        To resolve this error, verify the resource ID is correct and that you
        have access to it.
    TooManyRequestsErrorResponse:
      type: object
      required:
        - meta
        - error
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          $ref: '#/components/schemas/BaseError'
      description: >-
        Error response when the client has sent too many requests in a given
        time period. This occurs when you've exceeded a rate limit or quota for
        the resource you're accessing.


        The rate limit resets automatically after the time window expires. To
        avoid this error:

        - Implement exponential backoff when retrying requests

        - Cache results where appropriate to reduce request frequency

        - Check the error detail message for specific quota information

        - Contact support if you need a higher quota for your use case
    InternalServerErrorResponse:
      type: object
      required:
        - meta
        - error
      properties:
        meta:
          $ref: '#/components/schemas/Meta'
        error:
          $ref: '#/components/schemas/BaseError'
      description: >-
        Error response when an unexpected error occurs on the server. This
        indicates a problem with Unkey's systems rather than your request.


        When you encounter this error:

        - The request ID in the response can help Unkey support investigate the
        issue

        - The error is likely temporary and retrying may succeed

        - If the error persists, contact Unkey support with the request ID
    ResourceIdentifier:
      type: string
      minLength: 3
      maxLength: 255
      pattern: ^[a-zA-Z0-9_-]+$
      description: |
        Identifies a resource by either its unique ID or its slug.
        Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.
      example: proj_1234abcd
    DeploymentStatus:
      type: string
      enum:
        - pending
        - starting
        - building
        - deploying
        - network
        - finalizing
        - ready
        - failed
        - skipped
        - awaiting_approval
        - stopped
        - superseded
        - cancelled
      x-enum-varnames:
        - DeploymentStatusPending
        - DeploymentStatusStarting
        - DeploymentStatusBuilding
        - DeploymentStatusDeploying
        - DeploymentStatusNetwork
        - DeploymentStatusFinalizing
        - DeploymentStatusReady
        - DeploymentStatusFailed
        - DeploymentStatusSkipped
        - DeploymentStatusAwaitingApproval
        - DeploymentStatusStopped
        - DeploymentStatusSuperseded
        - DeploymentStatusCancelled
      description: |
        Current lifecycle status of the deployment. Poll until it reaches a
        terminal state: ready (serving), failed, skipped, superseded, stopped,
        or cancelled.
      example: ready
    Meta:
      type: object
      required:
        - requestId
      properties:
        requestId:
          description: >-
            A unique id for this request. Always include this ID when contacting
            support about a specific API request. This identifier allows Unkey's
            support team to trace the exact request through logs and diagnostic
            systems to provide faster assistance.
          example: req_123
          type: string
      additionalProperties: false
      description: >-
        Metadata object included in every API response. This provides context
        about the request and is essential for debugging, audit trails, and
        support inquiries. The `requestId` is particularly important when
        troubleshooting issues with the Unkey support team.
    Deployment:
      type: object
      required:
        - id
        - status
        - isCurrent
        - environment
        - app
        - project
        - availableActions
        - regions
        - runtime
        - createdAt
      properties:
        id:
          type: string
          description: |
            The unique identifier of the deployment, generated by Unkey.
          example: d_1234abcd
        status:
          $ref: '#/components/schemas/DeploymentStatus'
        isCurrent:
          type: boolean
          description: >
            True when this is the production deployment currently serving
            traffic, i.e.

            on api.acme.com. Only production deployments can be current, and at
            most one

            deployment is current. Rollbacks and promotions change which
            deployment is

            current and serves requests to api.acme.com.
          example: true
        environment:
          type: string
          description: Slug of the environment this deployment belongs to.
          example: production
        app:
          type: string
          description: Slug of the app this deployment belongs to.
          example: payments-api
        project:
          type: string
          description: Slug of the project this deployment belongs to.
          example: acme
        git:
          $ref: '#/components/schemas/DeploymentGit'
          description: >
            Present for git-sourced deployments. Mutually exclusive with
            `docker`.
        docker:
          $ref: '#/components/schemas/DeploymentDocker'
          description: >
            Present for image-sourced deployments. Mutually exclusive with
            `git`.
        availableActions:
          type: array
          items:
            $ref: '#/components/schemas/DeploymentAction'
          description: >
            Lifecycle operations you are allowed to call on this deployment
            right now.

            Empty when none apply (e.g. while building or in a terminal state).
          example:
            - stop
        regions:
          type: array
          items:
            type: string
          description: >
            Regions this deployment is configured to run in. Empty while the
            deployment

            has no scheduled regions yet.
          example:
            - us-east-1
            - eu-west-1
        error:
          $ref: '#/components/schemas/DeploymentError'
          description: |
            Why the deployment failed. Present only when `status` is `failed`.
        domains:
          type: array
          items:
            type: string
          description: |
            Public hostnames this deployment is reachable at.
          example:
            - kebap-app.unkey.app
        runtime:
          $ref: '#/components/schemas/DeploymentRuntime'
        createdAt:
          type: integer
          format: int64
          minimum: 0
          maximum: 9223372036854776000
          description: |
            Unix timestamp in milliseconds when the deployment was created.
          example: 1704067200000
        updatedAt:
          type: integer
          format: int64
          minimum: 0
          maximum: 9223372036854776000
          description: |
            Unix timestamp in milliseconds when the deployment was last updated.
            Omitted if the deployment has never been updated.
          example: 1704153600000
          x-go-type-skip-optional-pointer: true
          x-go-type-skip-optional-pointer-with-omitzero: true
      additionalProperties: false
    Pagination:
      type: object
      properties:
        cursor:
          type: string
          minLength: 1
          maxLength: 1024
          description: |
            Opaque pagination token for retrieving the next page of results.
            Include this exact value in the cursor field of subsequent requests.
            Cursors are temporary and may expire after extended periods.
          example: eyJrZXkiOiJrZXlfMTIzNCIsInRzIjoxNjk5Mzc4ODAwfQ==
        hasMore:
          type: boolean
          description: |
            Indicates whether additional results exist beyond this page.
            When true, use the cursor to fetch the next page.
            When false, you have reached the end of the result set.
          example: true
      required:
        - hasMore
      additionalProperties: false
      description: >-
        Pagination metadata for list endpoints. Provides information necessary
        to traverse through large result sets efficiently using cursor-based
        pagination.
    BadRequestErrorDetails:
      allOf:
        - $ref: '#/components/schemas/BaseError'
        - type: object
          properties:
            errors:
              description: >-
                List of individual validation errors that occurred in the
                request. Each error provides specific details about what failed
                validation, where the error occurred in the request, and
                suggestions for fixing it. This granular information helps
                developers quickly identify and resolve multiple issues in a
                single request without having to make repeated API calls.
              items:
                $ref: '#/components/schemas/ValidationError'
              type: array
          required:
            - errors
      description: >-
        Extended error details specifically for bad request (400) errors. This
        builds on the BaseError structure by adding an array of individual
        validation errors, making it easy to identify and fix multiple issues at
        once.
    BaseError:
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem. This provides detailed information about what went wrong
            and potential remediation steps. The message is intended to be
            helpful for developers troubleshooting the issue.
          example: Property foo is required but is missing.
          type: string
        status:
          description: >-
            HTTP status code that corresponds to this error. This will match the
            status code in the HTTP response. Common codes include `400` (Bad
            Request), `401` (Unauthorized), `403` (Forbidden), `404` (Not
            Found), `409` (Conflict), and `500` (Internal Server Error).
          example: 404
          format: int
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This remains
            constant from occurrence to occurrence of the same problem and
            should be used for programmatic handling.
          example: Not Found
          type: string
        type:
          description: >-
            A URI reference that identifies the problem type. This provides a
            stable identifier for the error that can be used for documentation
            lookups and programmatic error handling. When followed, this URI
            should provide human-readable documentation for the problem type.
          example: https://unkey.com/docs/errors/unkey/resource/not_found
          type: string
      required:
        - title
        - detail
        - status
        - type
      type: object
      additionalProperties: false
      description: >-
        Base error structure following Problem Details for HTTP APIs (RFC 7807).
        This provides a standardized way to carry machine-readable details of
        errors in HTTP response content.
    DeploymentGit:
      type: object
      required:
        - commitSha
      properties:
        commitSha:
          type: string
          description: The git commit SHA this deployment was built from.
          example: 9f2c1a7d3b
        branch:
          type: string
          description: The git branch this deployment was built from. Omitted when unknown.
          example: main
      additionalProperties: false
    DeploymentDocker:
      type: object
      required:
        - image
      properties:
        image:
          type: string
          description: The Docker image this deployment runs.
          example: ghcr.io/acme/api:v1.2.3
      additionalProperties: false
    DeploymentAction:
      type: string
      enum:
        - promote
        - rollback
        - stop
        - start
      x-enum-varnames:
        - DeploymentActionPromote
        - DeploymentActionRollback
        - DeploymentActionStop
        - DeploymentActionStart
      description: >
        A lifecycle operation that can be performed on the deployment in its
        current

        state, given its status, environment, and whether it is the current

        deployment.
      example: promote
    DeploymentError:
      type: object
      required:
        - code
        - step
        - message
      properties:
        code:
          $ref: '#/components/schemas/DeploymentErrorCode'
        step:
          type: string
          description: >
            The pipeline step that failed (e.g. `building`, `deploying`,
            `starting`).
          example: deploying
        message:
          type: string
          description: >
            Human-readable description of why the deployment failed. For
            programmatic

            handling, use `code`.
          example: >-
            No schedulable regions configured. Please configure at least one
            schedulable region before deploying.
      additionalProperties: false
    DeploymentRuntime:
      type: object
      required:
        - vCpus
        - memoryMib
        - storageMib
        - port
        - command
        - shutdownSignal
        - upstreamProtocol
      properties:
        vCpus:
          type: number
          format: double
          description: |
            CPU allocation in vCPUs (1 = one vCPU, 0.5 = half a vCPU).
          example: 0.25
        memoryMib:
          type: integer
          description: |
            Memory allocation in mebibytes.
          example: 256
        storageMib:
          type: integer
          description: |
            Ephemeral storage allocation in mebibytes.
          example: 0
        port:
          type: integer
          description: |
            Port the container listens on.
          example: 8080
        command:
          type: array
          items:
            type: string
          description: |
            Container entrypoint command override. Empty when none is set.
          example:
            - node
            - server.js
        shutdownSignal:
          $ref: '#/components/schemas/EnvironmentShutdownSignal'
        upstreamProtocol:
          $ref: '#/components/schemas/EnvironmentUpstreamProtocol'
        healthcheck:
          $ref: '#/components/schemas/EnvironmentHealthcheck'
          description: >
            HTTP health probe configuration. Omitted when no healthcheck is
            configured.
      additionalProperties: false
    ValidationError:
      additionalProperties: false
      properties:
        location:
          description: >-
            JSON path indicating exactly where in the request the error
            occurred. This helps pinpoint the problematic field or parameter.
            Examples include:

            - 'body.name' (field in request body)

            - 'body.items[3].tags' (nested array element)

            - 'path.apiId' (path parameter)

            - 'query.limit' (query parameter)

            Use this location to identify exactly which part of your request
            needs correction.
          type: string
          example: body.permissions[0].name
        message:
          description: >-
            Detailed error message explaining what validation rule was violated.
            This provides specific information about why the field or parameter
            was rejected, such as format errors, invalid values, or constraint
            violations.
          type: string
          example: Must be at least 3 characters long
        fix:
          description: >-
            A human-readable suggestion describing how to fix the error. This
            provides practical guidance on what changes would satisfy the
            validation requirements. Not all validation errors include fix
            suggestions, but when present, they offer specific remediation
            advice.
          type: string
          example: >-
            Ensure the name uses only alphanumeric characters, underscores, and
            hyphens
      required:
        - location
        - message
      type: object
      description: >-
        Individual validation error details. Each validation error provides
        precise information about what failed, where it failed, and how to fix
        it, enabling efficient error resolution.
    DeploymentErrorCode:
      type: string
      enum:
        - no_schedulable_regions
        - invalid_runtime_settings
        - cpu_quota_exceeded
        - memory_quota_exceeded
        - storage_quota_exceeded
        - build_failed
        - unknown
      x-enum-varnames:
        - DeploymentErrorCodeNoSchedulableRegions
        - DeploymentErrorCodeInvalidRuntimeSettings
        - DeploymentErrorCodeCpuQuotaExceeded
        - DeploymentErrorCodeMemoryQuotaExceeded
        - DeploymentErrorCodeStorageQuotaExceeded
        - DeploymentErrorCodeBuildFailed
        - DeploymentErrorCodeUnknown
      description: >
        The reason a deployment failed. `unknown` means Unkey could not classify
        the

        failure; see `message` for details.
      example: no_schedulable_regions
    EnvironmentShutdownSignal:
      type: string
      enum:
        - SIGTERM
        - SIGINT
        - SIGQUIT
        - SIGKILL
      description: |
        Signal sent to the container on shutdown.
      example: SIGTERM
    EnvironmentUpstreamProtocol:
      type: string
      enum:
        - http1
        - h2c
      description: |
        Protocol used to reach the container.
      example: http1
    EnvironmentHealthcheck:
      type: object
      required:
        - method
        - path
      properties:
        method:
          type: string
          enum:
            - GET
            - POST
          description: |
            HTTP method used to probe the container.
          example: GET
        path:
          type: string
          minLength: 1
          maxLength: 512
          pattern: ^(/[\w\-]+)+(\.[\w]+)?$
          description: |
            HTTP path probed on the container. Must start with a slash.
          example: /healthz
        intervalSeconds:
          type: integer
          minimum: 1
          maximum: 3600
          description: |
            How often the probe runs, in seconds. Defaults to 10 when omitted.
          example: 10
        timeoutSeconds:
          type: integer
          minimum: 1
          maximum: 3600
          description: |
            Per-probe timeout, in seconds. Defaults to 5 when omitted.
          example: 2
        failureThreshold:
          type: integer
          minimum: 1
          maximum: 100
          description: >
            Consecutive failures before the container is restarted. Defaults to
            3 when omitted.
          example: 3
        initialDelaySeconds:
          type: integer
          minimum: 0
          maximum: 3600
          description: >
            Delay before the first probe runs, in seconds. Defaults to 0 when
            omitted.
          example: 5
      additionalProperties: false
  securitySchemes:
    bearer:
      bearerFormat: bearer token
      description: >-
        Unkey uses bearer tokens for authentication. Public integrations use
        root keys, while the dashboard proxy uses short-lived JWTs.

        To authenticate, include the token in the Authorization header of each
        request:

        ```

        Authorization: Bearer unkey_123

        ```

        Root keys have specific permissions attached to them, controlling what
        operations they can perform. Legacy permissions use tuple strings like
        `api.*.create_key`; resource permissions use Unkey Resource Names plus
        actions, like `unkey:v1:ws_123:keyspaces/*#create_key`.

        Security best practices:

        - Keep root keys secure and never expose them in client-side code

        - Use different root keys for different environments

        - Rotate keys periodically, especially after team member departures

        - Create keys with minimal necessary permissions following least
        privilege principle

        - Monitor key usage with audit logs.
      scheme: bearer
      type: http
      x-speakeasy-name-override: rootKey

````