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

# Send input to a session

> Send input to a session: a message, a cancellation, or a tool result.



## OpenAPI

````yaml /openapi.json post /v1/sessions/{session_id}/events
openapi: 3.1.0
info:
  title: Gobare Agent API
  version: v1
  description: >-
    Programmatic access to Gobare coding-agent sessions. Conceptually aligned
    with OpenAI's Agents API; deliberately not wire-compatible with it. See the
    divergence list in the product documentation.
servers:
  - url: https://api.{domain}
    variables:
      domain:
        default: gobare.dev
security: []
paths:
  /v1/sessions/{session_id}/events:
    post:
      summary: Send input to a session
      description: 'Send input to a session: a message, a cancellation, or a tool result.'
      operationId: post_sessions_session_id_events
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            maxLength: 255
          description: >-
            Retrying with the same key replays the first answer instead of
            acting again.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventsRequest'
      responses:
        '202':
          description: >-
            Send input to a session: a message, a cancellation, or a tool
            result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InputAccepted'
        '400':
          description: >-
            `invalid_request`. A field this endpoint does not read, a field of
            the wrong shape, a query parameter it does not take, or a body past
            the size ceiling. Refused rather than ignored: a setting you believe
            you made is one we really made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: The access token is missing, unrecognised, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The token is valid but may not perform this call. The message names
            the scope it wanted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            No such endpoint, or no such object under this token's organization.
            Another organization's id is indistinguishable from one that never
            existed, deliberately.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            The session's state does not allow this call, or an identical
            request is already in flight under the same Idempotency-Key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            `rate_limit_exceeded` — the token is past its allowance for this
            bucket; honour `Retry-After`. Or `queue_full` — too many messages
            are already waiting behind the current turn. Branch on `code`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: An unexpected error. Quote the request id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - accessToken: []
components:
  schemas:
    EventsRequest:
      type: object
      example:
        events:
          - type: input.message
            content: Summarise what you found.
      required:
        - events
      description: >-
        One event per request. Batching has no meaning while the vocabulary is
        this small.
      properties:
        events:
          type: array
          description: >-
            Exactly one event. What it does depends on its `type` — send a
            message, answer a tool call, approve, steer or cancel.
          minItems: 1
          maxItems: 1
          items:
            $ref: '#/components/schemas/InputEvent'
    InputAccepted:
      type: object
      required:
        - object
        - session_id
        - type
      properties:
        object:
          type: string
          const: input.accepted
          description: >-
            Always `input.accepted`. Names the shape, so a value can be
            identified without knowing which call returned it.
        session_id:
          type: string
        type:
          type: string
          enum:
            - input.message
            - input.cancel
            - input.tool_result
            - input.steer
        outcome:
          type: string
          enum:
            - accepted
            - already_resolved
            - not_delivered
          description: For input.tool_result.
        queued:
          type: boolean
          description: The session was busy; the message is durably queued and will run.
        queue_position:
          type:
            - integer
            - 'null'
    Error:
      type: object
      required:
        - error
      description: Every refusal this API makes, in one shape.
      properties:
        error:
          description: Always present on a failure, and the only thing present.
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              enum:
                - invalid_request
                - authentication_error
                - permission_denied
                - not_found
                - method_not_allowed
                - conflict
                - queue_full
                - rate_limit_exceeded
                - project_limit_exceeded
                - context_length_exceeded
                - provider_error
                - provider_unauthorized
                - sandbox_error
                - sandbox_unavailable
                - directory_unavailable
                - workspace_recovery_failed
                - bridge_incompatible
                - internal_error
            message:
              type: string
            request_id:
              type: string
              description: >-
                Also on the x-request-id header. Quote it when reporting a
                problem.
    InputEvent:
      type: object
      required:
        - type
      description: The six things you can send a session. One per request.
      properties:
        type:
          type: string
          enum:
            - input.message
            - input.tool_result
            - input.approval
            - input.question_answer
            - input.steer
            - input.cancel
        content:
          description: >-
            For `input.message` and `input.steer`: a string, or an array of
            `{type,text}` parts.
        turn_id:
          type: string
          description: 'For `input.tool_result`: copied from the required action.'
        call_id:
          type: string
          description: >-
            For `input.tool_result`, `input.approval` and
            `input.question_answer`: copied from the required action.
        success:
          type: boolean
          description: 'For `input.tool_result`: whether your function worked.'
        output:
          type: string
          description: For a successful `input.tool_result`. Serialise JSON yourself.
        error:
          type: string
          description: >-
            For a failed `input.tool_result`. Never send a thrown message — it
            reaches the model.
        approved:
          type: boolean
          description: >-
            For `input.approval`: whether the agent may proceed. Required, and
            not defaulted either way — denying something you meant to allow is a
            mistake, and the other direction is worse.
        answer:
          type: string
          description: >-
            For `input.question_answer`: what to tell the agent. It reaches the
            model as written.
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      description: >-
        A `gbr_pat_` access token. Scopes are recorded on the token when it is
        minted.

````