POST /api/v1/community/spaces/{spaceId}/threads
Posts a new thread in a space, as the key's holder. Attachments uploaded beforehand are attached in the same call.
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Conditional — in the spaces of its own enrollments in progress |
| Requirement | Rule for this endpoint |
|---|---|
| Business role | None |
| Resource scope | The space belongs to the key's organization |
| Participation | For a MEMBER: an enrollment in progress in the space's program or cohort. A finished enrollment reads, it does not post |
| Resource state | The space is not archived — nobody posts in an archived space, owners included |
| Parameter | Type | Required | Description |
|---|---|---|---|
spaceId | UUID | yes | Space of the key's organization |
| Header | Required | Description |
|---|---|---|
x-api-key | yes | API key created for this organization |
Idempotency-Key | yes | Stable key for this post; a replay returns the first thread |
X-Correlation-Id | no | Caller correlation id, returned or generated |
| Field | Type | Required | Nullable | Description |
|---|---|---|---|---|
title | string | yes | no | 3 to 140 characters |
body | string | yes | no | Markdown, 1 to 10000 characters |
attachmentIds | array | no | no | Up to 5 ids from Upload an attachment |
curl -X POST "$COHORTE_API_BASE_URL/api/v1/community/spaces/$SPACE_ID/threads" \
-H "x-api-key: $COHORTE_API_KEY" \
-H "Idempotency-Key: thread-welcome-autumn" \
-H "Content-Type: application/json" \
-d '{"title": "Welcome to the autumn cohort", "body": "Introduce yourself below."}'201 Created — the thread.200 OK — replayed: true: the key was already used, the original thread comes back.400 Bad Request — missing Idempotency-Key, invalid JSON, a title or body out of bounds, an archived space, or attachments that cannot be attached.401 Unauthorized — missing, unknown or expired key.403 Forbidden — the bearer has no enrollment in progress in the space's scope.404 Not Found — the space is unknown or belongs to another school.| Field | Type | Description |
|---|---|---|
data.id | UUID | Thread id |
data.spaceId | UUID | Its space |
data.title / data.body | string | As posted |
data.authorUserId | UUID | The key's holder |
data.createdAt | string | ISO 8601 |
{
"success": true,
"replayed": false,
"data": {
"id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a",
"spaceId": "1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"title": "Welcome to the autumn cohort",
"body": "Introduce yourself below.",
"authorUserId": "22222222-2222-4222-8222-222222222222",
"createdAt": "2026-10-01T08:30:00.000Z"
},
"correlationId"
community_thread.created is delivered to your webhook subscriptions.