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

# Invoke gateway action

> Invokes one gateway action on behalf of a hosted Atlas task.



## OpenAPI

````yaml /openapi/gateway-v1.yaml post /v1/invoke
openapi: 3.1.0
info:
  title: Atlas Gateway Contract v1
  version: 1.0.0
  description: >
    The customer-owned gateway contract used by hosted Atlas to discover
    actions,

    invoke work, and monitor async jobs.
servers:
  - url: https://gateway.example.com
    description: Example customer gateway
security:
  - bearerAuth: []
tags:
  - name: Gateway
    description: Discovery and execution endpoints exposed by a customer gateway.
paths:
  /v1/invoke:
    post:
      tags:
        - Gateway
      summary: Invoke gateway action
      description: Invokes one gateway action on behalf of a hosted Atlas task.
      operationId: invokeAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GatewayInvokeRequest'
      responses:
        '200':
          description: Action handled by the gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayInvokeResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorEnvelope'
        '422':
          description: Request shape or action input was invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorEnvelope'
components:
  schemas:
    GatewayInvokeRequest:
      type: object
      additionalProperties: false
      required:
        - invocationId
        - meeting
        - session
        - action
        - context
        - callbacks
      properties:
        invocationId:
          type: string
        idempotencyKey:
          type: string
        traceId:
          type: string
        deadlineAt:
          type: string
          format: date-time
        meeting:
          type: object
          additionalProperties: false
          required:
            - id
            - roomName
          properties:
            id:
              type: string
            roomName:
              type: string
        session:
          type: object
          additionalProperties: false
          required:
            - id
            - mode
          properties:
            id:
              type: string
            mode:
              type: string
              enum:
                - active
                - passive
                - listening
        action:
          type: object
          additionalProperties: false
          required:
            - input
          properties:
            id:
              type: string
            name:
              type: string
            input:
              type: object
              additionalProperties: true
        context:
          type: object
          additionalProperties: true
        callbacks:
          type: object
          additionalProperties: false
          properties:
            jobResultUrl:
              type: string
              format: uri
            approvalUrl:
              type: string
              format: uri
            authorization:
              type: string
    GatewayInvokeResponse:
      oneOf:
        - $ref: '#/components/schemas/GatewayCompletedResponse'
        - $ref: '#/components/schemas/GatewayAcceptedResponse'
        - $ref: '#/components/schemas/GatewayApprovalRequiredResponse'
        - $ref: '#/components/schemas/GatewayRejectedResponse'
    GatewayErrorEnvelope:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/GatewayError'
    GatewayCompletedResponse:
      type: object
      additionalProperties: false
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - completed
        outputText:
          type: string
        machineSummary:
          type: string
        dataSchemaVersion:
          type: string
        data:
          type: object
          additionalProperties: true
    GatewayAcceptedResponse:
      type: object
      additionalProperties: false
      required:
        - status
        - job
      properties:
        status:
          type: string
          enum:
            - accepted
        outputText:
          type: string
        machineSummary:
          type: string
        job:
          type: object
          additionalProperties: false
          required:
            - jobId
            - status
          properties:
            jobId:
              type: string
            status:
              type: string
              enum:
                - queued
                - running
            statusUrl:
              type: string
              format: uri
            cancelUrl:
              type: string
              format: uri
    GatewayApprovalRequiredResponse:
      type: object
      additionalProperties: false
      required:
        - status
        - approval
      properties:
        status:
          type: string
          enum:
            - approval_required
        outputText:
          type: string
        machineSummary:
          type: string
        approval:
          type: object
          additionalProperties: false
          required:
            - approvalId
            - reason
          properties:
            approvalId:
              type: string
            reason:
              type: string
            statusUrl:
              type: string
              format: uri
            expiresAt:
              type: string
              format: date-time
    GatewayRejectedResponse:
      type: object
      additionalProperties: false
      required:
        - status
        - error
      properties:
        status:
          type: string
          enum:
            - rejected
        error:
          $ref: '#/components/schemas/GatewayError'
    GatewayError:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - retryable
      properties:
        code:
          type: string
        message:
          type: string
        retryable:
          type: boolean
        details:
          type: object
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Token

````