---
title: "Track contact events"
url: https://docs.gleap.ai/en/reference/conversations-api/track-events
method: POST
path: "/s2s/contacts/{userId}/events"
api: "Conversations API"
tag: "S2S Contacts"
operationId: "TrackEvents"
updatedAt: "2026-11-01T18:40:16.191Z"
language: en
---

# Track contact events

`POST https://api.gleap.io/v3/s2s/contacts/{userId}/events`

Track events for a contact (drives outbound messaging and workflows).

## Authorization

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

## Path parameters

- `userId` (string, required)

## Headers

- `Gleap-Version` (string): Pin a specific API version; defaults to the current version.
- `Idempotency-Key` (string): Makes the POST retryable: a completed successful response replays for 24 hours (Gleap-Idempotency-Replayed: true). Semantics are at-least-once — a retry that races a crashed or >60s-running original may re-execute. Error responses are never stored; retry them normally.

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

- `events` (object[], required)
  - `name` (string, required)
  - `date` (string): ISO timestamp; defaults to now.
  - `data` (any): Arbitrary event payload (flat key→value object).

## Example request

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

## Responses

### 202 (`application/json`)

Accepted

- `received` (number<double>, required)

```json
{
  "received": 0
}
```

### 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"
}
```
