---
title: "Send session input"
method: POST
path: "/v1/agents/sessions/{session_id}/events"
tags: ["Sessions"]
---

# Send session input

`POST /v1/agents/sessions/{session_id}/events`

## Request

- Base URL: `https://api.sandbase.ai`
- URL: `https://api.sandbase.ai/v1/agents/sessions/{session_id}/events`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Send exactly one event: agent.session.input.message or agent.session.input.cancel. The SandBase extension form {input, file_ids} sends text with ready attachments and cannot be combined with events. Idempotency-Key is optional but recommended; reuse the same key when retrying the same input.

## Headers

- `Idempotency-Key` string
- `OpenAI-Beta` 'agents=v1'

## Request body

- SessionEventsRequest: Either events (exactly one event) or the SandBase extension input/file_ids.
  - `events` object[]
    - `type` 'agent.session.input.message' | 'agent.session.input.cancel', required
    - `input` unknown
  - `input` string: SandBase extension. Text input, non-empty.
  - `file_ids` string[]: SandBase extension. Up to 10 distinct ready attachments.

## Response `202`

Input accepted. The response has no body.

## Other responses

- `400`: invalid_request (malformed JSON, unknown fields, failed validation, or an unsupported option)
- `401`: unauthorized: missing, malformed, or conflicting API key headers
- `402`: spending_limit_exceeded: API key spending limit or organization balance exhausted
- `403`: insufficient_scope (scoped key) or org_disabled
- `404`: not_found: the resource does not exist in this organization
- `409`: conflict (Session archived or attachment not ready), session_input_pending, session_input_expired, or session_environment_unavailable
- `502`: executor_rejected or executor_contract_error from the execution layer
- `503`: authorization_unavailable, admission_unavailable, executor_unavailable, storage_unavailable, or internal_error

---

[API](https://skmtc.dev/sandbase/apis/sandbase-api.md) · [All operations](https://skmtc.dev/sandbase/apis/sandbase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbase/apis/sandbase-api/revisions/d40df2467ba2?raw)
