---
title: "Set conversation events"
url: https://docs.gleap.ai/en/reference/conversations-api/set-events
method: PUT
path: "/s2s/conversations/{conversationId}/events"
api: "Conversations API"
tag: "S2S Conversations"
operationId: "SetEvents"
updatedAt: "2026-11-01T18:40:16.191Z"
language: en
---

# Set conversation events

`PUT https://api.gleap.io/v3/s2s/conversations/{conversationId}/events`

Attach an event log snapshot to the conversation — the same events `Gleap.trackEvent()` buffers in the SDK flow and attaches when a conversation is created. Scoped to this conversation only (not the contact), so events from other sessions never mix in. Shown to agents in the conversation's "Logs" panel. Each call replaces the previous snapshot (max 500 events, 2 MB). Not delivered via webhooks or the stream. For contact-level events that drive outbound rules, use `POST /contacts/{userId}/events` instead.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Path parameters

- `conversationId` (string, required)

## Headers

- `Gleap-Version` (string): Pin a specific API version; defaults to the current version.

## Request body (`application/json`, required)

- `events` (object[], required): Snapshot of the events that led up to this conversation (max 500 entries, 2 MB). Replaces any previous snapshot for this conversation.
  - `name` (string, required): Event name, e.g. "screen\_opened" or "pageView".
  - `date` (string): ISO timestamp of when the event happened; defaults to now.
  - `data` (any): Arbitrary event payload (flat key→value object).

## Example request

```bash
curl --request PUT \
  --url 'https://api.gleap.io/v3/s2s/conversations/{conversationId}/events' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "events": [
    {
      "name": "<name>"
    }
  ]
}'
```

## Responses

### 204

No Content

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

Missing, invalid or revoked service account token.

- `type` (string, required)
- `title` (string, required)
- `status` (number, required)
- `code` (string, required)
- `detail` (string)
- `request_id` (string)

```json
{
  "type": "https://docs.gleap.io/s2s/problems/conversation_closed",
  "title": "string",
  "status": 0,
  "code": "conversation_closed",
  "detail": "string",
  "request_id": "req_66c0ffee0000000000000001"
}
```

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

The addressed resource does not exist in this project.

- `type` (string, required)
- `title` (string, required)
- `status` (number, required)
- `code` (string, required)
- `detail` (string)
- `request_id` (string)

```json
{
  "type": "https://docs.gleap.io/s2s/problems/conversation_closed",
  "title": "string",
  "status": 0,
  "code": "conversation_closed",
  "detail": "string",
  "request_id": "req_66c0ffee0000000000000001"
}
```

### 422 (`application/problem+json`)

Idempotency-Key reuse with a different request body.

- `type` (string, required)
- `title` (string, required)
- `status` (number, required)
- `code` (string, required)
- `detail` (string)
- `request_id` (string)

```json
{
  "type": "https://docs.gleap.io/s2s/problems/conversation_closed",
  "title": "string",
  "status": 0,
  "code": "conversation_closed",
  "detail": "string",
  "request_id": "req_66c0ffee0000000000000001"
}
```

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

Rate limit exceeded — honor the Retry-After header.

- `type` (string, required)
- `title` (string, required)
- `status` (number, required)
- `code` (string, required)
- `detail` (string)
- `request_id` (string)

```json
{
  "type": "https://docs.gleap.io/s2s/problems/conversation_closed",
  "title": "string",
  "status": 0,
  "code": "conversation_closed",
  "detail": "string",
  "request_id": "req_66c0ffee0000000000000001"
}
```

### default (`application/problem+json`)

Any other error, including validation\_failed (400) and internal\_error (500).

- `type` (string, required)
- `title` (string, required)
- `status` (number, required)
- `code` (string, required)
- `detail` (string)
- `request_id` (string)

```json
{
  "type": "https://docs.gleap.io/s2s/problems/conversation_closed",
  "title": "string",
  "status": 0,
  "code": "conversation_closed",
  "detail": "string",
  "request_id": "req_66c0ffee0000000000000001"
}
```
