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

# Run callback from the batch DAG

> Called by the rendered batch DAG to update the execution status of a batch deployment. Requires PSK authentication.



## OpenAPI

````yaml post /api/models/{model}/deployments/{name}/runs
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/models/{model}/deployments/{name}/runs:
    post:
      tags:
        - Deployments
      summary: Run callback from the batch DAG
      description: >-
        Called by the rendered batch DAG to update the execution status of a
        batch deployment. Requires PSK authentication.
      operationId: record_run_api_models__model__deployments__name__runs_post
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
            title: Model
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchRunCallback'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentRunSummary'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    BatchRunCallback:
      properties:
        airflow_run_id:
          type: string
          title: Airflow Run Id
        status:
          $ref: '#/components/schemas/DeploymentRunStatus'
        rows_scored:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Scored
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
      type: object
      required:
        - airflow_run_id
        - status
      title: BatchRunCallback
      description: Body the batch DAG posts to /api/deployments/{id}/runs.
    DeploymentRunSummary:
      properties:
        run_id:
          type: string
          format: uuid
          title: Run Id
        airflow_run_id:
          type: string
          title: Airflow Run Id
        status:
          $ref: '#/components/schemas/DeploymentRunStatus'
        rows_scored:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Scored
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
      type: object
      required:
        - run_id
        - airflow_run_id
        - status
      title: DeploymentRunSummary
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DeploymentRunStatus:
      type: string
      enum:
        - queued
        - running
        - succeeded
        - failed
      title: DeploymentRunStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````