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

# Answer an ask

> Answer one waiting ask, allow or deny, and return the settled
record. A known id with nothing waiting is 409 rather than 404, so
an operator retrying a click reads "already answered", not "not
found".



## OpenAPI

````yaml /openapi.yaml post /v1/workspaces/{workspace_id}/asks/{ask_id}
openapi: 3.1.0
info:
  title: Mirage API
  version: '0.1'
servers:
  - url: http://127.0.0.1:8765
    description: A local daemon on its default port
security:
  - bearerAuth: []
paths:
  /v1/workspaces/{workspace_id}/asks/{ask_id}:
    post:
      tags:
        - Asks
      summary: Answer an ask
      description: |-
        Answer one waiting ask, allow or deny, and return the settled
        record. A known id with nothing waiting is 409 rather than 404, so
        an operator retrying a click reads "already answered", not "not
        found".
      operationId: answer_ask_v1_workspaces__workspace_id__asks__ask_id__post
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - name: ask_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnswerAskRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AskResponse'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '429':
          $ref: '#/components/responses/429'
components:
  parameters:
    workspaceId:
      name: workspace_id
      in: path
      required: true
      description: The workspace's id.
      schema:
        type: string
  schemas:
    AnswerAskRequest:
      properties:
        answer:
          type: string
          enum:
            - allow
            - deny
          title: Answer
        scope:
          type: string
          enum:
            - once
            - session
          title: Scope
          default: once
        note:
          type: string
          title: Note
          default: ''
      type: object
      required:
        - answer
      title: AnswerAskRequest
    AskResponse:
      properties:
        id:
          type: string
          title: Id
        session_id:
          type: string
          title: Session Id
        command:
          type: string
          title: Command
        argv:
          items:
            type: string
          type: array
          title: Argv
        cwd:
          type: string
          title: Cwd
        paths:
          items:
            type: string
          type: array
          title: Paths
        reason:
          type: string
          title: Reason
        outcome:
          anyOf:
            - type: string
            - type: 'null'
          title: Outcome
        scope:
          type: string
          title: Scope
        note:
          type: string
          title: Note
      type: object
      required:
        - id
        - session_id
        - command
        - argv
        - cwd
        - paths
        - reason
        - outcome
        - scope
        - note
      title: AskResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Error:
      type: object
      properties:
        detail:
          description: What went wrong, as text or a structured record.
        errno:
          type: string
          description: The errno of a failed file call, such as ENOENT.
        refusal:
          type: object
          description: The policy refusal, when a policy refused the call.
      required:
        - detail
    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
  responses:
    '401':
      description: The token is missing or wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
        text/plain:
          schema:
            type: string
            description: The Python daemon answers Unauthorized as plain text.
    '404':
      description: The workspace, session, job or file does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: Past a rate limit, or a new session past max_sessions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default
        local mode with no token accepts requests without one.

````

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