---
search:
  tags:
    - Cohorts
    - POST
seo:
  description: >-
    Adds users to a cohort. Returns { added, userIds } with the count and list
    of user… Reference for the POST /cohorts/{id}/members endpoint in the Fuxam
    API v4.
sidebar:
  label: Add members to a cohort
  badge: POST
title: Add members to a cohort
type: openapi-operation
---
Adds users to a cohort. Returns `{ added, userIds }` with the count and list of user IDs that were added. Idempotent via `Idempotency-Key` header. Scoped to your integration's institution via Basic Auth credentials.

`POST /cohorts/{id}/members`

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

- `userIds` (string[], required)

Request body example:

```json
{
  "userIds": [
    "usr_001",
    "usr_002"
  ]
}
```

**Responses**

- `200` — Members added
- `400` — Bad Request
- `401` — Unauthorized
- `409` — Conflict — duplicate email or membership code (body includes \`existingUserId\` when known), a time-tracking session that is already running (\`activeSession\`), a time-tracking interval that overlaps an existing log (\`conflictingLog\`), idempotency key reused with a different body (\`idempotency\_key\_reused\`), or concurrent request with the same key still in progress (\`idempotency\_key\_in\_progress\`)
- `429` — Too Many Requests — 1000 requests per minute per institution. Includes \`X-RateLimit-Limit\`, \`X-RateLimit-Remaining\`, \`X-RateLimit-Reset\` (ISO-8601), and \`Retry-After\` (seconds).
- `500` — Internal Server Error
- `503` — Service unavailable — idempotency store temporarily unreachable, or the database is busy (lock wait, transaction timeout, or exhausted serialization/deadlock retries). Database contention includes \`Retry-After: 1\`. The idempotency key is released. Retry the same key (\`service\_unavailable\`).

Response example, 200:

```json
{
  "data": {
    "added": 2,
    "userIds": [
      "usr_001",
      "usr_002"
    ]
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2026-06-26T00:00:00.000Z",
    "version": "v4"
  }
}
```
