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

# Answer execution question

> Answer an execution's pending question. The first valid answer wins, and the run continues.
Sending the same answer again returns 200. A different answer to an answered question returns 409.
An answer after the question expired, or after the run ended, returns 410.
An answer that does not match the question's answerSchema returns 422 with one error per problem.



## OpenAPI

````yaml https://odyssey.asteroid.ai/agents/v2/openapi.yaml post /agents/v2/executions/{executionId}/answers
openapi: 3.1.0
info:
  title: Agent Service
  version: v1
servers:
  - url: https://odyssey.asteroid.ai
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
  - name: Environments
  - name: Schedules
  - name: Execution
  - name: Files
  - name: Profiles
  - name: Profile Groups
  - name: Agent Profiles
  - name: Agent Profile Pools
  - name: Workflows
  - name: Execution Batches
  - name: Scheduled Executions
  - name: Schema
  - name: Documentation
  - name: Context
  - name: API Keys
  - name: Integrations
  - name: Billing
  - name: Proxy Gateways
  - name: Admin Customer Activity
  - name: Reference
  - name: Workflow Tags
  - name: Secrets
  - name: Vault
  - name: Catalog
  - name: Chats
  - name: Insights
  - name: Portal Skills
  - name: Skills
  - name: Memory
  - name: Workflow Versions
  - name: Support
paths:
  /agents/v2/executions/{executionId}/answers:
    post:
      tags:
        - Execution
      summary: Answer execution question
      description: >-
        Answer an execution's pending question. The first valid answer wins, and
        the run continues.

        Sending the same answer again returns 200. A different answer to an
        answered question returns 409.

        An answer after the question expired, or after the run ended, returns
        410.

        An answer that does not match the question's answerSchema returns 422
        with one error per problem.
      operationId: ExecutionAnswers_answer
      parameters:
        - in: path
          name: executionId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Agents.Execution.AnswerQuestionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agents.Execution.ExecutionQuestion'
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.BadRequestErrorBody'
          description: The server could not understand the request due to invalid syntax.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.UnauthorizedErrorBody'
          description: Access is unauthorized.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.ForbiddenErrorBody'
          description: Access is forbidden.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.NotFoundErrorBody'
          description: The server cannot find the requested resource.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.ConflictErrorBody'
          description: The request conflicts with the current state of the server.
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.GoneErrorBody'
          description: Client error
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agents.Execution.AnswerInvalidErrorBody'
          description: Client error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.InternalServerErrorBody'
          description: Server error
components:
  schemas:
    Common.uuid:
      format: uuid
      type: string
    Agents.Execution.AnswerQuestionRequest:
      description: An answer to a pending question
      properties:
        answer:
          $ref: '#/components/schemas/Common.QuestionAnswer'
        questionId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: >-
            The question to answer, from pause.question.id or GET
            /executions/{executionId}/questions
      required:
        - questionId
        - answer
      type: object
    Agents.Execution.ExecutionQuestion:
      description: A question a run asked a person, and its answer once it has one
      properties:
        actor:
          allOf:
            - $ref: '#/components/schemas/Common.Actor'
          description: >-
            Who answered it. Present when status is answered and the caller may
            see who it was.
        allowFreeText:
          description: >-
            When true, an answer may be free_text instead of value. The asker
            handles the text. It is never mapped onto answerSchema.
          type: boolean
        answer:
          allOf:
            - $ref: '#/components/schemas/Common.QuestionAnswer'
          description: The answer. Present when status is answered.
        answerSchema:
          description: The JSON Schema an answer must match
          type: object
          unevaluatedProperties: {}
        answeredVia:
          allOf:
            - $ref: '#/components/schemas/Common.AnsweredVia'
          description: Which call answered it. Present when status is answered.
        closedAt:
          description: When the question stopped being pending
          format: date-time
          type: string
        createdAt:
          format: date-time
          type: string
        details:
          description: More context for the person who answers, when the asker gave some
          type: string
        executionId:
          $ref: '#/components/schemas/Common.uuid'
        expiresAt:
          description: When the run stops waiting for an answer
          format: date-time
          type: string
        id:
          $ref: '#/components/schemas/Common.uuid'
        key:
          description: >-
            The key the asker gave the question, unique within the execution.
            Use it to match the question to the workflow step that asked it.
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$
          type: string
        kind:
          $ref: '#/components/schemas/Common.QuestionKind'
        options:
          description: >-
            The choices, for single_select and multi_select. Absent for other
            types.
          items:
            $ref: '#/components/schemas/Agents.Execution.AnswerOption'
          type: array
        payload:
          description: Data the asker attached for the person or system that answers
          type: object
          unevaluatedProperties: {}
        status:
          $ref: '#/components/schemas/Agents.Execution.QuestionStatus'
        text:
          description: The question, as a person reads it
          type: string
        type:
          $ref: '#/components/schemas/Common.QuestionType'
      required:
        - id
        - executionId
        - kind
        - key
        - text
        - type
        - answerSchema
        - allowFreeText
        - status
        - createdAt
        - expiresAt
      type: object
    Common.BadRequestErrorBody:
      properties:
        code:
          enum:
            - 400
          type: number
          x-enum-varnames:
            - BadRequest
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        errors:
          description: The parameters that failed validation, when known
          items:
            $ref: '#/components/schemas/Common.FieldError'
          type: array
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.UnauthorizedErrorBody:
      properties:
        code:
          enum:
            - 401
          type: number
          x-enum-varnames:
            - Unauthorized
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.ForbiddenErrorBody:
      properties:
        capability:
          description: The missing capability key, when reason is capability_required
          type: string
        code:
          enum:
            - 403
          type: number
          x-enum-varnames:
            - Forbidden
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        reason:
          allOf:
            - $ref: '#/components/schemas/Common.ForbiddenReason'
          description: Why the request was refused, when the client can act on it
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.NotFoundErrorBody:
      properties:
        code:
          enum:
            - 404
          type: number
          x-enum-varnames:
            - NotFound
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.ConflictErrorBody:
      properties:
        code:
          enum:
            - 409
          type: number
          x-enum-varnames:
            - Conflict
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.GoneErrorBody:
      properties:
        code:
          enum:
            - 410
          type: number
          x-enum-varnames:
            - Gone
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Agents.Execution.AnswerInvalidErrorBody:
      properties:
        code:
          enum:
            - 422
          type: number
          x-enum-varnames:
            - UnprocessableEntity
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        errors:
          items:
            $ref: '#/components/schemas/Agents.Execution.AnswerError'
          type: array
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
        - errors
      type: object
    Common.InternalServerErrorBody:
      properties:
        code:
          enum:
            - 500
          type: number
          x-enum-varnames:
            - InternalServerError
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.QuestionAnswer:
      description: >-
        An answer to a question: a value that matches its answer schema, or free
        text
      discriminator:
        mapping:
          free_text: '#/components/schemas/Common.FreeTextAnswer'
          value: '#/components/schemas/Common.ValueAnswer'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/Common.ValueAnswer'
        - $ref: '#/components/schemas/Common.FreeTextAnswer'
      type: object
    Common.Actor:
      description: >-
        Who did something: a person, an API key or one of Asteroid's services.
        Absent on a record made before actors were stored, on one a system job
        made, and when the caller may not see who it was.
      properties:
        client:
          allOf:
            - $ref: '#/components/schemas/Common.ActorClient'
          description: >-
            The program the caller used. Absent when it is not known, as on a
            record made before it was stored.
        id:
          description: The person's id, the key's id, or the service's name
          type: string
        kind:
          $ref: '#/components/schemas/Common.ActorKind'
        name:
          description: >-
            What to show to this caller. A person: an email, "Asteroid" for
            staff to a caller who is not staff, "Former member" or "Deleted
            user". A key: its name, "API key" or "Deleted API key". A service:
            its name. Only some endpoints set it.
          type: string
      required:
        - kind
        - id
      type: object
    Common.AnsweredVia:
      description: Which call answered the question
      enum:
        - answers_endpoint
      type: string
    Common.QuestionKind:
      description: >-
        What asked the question. reply: a workflow script called waitForReply.
        confirm: requireConfirmation or a transition confirmation. ask: the
        agent's AskUserQuestion tool. Only reply questions are stored today.
      enum:
        - reply
        - confirm
        - ask
      type: string
    Agents.Execution.AnswerOption:
      description: >-
        One choice of a single_select or multi_select question. Derived from
        answerSchema.
      properties:
        description:
          type: string
        exclusive:
          description: >-
            multi_select only. When chosen, it must be the only value, such as
            "None of the above".
          type: boolean
        label:
          description: What to show a person
          type: string
        value:
          description: The value to send in answer
          type: string
      required:
        - value
        - label
      type: object
    Agents.Execution.QuestionStatus:
      description: >-
        Where a question is in its life. A question is pending until it is
        answered, its wait times out (expired), the run ends (cancelled), or the
        run stops waiting without an answer (interrupted).
      enum:
        - pending
        - answered
        - expired
        - cancelled
        - interrupted
      type: string
    Common.QuestionType:
      description: The kind of answer the question takes. Derived from the answer schema.
      enum:
        - yes_no
        - single_select
        - multi_select
        - date
        - number
        - text
      type: string
    Common.FieldError:
      description: A problem with one request parameter
      properties:
        detail:
          description: What is wrong with it
          type: string
        parameter:
          description: The query or path parameter name
          type: string
      required:
        - parameter
        - detail
      type: object
    Common.ForbiddenReason:
      enum:
        - capability_required
        - geo_blocked
      type: string
    Agents.Execution.AnswerError:
      description: One reason an answer is not valid
      properties:
        message:
          type: string
        path:
          description: >-
            JSON Pointer to the part of the answer that is wrong. An empty
            string means the whole answer.
          type: string
      required:
        - path
        - message
      type: object
    Common.FreeTextAnswer:
      description: >-
        An answer in the person's own words. Allowed only when the question
        allows free text.
      properties:
        kind:
          enum:
            - free_text
          type: string
        text:
          minLength: 1
          type: string
      required:
        - kind
        - text
      type: object
    Common.ValueAnswer:
      description: An answer valid against the question's answer schema
      properties:
        kind:
          enum:
            - value
          type: string
        value:
          description: >-
            Matches the answer schema: a boolean, a string, a number, a
            YYYY-MM-DD date or a list of option values
      required:
        - kind
        - value
      type: object
    Common.ActorClient:
      description: The program a caller used
      enum:
        - web
        - cli
        - mcp
        - astro
        - sdk
      type: string
    Common.ActorKind:
      description: The kind of caller that did something
      enum:
        - person
        - api_key
        - service
      type: string
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-Api-Key
      type: apiKey

````

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