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

# Deploy an app

> Deploy a commit whose release bundle you uploaded with createAppReleaseUpload. The bundle must match `apps/<appId>/` at that commit. For a private branch preview, supply target with environment preview and the pushed branch name, and omit expectedLiveDeploymentId. Use previews during development: inspect the first usable build, then upload and deploy changes on the same branch and reload its stable previewUrl. Previews leave production unchanged. On success getAppDeployment returns buildId and previewUrl. For instructions-only previews the URL starts an app chat pinned to the active branch build. Deploying never changes Git. The candidate is deployed, its migrations applied and its assets, backend and tools probed before it goes live; a candidate that fails its probes is not served, but migrations it applied stay applied. Answers 202 with a deployment to poll at Location. After a lost response, repeat with the same Idempotency-Key; use a new key for a new attempt. `expectedLiveDeploymentId` for production must name the live deployment, or be null before the first.

Alpha: this operation may change or be removed without notice.



## OpenAPI

````yaml /openapi.json post /apps/deployments
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.effectiveai.app/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /apps/deployments:
    post:
      tags:
        - Apps
      summary: Deploy an app
      description: >-
        Deploy a commit whose release bundle you uploaded with
        createAppReleaseUpload. The bundle must match `apps/<appId>/` at that
        commit. For a private branch preview, supply target with environment
        preview and the pushed branch name, and omit expectedLiveDeploymentId.
        Use previews during development: inspect the first usable build, then
        upload and deploy changes on the same branch and reload its stable
        previewUrl. Previews leave production unchanged. On success
        getAppDeployment returns buildId and previewUrl. For instructions-only
        previews the URL starts an app chat pinned to the active branch build.
        Deploying never changes Git. The candidate is deployed, its migrations
        applied and its assets, backend and tools probed before it goes live; a
        candidate that fails its probes is not served, but migrations it applied
        stay applied. Answers 202 with a deployment to poll at Location. After a
        lost response, repeat with the same Idempotency-Key; use a new key for a
        new attempt. `expectedLiveDeploymentId` for production must name the
        live deployment, or be null before the first.


        Alpha: this operation may change or be removed without notice.
      operationId: createAppDeployment
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9\-_.:]+$
            description: >-
              Client-chosen key for safe retries: 1-128 letters, digits, -, _, .
              or :. Use a new random UUID for each intended operation and the
              same key when retrying it. Do not put customer data or credentials
              in the key.
          required: true
          description: >-
            Client-chosen key for safe retries: 1-128 letters, digits, -, _, .
            or :. Use a new random UUID for each intended operation and the same
            key when retrying it. Do not put customer data or credentials in the
            key.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    sourceSha:
                      type: string
                      pattern: ^(?:[a-f0-9]{40}|[a-f0-9]{64})$
                      description: Full lowercase commit ID the bundle was built from.
                    bundleSha256:
                      type: string
                      pattern: ^[0-9a-f]{64}$
                      description: SHA-256 of the uploaded bundle.
                    message:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: Note kept with the deployment.
                    expectedLiveDeploymentId:
                      type: string
                      nullable: true
                      format: uuid
                      description: >-
                        The live deployment you expect, from getApp; null before
                        the first deployment.
                    appId:
                      type: string
                      maxLength: 63
                      pattern: ^app-[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$
                      description: The app to deploy.
                  required:
                    - sourceSha
                    - bundleSha256
                    - expectedLiveDeploymentId
                    - appId
                  additionalProperties: false
                - type: object
                  properties:
                    sourceSha:
                      type: string
                      pattern: ^(?:[a-f0-9]{40}|[a-f0-9]{64})$
                      description: Full lowercase commit ID the bundle was built from.
                    bundleSha256:
                      type: string
                      pattern: ^[0-9a-f]{64}$
                      description: SHA-256 of the uploaded bundle.
                    message:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: Note kept with the deployment.
                    target:
                      type: object
                      properties:
                        environment:
                          type: string
                          enum:
                            - preview
                        branch:
                          type: string
                          minLength: 1
                          maxLength: 255
                          description: >-
                            Exact pushed development branch, excluding main and
                            HEAD.
                      required:
                        - environment
                        - branch
                      additionalProperties: false
                    appId:
                      type: string
                      maxLength: 63
                      pattern: ^app-[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$
                      description: The app to deploy.
                  required:
                    - sourceSha
                    - bundleSha256
                    - target
                    - appId
                  additionalProperties: false
      responses:
        '200':
          description: The same Idempotency-Key replayed a finished attempt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2AppDeploymentAttempt'
        '202':
          description: 'Accepted; poll Location with getAppDeployment. Retry-After: 2.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2AppDeploymentAttempt'
        '400':
          description: Invalid request or idempotency key, or invalid_release.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: Publish permission required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: 'app_not_found: missing, archived, or not an app you can open.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: >-
            release_not_uploaded: no bundle was uploaded for this commit and
            digest. conflict: the live deployment changed, another deployment is
            running, or the Idempotency-Key was used with different input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '413':
          description: JSON request body exceeds 64 KiB.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '415':
          description: Content-Type must be application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: Execution unavailable; retry with the same Idempotency-Key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2AppDeploymentAttempt:
      type: object
      properties:
        id:
          type: string
          format: uuid
        appId:
          type: string
          maxLength: 63
          pattern: ^app-[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$
          description: >-
            App ID: `app-` followed by lowercase letters, digits and hyphens,
            ending in a letter or digit. It is part of the app’s hostname, so
            your organization’s subdomain and the ID together must fit 63
            characters.
        sourceSha:
          type: string
        shape:
          type: string
          nullable: true
          enum:
            - full
            - service
            - instructions
            - null
        bundleSha256:
          type: string
          nullable: true
          pattern: ^[0-9a-f]{64}$
        runtimeUrl:
          type: string
          nullable: true
          format: uri
        mcpUrl:
          type: string
          nullable: true
          format: uri
        target:
          type: object
          properties:
            environment:
              type: string
              enum:
                - preview
            branch:
              type: string
              minLength: 1
              maxLength: 255
              description: Exact pushed development branch, excluding main and HEAD.
          required:
            - environment
            - branch
          additionalProperties: false
        previewUrl:
          type: string
          format: uri
          description: >-
            Private URL for the latest activated build of this branch. Returned
            after success.
        buildId:
          type: string
          format: uuid
          description: >-
            Build activated by this preview attempt. Identical content can reuse
            an existing build.
        createdByEmail:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          nullable: true
          format: date-time
        idempotencyExpiresAt:
          type: string
          nullable: true
          format: date-time
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
        stage:
          type: string
        checks:
          type: object
          nullable: true
          properties:
            passed:
              type: boolean
            checkedAt:
              type: string
              format: date-time
            checks:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  passed:
                    type: boolean
                  detail:
                    type: string
                required:
                  - name
                  - passed
                  - detail
                additionalProperties: false
          required:
            - passed
            - checkedAt
            - checks
          additionalProperties: false
        effects:
          type: object
          properties:
            runtimeChanged:
              type: boolean
            migrationsApplied:
              type: array
              items:
                type: string
            migrationsStatus:
              type: string
              enum:
                - not_started
                - running
                - succeeded
                - unknown
                - failed
            previousRuntimeRestored:
              type: boolean
              nullable: true
          required:
            - runtimeChanged
            - migrationsApplied
            - migrationsStatus
            - previousRuntimeRestored
          additionalProperties: false
        interface:
          type: object
          nullable: true
          properties:
            capabilities:
              type: array
              items:
                type: string
            tools:
              type: array
              items:
                type: object
                additionalProperties:
                  nullable: true
            openapiUrl:
              type: string
              nullable: true
              format: uri
          required:
            - capabilities
            - tools
            - openapiUrl
          additionalProperties: false
        error:
          type: object
          nullable: true
          properties:
            code:
              type: string
            error:
              type: string
            retryable:
              type: boolean
            recovery:
              type: string
          required:
            - code
            - error
            - retryable
            - recovery
          additionalProperties: false
        live:
          type: boolean
          description: >-
            True when production serves this deployment. Branch previews report
            false.
      required:
        - id
        - appId
        - sourceSha
        - shape
        - bundleSha256
        - runtimeUrl
        - mcpUrl
        - createdByEmail
        - createdAt
        - completedAt
        - idempotencyExpiresAt
        - status
        - stage
        - checks
        - effects
        - interface
        - error
        - live
      additionalProperties: false
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
            dataset:
              type: string
              enum:
                - naic
                - osha
              description: Dataset needed for dataset_not_enabled.
            businessCode:
              type: string
              description: The rater’s own refusal code, for business_rejection.
            violations:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    description: Authored or built-in constraint code
                  message:
                    type: string
                    description: Authored message for the failed constraint
                  path:
                    type: string
                    description: Input path of the offending value; empty for the request
                  value:
                    nullable: true
                    description: Offending input value, size-bounded by the runtime
                  constraint:
                    type: string
                    description: The constraint the value failed, as text
                  cite:
                    type: string
                    nullable: true
                    description: >-
                      Filing citation of the constraint, when the source cites
                      one
                required:
                  - code
                  - message
                  - path
                  - value
                  - constraint
                  - cite
                additionalProperties: false
              maxItems: 256
              description: >-
                Each input constraint the submission failed, for invalid_inputs
                and business_rejection.
            violationsTruncated:
              type: boolean
              description: >-
                True when the rater reported more violations than violations
                holds.
            executionId:
              type: string
              description: >-
                The recorded execution of a failed rating, for rater rating
                failures.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: Not currently returned.
          required:
            - code
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.