POST /api/v1/community/attachments
Deposits a file and returns its attachment id. No post is touched: send the id to Attach to a thread when you are ready. An attachment left unattached for 24 hours is deleted.
The body is multipart/form-data with one part named file.
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Allowed |
| Requirement | Rule for this endpoint |
|---|---|
| Business role | None |
| Resource scope | The school attached to the API key |
| Participation | None at upload — it is checked when attaching |
| Header | Required | Description |
|---|---|---|
x-api-key | yes | API key created for this school |
Content-Type | yes | multipart/form-data |
X-Correlation-Id | no | Caller correlation id, returned or generated |
No Idempotency-Key: a deposit claims no key, and every call stores a new
file.
| Part | Type | Required | Description |
|---|---|---|---|
file | file | yes | Up to 10 MB. Accepted: images, application/zip, text/html, application/json, text/markdown |
curl -X POST "$COHORTE_API_BASE_URL/api/v1/community/attachments" \
-H "x-api-key: $COHORTE_API_KEY" \
-F "file=@call-grid.zip"201 Created — the file is stored.400 Bad Request — no file part, an empty file, a refused type, or a file over 10 MB.401 Unauthorized — the key is missing, invalid, or no longer attached to a member.| Field | Type | Nullable | Description |
|---|---|---|---|
data.id | UUID | no | The attachment id to send when attaching |
data.name | string | no | Original file name |
data.mimeType | string | no | Declared type |
data.sizeBytes | integer | no | Size in bytes |
data.threadId | UUID | yes | null until attached |
data.replyId | UUID | yes | null until attached |
data.createdAt | string | no | ISO 8601 timestamp |
{
"success": true,
"data": {
"id": "0f1c6d8a-2a5e-4f51-9d1e-7c4b2a9f3e10",
"name": "call-grid.zip",
"mimeType": "application/zip",
"sizeBytes": 204800,
"threadId": null,
"replyId": null,
"createdAt": "2026-09-21T10:12:00.000Z"
},
"correlationId": "1b1f7a1e-6d54-4f0c-8f97-2b2a1a7f5d33"
}