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

# Answer the agent’s questions

> Answer the questions the agent asked in a turn whose status is needs_input, with answer.outcome answered and a value, or skip them with outcome skipped. The body has the shape the Effective web app sends. Answer each question in value under its id from userInput.questions, with an option’s id or label or in your own words; questions you leave out stay unanswered. The agent then carries on in the same turn, so keep reading the message until it is succeeded or failed. Only the person the questions were asked of can answer.

Supply Idempotency-Key to retry safely: the same key and answer return the message again, and the same key with a different answer returns 409 idempotency_conflict.



## OpenAPI

````yaml /openapi.json post /sessions/{id}/messages/{messageId}/user-input
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.canary.effectiveai.app/api/v2
    description: Canary
security:
  - bearerAuth: []
paths:
  /sessions/{id}/messages/{messageId}/user-input:
    post:
      tags:
        - Sessions
      summary: Answer the agent’s questions
      description: >-
        Answer the questions the agent asked in a turn whose status is
        needs_input, with answer.outcome answered and a value, or skip them with
        outcome skipped. The body has the shape the Effective web app sends.
        Answer each question in value under its id from userInput.questions,
        with an option’s id or label or in your own words; questions you leave
        out stay unanswered. The agent then carries on in the same turn, so keep
        reading the message until it is succeeded or failed. Only the person the
        questions were asked of can answer.


        Supply Idempotency-Key to retry safely: the same key and answer return
        the message again, and the same key with a different answer returns 409
        idempotency_conflict.
      operationId: answerSessionUserInput
      parameters:
        - schema:
            type: string
            format: uuid
            description: Session UUID, e.g. 00000000-0000-4000-8000-000000000001.
            example: 00000000-0000-4000-8000-000000000001
          required: true
          description: Session UUID, e.g. 00000000-0000-4000-8000-000000000001.
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            maxLength: 200
            description: >-
              Message ID returned when the message was sent, or listed in the
              conversation.
            example: 00000000-0000-4000-8000-000000000002
          required: true
          description: >-
            Message ID returned when the message was sent, or listed in the
            conversation.
          name: messageId
          in: path
        - 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: false
          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:
              $ref: '#/components/schemas/V2AnswerSessionUserInputRequest'
      responses:
        '200':
          description: Answers accepted; the message, now running again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2SessionMessage'
        '400':
          description: invalid_request or invalid_cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: 'unauthenticated: valid credentials are required.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: >-
            forbidden: only the person the questions were asked of can answer,
            and readonly members and app credentials cannot.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: The session or message is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: >-
            user_input_not_requested: the message is not waiting for answers.
            idempotency_conflict: the request key was used with a different
            answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '413':
          description: 'request_too_large: the request exceeds 64 KiB.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '415':
          description: 'unsupported_media_type: use application/json.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '500':
          description: 'internal_error: unexpected server error.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: 'temporarily_unavailable: retry later.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2AnswerSessionUserInputRequest:
      type: object
      properties:
        answer:
          oneOf:
            - type: object
              properties:
                outcome:
                  type: string
                  enum:
                    - answered
                value:
                  type: object
                  additionalProperties:
                    type: string
                    minLength: 1
                    maxLength: 10000
                  description: >-
                    Answers by question ID: an option’s id or label, or your own
                    words. Questions you leave out stay unanswered.
                details:
                  type: string
                  minLength: 1
                  maxLength: 10000
                  description: Anything else the agent should know with these answers.
              required:
                - outcome
                - value
              additionalProperties: false
            - type: object
              properties:
                outcome:
                  type: string
                  enum:
                    - skipped
              required:
                - outcome
              additionalProperties: false
              description: >-
                Skip all the questions; the agent carries on without the
                answers.
          description: answered with a value, or skipped.
      required:
        - answer
      additionalProperties: false
    V2SessionMessage:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            Message ID returned when the message was sent, or listed in the
            conversation.
          example: 00000000-0000-4000-8000-000000000002
        status:
          type: string
          enum:
            - queued
            - running
            - needs_input
            - succeeded
            - failed
          x-extensible-enum:
            - queued
            - running
            - needs_input
            - succeeded
            - failed
          description: >-
            queued until the agent picks the message up, running while it works,
            then succeeded or failed. needs_input while the agent waits for
            answers to the questions in userInput; answer them with POST
            /sessions/{id}/messages/{messageId}/user-input. A cancelled turn
            reports failed. Messages are handled one at a time, in the order
            sent. New values can be added; tolerate values you do not recognize.
        cancellationStatus:
          type: string
          enum:
            - cancelling
            - cancelled
          description: >-
            Present after a cancellation request. Cancelling means the stop was
            requested. Cancelled means the turn has stopped.
        message:
          type: string
          description: The text that was sent.
        reply:
          type: string
          nullable: true
          description: >-
            The agent’s reply in Markdown, once the message has finished; null
            before then. A failed message can carry a partial reply.
        createdAt:
          type: string
          format: date-time
          description: When the message was sent, in UTC.
        finishedAt:
          type: string
          nullable: true
          format: date-time
          description: When the reply finished, in UTC; null until then.
        failure:
          type: object
          nullable: true
          properties:
            code:
              type: string
              enum:
                - agent_error
              description: The turn ended without a successful reply.
            error:
              type: string
              description: What went wrong, for people.
          required:
            - code
            - error
          additionalProperties: false
          description: Why the message failed; null unless status is failed.
        userInput:
          $ref: '#/components/schemas/V2SessionUserInput'
      required:
        - id
        - status
        - message
        - reply
        - createdAt
        - finishedAt
        - failure
      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
    V2SessionUserInput:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The ID of this set of questions.
        title:
          type: string
          nullable: true
          description: What the questions are about, as the agent put it.
        questions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Answer the question under this ID in answer.value.
              question:
                type: string
                description: The question, for people.
              options:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Send this ID, or the label, to pick the option.
                    label:
                      type: string
                    description:
                      type: string
                      description: What choosing it means.
                  required:
                    - id
                    - label
                    - description
                  additionalProperties: false
                description: Suggested answers. You can also answer in your own words.
            required:
              - id
              - question
              - options
            additionalProperties: false
      required:
        - id
        - title
        - questions
      additionalProperties: false
      description: The questions the agent asked, present while status is needs_input.
    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.