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

# Answer a question

> Submits answers for a pending question Review, keyed by question ID, resuming the waiting Worker.



## OpenAPI

````yaml /openapi.json post /v1/rooms/{roomId}/reviews/{requestId}/answer
openapi: 3.1.0
info:
  title: Worklayer Factory API
  version: 1.0.0
  description: >-
    Create custom interfaces to interact with your Worklayer factory—an
    always-on workspace with its own connected apps, skills, memory, files, and
    background Workers (also called an Environment in parts of the web app).
    Send Events into Rooms, read Room History, resolve human Reviews, follow or
    steer Workers, and receive real-time updates via signed Subscriptions.
servers:
  - url: https://api.myworklayer.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Rooms
    description: >-
      Create and manage isolated Rooms and read Room History. Every factory
      includes a main Room (`web`) and supports creating additional Rooms via
      the API. Room History is read-only.
  - name: Events
    description: Send Events into a Room and retrieve stored API Events.
  - name: Workers
    description: Inspect, stream, and steer background Workers spawned by your factory.
  - name: Review
    description: >-
      List and resolve pending approvals, questions, and app connections
      blocking a Worker.
  - name: Subscriptions
    description: >-
      Create, update, rotate, and delete HTTPS webhook endpoints for your
      factory.
  - name: Subscription events
    description: Signed webhook payloads delivered by Worklayer when factory events occur.
paths:
  /v1/rooms/{roomId}/reviews/{requestId}/answer:
    parameters:
      - $ref: '#/components/parameters/RoomId'
      - $ref: '#/components/parameters/RequestId'
    post:
      tags:
        - Review
      summary: Answer a question
      description: >-
        Submits answers for a pending question Review, keyed by question ID,
        resuming the waiting Worker.
      operationId: answerReview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuestionAnswers'
            example:
              answers:
                carrier:
                  optionIds:
                    - ups
      responses:
        '200':
          description: The Worker received the answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewResolved'
              example:
                requestId: >-
                  wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz
                workerId: 6f1c2a9e-4b7d-4e2a-9c51-3d8e0b7a1f24
        '400':
          description: The body is not valid, or the answers do not match the questions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message: Invalid answers.
                error: Bad Request
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: The Worker cannot continue because of billing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 402
                message: Worker admission denied.
        '404':
          $ref: '#/components/responses/RequestNotFound'
        '409':
          $ref: '#/components/responses/RequestChanged'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -X POST
            "https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/reviews/wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz/answer"
            \
              -H "Authorization: Bearer $WORKLAYER_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "answers": {
                  "carrier": {
                    "optionIds": [
                      "ups"
                    ]
                  }
                }
              }'
        - lang: javascript
          label: fetch
          source: >-
            const response = await
            fetch('https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/reviews/wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz/answer',
            {
              method: 'POST',
              headers: {
                Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({
                "answers": {
                  "carrier": {
                    "optionIds": [
                      "ups"
                    ]
                  }
                }
              }),
            });

            const data = await response.json();

            console.log(data);
components:
  parameters:
    RoomId:
      name: roomId
      in: path
      required: true
      description: >-
        Room ID. Pass `web` to target your factory's main Room (the conversation
        in the Worklayer web app).
      schema:
        type: string
        minLength: 1
        maxLength: 191
      example: cmhx3q7v20004l808sd5k2r1m
    RequestId:
      name: requestId
      in: path
      required: true
      description: >-
        The `requestId` of the Review, from List Reviews or from a subscription
        event.
      schema:
        type: string
      example: wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz
  schemas:
    QuestionAnswers:
      type: object
      additionalProperties: false
      required:
        - answers
      properties:
        answers:
          type: object
          description: One answer for each question, by question id.
          additionalProperties:
            oneOf:
              - title: Options
                type: object
                additionalProperties: false
                required:
                  - optionIds
                properties:
                  optionIds:
                    type: array
                    items:
                      type: string
                      minLength: 1
                    minItems: 1
                    maxItems: 10
                    uniqueItems: true
              - title: Text
                type: object
                additionalProperties: false
                required:
                  - text
                properties:
                  text:
                    type: string
                    maxLength: 1000
                    description: A typed answer. It must not be blank.
    ReviewResolved:
      type: object
      required:
        - requestId
        - workerId
      properties:
        requestId:
          type: string
        workerId:
          type: string
    Error:
      type: object
      description: The error body. Most errors have this shape.
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: The HTTP status code.
        message:
          type: string
          description: A short description of the error.
        error:
          type: string
          description: The name of the HTTP status.
  responses:
    Unauthorized:
      description: >-
        The API key is missing, not valid or revoked. The response has the
        header `WWW-Authenticate: Bearer`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Unauthorized
    RequestNotFound:
      description: The Room or the Review is not found, or the Review is not in this Room.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            message: Request not found.
            error: Not Found
    RequestChanged:
      description: >-
        The Review changed or is no longer pending. Get the list again and use
        the new `requestId`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 409
            message: Request has changed.
            error: Conflict
    TooManyRequests:
      description: Too many requests in a short time. Wait, then send the request again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 429
            message: 'ThrottlerException: Too Many Requests'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: wrk-…
      description: >-
        Your factory's Worklayer API key (`wrk-...`). See [Get an API
        key](/quickstart#get-an-api-key) and [Authentication](/authentication).
        Requests sent from the playground execute live against your factory.

````

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