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

# Set an application's push-to-deploy setting

> Turn push-to-deploy on or off for this application. Enabling records the build currently observed as every installation's baseline, so switching it on is not itself a deploy: only a build newer than that one is rolled out. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication plus the X-Ankra-CSRF double-submit header).



## OpenAPI

````yaml https://platform.ankra.app/openapi.json put /api/v1/org/applications/{application_id}/auto-deploy
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /api/v1/org/applications/{application_id}/auto-deploy:
    put:
      tags:
        - Applications API
      summary: Set an application's push-to-deploy setting
      description: >-
        Turn push-to-deploy on or off for this application. Enabling records the
        build currently observed as every installation's baseline, so switching
        it on is not itself a deploy: only a build newer than that one is rolled
        out. A browser session twin is mounted at the same path without the
        /api/v1 prefix (cookie authentication plus the X-Ankra-CSRF
        double-submit header).
      operationId: set_application_auto_deploy_api_v1
      parameters:
        - in: path
          name: application_id
          required: true
          schema:
            title: Application Id
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ankra-Organisation-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetApplicationAutoDeployRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationAutoDeploy'
          description: Successful Response
        '401':
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: >-
            "You do not have permission to configure automatic deploys for this
            application."
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: Not found ("Application not found")
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: >-
            Validation Error, or "This application tracks no branch, so there is
            nothing to deploy on push." / "This application is not linked to a
            repository, so there is nothing to deploy on push."
components:
  schemas:
    SetApplicationAutoDeployRequest:
      properties:
        enabled:
          title: Enabled
          type: boolean
      required:
        - enabled
      title: SetApplicationAutoDeployRequest
      type: object
    ApplicationAutoDeploy:
      description: >-
        An application's push-to-deploy state: whether a successful build of the
        tracked branch redeploys it, and the newest build the platform observed
        on that branch.
      properties:
        enabled:
          title: Enabled
          type: boolean
        branch:
          title: Branch
          type: string
        latest_build_commit_sha:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Build Commit Sha
        latest_build_image_tag:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Build Image Tag
        latest_build_observed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Build Observed At
        latest_workflow_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Workflow Status
        latest_workflow_conclusion:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Workflow Conclusion
      required:
        - enabled
        - branch
        - latest_build_commit_sha
        - latest_build_image_tag
        - latest_build_observed_at
        - latest_workflow_status
        - latest_workflow_conclusion
      title: ApplicationAutoDeploy
      type: object
    DemoDetailError:
      description: >-
        The FastAPI-style detail envelope the demo routes use for
        400/403/404/409/502 responses.
      properties:
        detail:
          type: string
      required:
        - detail
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````