---
title: "Push session events"
description: "Single entry point for user-initiated events (text submission, cancellation, regeneration, edit, stop, steer, queue hold/release/move, model config change). Accepts one or more events processed in array order. Answers 204, or with receipt set, 200 with the delivery receipt: duplicate when the session already accepted the idempotency key, so no new events follow for it."
url: "https://www.thecompany.company/docs/api/sessions/push-events"
---

# Push session events

> Single entry point for user-initiated events (text submission, cancellation, regeneration, edit, stop, steer, queue hold/release/move, model config change). Accepts one or more events processed in array order. Answers 204, or with receipt set, 200 with the delivery receipt: duplicate when the session already accepted the idempotency key, so no new events follow for it.

- **Surface:** The App API
- **Endpoint:** `POST https://api.thecompany.company/v1/sessions/{id}/events`
- **Operation ID:** `sessions.pushEvents`
- **Authentication:** `Authorization: Bearer <TOKEN>`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | `path` | `string` | Yes |  |

## Request Body (`application/json`)

**Required:** Yes

Schema: `object`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `events` | `array<TextSubmitted \| Stopped \| SessionSuggestionResolved \| ...>` | Yes |  |
| `events[] (TextSubmitted)._tag` | `string` | Yes |  |
| `events[] (TextSubmitted).operationId` | `string` | No |  |
| `events[] (TextSubmitted).messages` | `array<TextInput>` | Yes |  |
| `events[] (TextSubmitted).messages[].content` | `string` | Yes |  |
| `events[] (Stopped)._tag` | `string` | Yes |  |
| `events[] (Stopped).operationId` | `string` | No |  |
| `events[] (SessionSuggestionResolved)._tag` | `string` | Yes |  |
| `events[] (SessionSuggestionResolved).suggestionId` | `string` | Yes |  |
| `events[] (SessionSuggestionResolved).outcome` | `string` | Yes |  |
| `events[] (SessionSuggestionResolved).sessionId` | `string \| null` | No | TypeID with prefix "asess_" (format-validated). |
| `events[] (SessionSuggestionResolved).claimId` | `string` | No |  |
| `events[] (SessionSuggestionResolved).operationId` | `string` | No |  |
| `events[] (SessionSuggestionClaimRequested)._tag` | `string` | Yes |  |
| `events[] (SessionSuggestionClaimRequested).suggestionId` | `string` | Yes |  |
| `events[] (SessionSuggestionClaimRequested).claimId` | `string` | Yes |  |
| `events[] (SessionSuggestionClaimRequested).placement` | `string` | Yes |  |
| `events[] (SessionSuggestionClaimRequested).sessionId` | `string` | Yes | TypeID with prefix "asess_" (format-validated). |
| `events[] (SessionSuggestionClaimRequested).operationId` | `string` | No |  |
| `events[] (SessionSuggestionClaimReleased)._tag` | `string` | Yes |  |
| `events[] (SessionSuggestionClaimReleased).suggestionId` | `string` | Yes |  |
| `events[] (SessionSuggestionClaimReleased).claimId` | `string` | Yes |  |
| `events[] (SessionSuggestionClaimReleased).error` | `string` | No |  |
| `events[] (SessionSuggestionClaimReleased).operationId` | `string` | No |  |
| `events[] (Resumed)._tag` | `string` | Yes |  |
| `events[] (Resumed).operationId` | `string` | No |  |
| `events[] (Cancelled)._tag` | `string` | Yes |  |
| `events[] (Cancelled).operationId` | `string` | No |  |
| `events[] (Cancelled).queueEntryId` | `number` | Yes |  |
| `events[] (QueueCancelled)._tag` | `string` | Yes |  |
| `events[] (QueueCancelled).operationId` | `string` | No |  |
| `events[] (Steered)._tag` | `string` | Yes |  |
| `events[] (Steered).operationId` | `string` | No |  |
| `events[] (Steered).queueEntryId` | `number` | Yes |  |
| `events[] (QueueFolded)._tag` | `string` | Yes |  |
| `events[] (QueueFolded).operationId` | `string` | No |  |
| `events[] (QueueFolded).queueEntryId` | `number` | Yes |  |
| `events[] (Rewound)._tag` | `string` | Yes |  |
| `events[] (Rewound).operationId` | `string` | No |  |
| `events[] (Rewound).messageId` | `number` | Yes |  |
| `events[] (Rewound).restoreWorkspace` | `boolean` | No |  |
| `events[] (BranchSwitched)._tag` | `string` | Yes |  |
| `events[] (BranchSwitched).operationId` | `string` | No |  |
| `events[] (BranchSwitched).branchId` | `number` | Yes |  |
| `events[] (Regenerated)._tag` | `string` | Yes |  |
| `events[] (Regenerated).operationId` | `string` | No |  |
| `events[] (Regenerated).messageId` | `number` | Yes |  |
| `events[] (Retried)._tag` | `string` | Yes |  |
| `events[] (Retried).operationId` | `string` | No |  |
| `events[] (Edited)._tag` | `string` | Yes |  |
| `events[] (Edited).operationId` | `string` | No |  |
| `events[] (Edited).messageId` | `number` | Yes |  |
| `events[] (Edited).parts` | `array<any>` | Yes |  |
| `events[] (QueueEdited)._tag` | `string` | Yes |  |
| `events[] (QueueEdited).operationId` | `string` | No |  |
| `events[] (QueueEdited).queueEntryId` | `number` | Yes |  |
| `events[] (QueueEdited).message` | `any` | Yes |  |
| `events[] (QueueEdited).releaseHold` | `boolean` | No |  |
| `events[] (QueueHeld)._tag` | `string` | Yes |  |
| `events[] (QueueHeld).operationId` | `string` | No |  |
| `events[] (QueueHeld).index` | `integer` | Yes |  |
| `events[] (QueueHeld).strategy` | `string \| null` | No |  |
| `events[] (QueueReleased)._tag` | `string` | Yes |  |
| `events[] (QueueReleased).operationId` | `string` | No |  |
| `events[] (QueueReleased).index` | `integer` | Yes |  |
| `events[] (QueueEntryHeld)._tag` | `string` | Yes |  |
| `events[] (QueueEntryHeld).operationId` | `string` | No |  |
| `events[] (QueueEntryHeld).queueEntryId` | `number` | Yes |  |
| `events[] (QueueEntryHeld).strategy` | `string \| null` | No |  |
| `events[] (QueueEntryHeld).reason` | `string \| null` | No |  |
| `events[] (QueueEntryReleased)._tag` | `string` | Yes |  |
| `events[] (QueueEntryReleased).operationId` | `string` | No |  |
| `events[] (QueueEntryReleased).queueEntryId` | `number` | Yes |  |
| `events[] (QueueEntryReleased).wake` | `boolean` | No |  |
| `events[] (QueueMoved)._tag` | `string` | Yes |  |
| `events[] (QueueMoved).operationId` | `string` | No |  |
| `events[] (QueueMoved).queueEntryId` | `number` | Yes |  |
| `events[] (QueueMoved).to` | `integer` | Yes |  |
| `events[] (ToolResultSubmitted)._tag` | `string` | Yes |  |
| `events[] (ToolResultSubmitted).operationId` | `string` | No |  |
| `events[] (ToolResultSubmitted).results` | `array<object>` | Yes |  |
| `events[] (ToolResultSubmitted).results[] (object).toolCallId` | `string` | Yes |  |
| `events[] (ToolResultSubmitted).results[] (object).state` | `string` | Yes |  |
| `events[] (ToolResultSubmitted).results[] (object).errorText` | `string` | Yes |  |
| `events[] (ToolResultSubmitted).results[] (object).toolCallId` | `string` | Yes |  |
| `events[] (ToolResultSubmitted).results[] (object).state` | `string` | Yes |  |
| `events[] (ToolResultSubmitted).results[] (object).output` | `any` | Yes |  |
| `events[] (SecretAskOutcomeSubmitted)._tag` | `string` | Yes |  |
| `events[] (SecretAskOutcomeSubmitted).operationId` | `string` | No |  |
| `events[] (SecretAskOutcomeSubmitted).toolCallId` | `string` | Yes |  |
| `events[] (SecretAskOutcomeSubmitted).mode` | `string` | Yes |  |
| `events[] (SecretAskOutcomeSubmitted).name` | `string` | No |  |
| `events[] (SecretAskOutcomeSubmitted).persisted` | `boolean` | Yes |  |
| `events[] (SecretAskOutcomeSubmitted).status` | `string` | Yes |  |
| `events[] (QuestionAnswerSubmitted)._tag` | `string` | Yes |  |
| `events[] (QuestionAnswerSubmitted).operationId` | `string` | No |  |
| `events[] (QuestionAnswerSubmitted).toolCallId` | `string` | Yes |  |
| `events[] (QuestionAnswerSubmitted).status` | `string` | Yes |  |
| `events[] (QuestionAnswerSubmitted).answers` | `array<object>` | Yes |  |
| `events[] (QuestionAnswerSubmitted).answers[].question` | `string` | Yes |  |
| `events[] (QuestionAnswerSubmitted).answers[].answer` | `string \| array<string>` | Yes |  |
| `events[] (DetachedInteractionSubmitted)._tag` | `string` | Yes |  |
| `events[] (DetachedInteractionSubmitted).operationId` | `string` | No |  |
| `events[] (DetachedInteractionSubmitted).toolCallId` | `string` | Yes |  |
| `events[] (DetachedInteractionSubmitted).toolName` | `string` | Yes |  |
| `events[] (DetachedInteractionSubmitted).resolution` | `any` | Yes |  |
| `events[] (ToolApprovalResponded)._tag` | `string` | Yes |  |
| `events[] (ToolApprovalResponded).operationId` | `string` | No |  |
| `events[] (ToolApprovalResponded).responses` | `array<object>` | Yes |  |
| `events[] (ToolApprovalResponded).responses[].approvalId` | `string` | Yes |  |
| `events[] (ToolApprovalResponded).responses[].toolCallId` | `string` | Yes |  |
| `events[] (ToolApprovalResponded).responses[].approved` | `boolean` | Yes |  |
| `events[] (ToolApprovalResponded).responses[].reason` | `string` | No |  |
| `events[] (MessagesSubmitted)._tag` | `string` | Yes |  |
| `events[] (MessagesSubmitted).operationId` | `string` | No |  |
| `events[] (MessagesSubmitted).messages` | `array<any>` | Yes |  |
| `events[] (MessagesSubmitted).behavior` | `string \| null` | No |  |
| `events[] (MessagesSubmitted).queue` | `object` | No |  |
| `events[] (MessagesSubmitted).queue.index` | `integer` | No |  |
| `events[] (MessagesSubmitted).queue.hold` | `boolean` | No |  |
| `events[] (MessageReactionSet)._tag` | `string` | Yes |  |
| `events[] (MessageReactionSet).operationId` | `string` | No |  |
| `events[] (MessageReactionSet).messageId` | `string` | Yes |  |
| `events[] (MessageReactionSet).emoji` | `string` | Yes |  |
| `events[] (MessageReactionSet).active` | `boolean` | Yes |  |
| `events[] (ModelConfigChanged)._tag` | `string` | Yes |  |
| `events[] (ModelConfigChanged).operationId` | `string` | No |  |
| `events[] (ModelConfigChanged).config` | `object` | Yes |  |
| `events[] (ModelConfigChanged).config.modelId` | `string` | Yes |  |
| `events[] (ModelConfigChanged).config.reasoning` | `string` | Yes |  |
| `events[] (ModelConfigChanged).config.speed` | `string \| null` | No |  |
| `events[] (SubscriptionPin)._tag` | `string` | Yes |  |
| `events[] (SubscriptionPin).operationId` | `string` | No |  |
| `events[] (SubscriptionPin).provider` | `string` | Yes |  |
| `events[] (SubscriptionPin).connectionId` | `string` | Yes |  |
| `events[] (ModeChanged)._tag` | `string` | Yes |  |
| `events[] (ModeChanged).operationId` | `string` | No |  |
| `events[] (ModeChanged).mode` | `string \| null` | Yes |  |
| `events[] (ModeChanged).ifUnset` | `boolean` | No | Apply only while the session has no active and no displaced mode. Reconciliation pushes (e.g. guide posture healing) use it so a re-assertion can never clobber a live mode such as plan. |
| `events[] (AllowedModesChanged)._tag` | `string` | Yes |  |
| `events[] (AllowedModesChanged).operationId` | `string` | No |  |
| `events[] (AllowedModesChanged).modes` | `array<string> \| null` | Yes |  |
| `events[] (CompactionRequested)._tag` | `string` | Yes |  |
| `events[] (CompactionRequested).operationId` | `string` | No |  |
| `events[] (CompactionRequested).instructions` | `string` | No |  |
| `events[] (CompactionRequested).attemptId` | `string \| null` | No |  |
| `events[] (GoalSubmitted)._tag` | `string` | Yes |  |
| `events[] (GoalSubmitted).operationId` | `string` | No |  |
| `events[] (GoalSubmitted).message` | `any` | Yes |  |
| `events[] (GoalSubmitted).tokenBudget` | `integer \| null` | Yes |  |
| `events[] (GoalSubmitted).behavior` | `string \| null` | No |  |
| `events[] (GoalEdited)._tag` | `string` | Yes |  |
| `events[] (GoalEdited).operationId` | `string` | No |  |
| `events[] (GoalEdited).objective` | `string \| null` | No |  |
| `events[] (GoalEdited).budget` | `object` | No |  |
| `events[] (GoalEdited).budget.tokenBudget` | `integer \| null` | Yes |  |
| `events[] (GoalEdited).revision` | `integer` | Yes |  |
| `events[] (GoalPauseRequested)._tag` | `string` | Yes |  |
| `events[] (GoalPauseRequested).operationId` | `string` | No |  |
| `events[] (GoalResumeRequested)._tag` | `string` | Yes |  |
| `events[] (GoalResumeRequested).operationId` | `string` | No |  |
| `events[] (GoalCleared)._tag` | `string` | Yes |  |
| `events[] (GoalCleared).operationId` | `string` | No |  |
| `idempotencyKey` | `string \| null` | No | Idempotency key for this batch. Reusing a key returns duplicate. The actor applies the batch before persisting its stamp, so an actor crash in that window can replay the whole batch: delivery is at-least-once, not transactional exactly-once. A multi-event batch is stamped only after the complete batch succeeds, so retrying a partially executed batch may replay its accepted prefix. |
| `deliveryId` | `string \| null` | No | Deprecated alias for idempotencyKey, accepted for one release. idempotencyKey wins when both are present. |
| `threadId` | `integer` | No | Thread to receive the events. Omit for the root thread; unlike listEvents, omission does not address the full stream. |
| `receipt` | `boolean` | No | Answer 200 with the delivery receipt instead of 204, so the caller learns a duplicate. Omit for the 204 response; older servers ignore it and answer 204. |

## Responses

### `200` (`application/json`)

SessionPushEventsResult

Schema: `SessionPushEventsResult`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes |  |

Example:

```json
{
  "status": "accepted"
}
```

### `204`

<No Content>

### `400` (`application/json`)

DetachedInteractionRejectedError

Schema: `DetachedInteractionRejectedError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `message` | `string` | Yes |  |

Example:

```json
{
  "_tag": "DetachedInteractionRejectedError",
  "message": "Reply with a one-line greeting."
}
```

### `401` (`application/json`)

AuthenticationError

Schema: `AuthenticationError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `reason` | `string` | Yes |  |
| `description` | `string` | No |  |

Example:

```json
{
  "_tag": "AuthenticationError",
  "reason": "invalid_session",
  "description": "string"
}
```

### `402` (`application/json`)

OrganizationUnsubscribedError

Schema: `OrganizationUnsubscribedError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `code` | `string` | Yes |  |

Example:

```json
{
  "_tag": "OrganizationUnsubscribedError",
  "code": "ORGANIZATION_UNSUBSCRIBED"
}
```

### `403` (`application/json`)

ActorUnauthorizedError | UnauthorizedError | IdentityMismatchError | RequestedOrganizationError

Schema: `ActorUnauthorizedError | UnauthorizedError | IdentityMismatchError | ...`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `$ (ActorUnauthorizedError)._tag` | `string` | Yes |  |
| `$ (UnauthorizedError)._tag` | `string` | Yes |  |
| `$ (UnauthorizedError).entity` | `string` | Yes |  |
| `$ (UnauthorizedError).action` | `string` | Yes |  |
| `$ (IdentityMismatchError)._tag` | `string` | Yes |  |
| `$ (RequestedOrganizationError)._tag` | `string` | Yes |  |
| `$ (RequestedOrganizationError).reason` | `string \| null` | Yes |  |

Example:

```json
{
  "_tag": "ActorUnauthorizedError"
}
```

### `404` (`application/json`)

SessionNotFoundError

Schema: `SessionNotFoundError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `id` | `string` | Yes | TypeID with prefix "asess_". |

Example:

```json
{
  "_tag": "SessionNotFoundError",
  "id": "asess_01jd8z3k5q0b6f2m4r7t9v1x3c"
}
```

### `409` (`application/json`)

SessionArchivedError

Schema: `SessionArchivedError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `id` | `string` | Yes | TypeID with prefix "asess_". |
| `eventAccepted` | `boolean` | No |  |
| `acceptedOrdinal` | `integer` | No |  |

Example:

```json
{
  "_tag": "SessionArchivedError",
  "id": "asess_01jd8z3k5q0b6f2m4r7t9v1x3c",
  "eventAccepted": true,
  "acceptedOrdinal": 1
}
```

### `410` (`application/json`)

SessionRuntimeGoneError

Schema: `SessionRuntimeGoneError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `id` | `string` | Yes | TypeID with prefix "asess_". |

Example:

```json
{
  "_tag": "SessionRuntimeGoneError",
  "id": "asess_01jd8z3k5q0b6f2m4r7t9v1x3c"
}
```

### `429` (`application/json`)

RateLimitExceededError

Schema: `RateLimitExceededError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `resource` | `string` | Yes | Rate-limited resource bucket the request was counted against. |
| `retryAfter` | `number` | Yes |  |

Example:

```json
{
  "_tag": "RateLimitExceededError",
  "resource": "string",
  "retryAfter": 1
}
```

### `500` (`application/json`)

InternalError

Schema: `InternalError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |

Example:

```json
{
  "_tag": "InternalError"
}
```

### `502` (`application/json`)

ActorActionError

Schema: `ActorActionError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `code` | `string` | Yes |  |
| `acceptedEvents` | `integer` | No |  |
| `totalEvents` | `integer` | No |  |

Example:

```json
{
  "_tag": "ActorActionError",
  "code": "string",
  "acceptedEvents": -9007199254740991,
  "totalEvents": -9007199254740991
}
```

### `503` (`application/json`)

ActorUnavailableError

Schema: `ActorUnavailableError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |

Example:

```json
{
  "_tag": "ActorUnavailableError"
}
```

## Example Request

### cURL

```bash
curl -X POST 'https://api.thecompany.company/v1/sessions/{id}/events' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d @- <<'JSON'
{
  "events": [
    {
      "_tag": "TextSubmitted",
      "messages": [
        {
          "content": "string"
        }
      ]
    }
  ]
}
JSON
```

### TypeScript

```typescript
const response = await fetch('https://api.thecompany.company/v1/sessions/{id}/events', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "events": [
    {
      "_tag": "TextSubmitted",
      "messages": [
        {
          "content": "string"
        }
      ]
    }
  ]
}),
});
if (!response.ok) {
  throw new Error('HTTP ' + response.status);
}
const data = response.status === 204 ? null : await response.json();
```
