POST /api/v1/orgs/{id}/members · Operation ID: addMemberorgs:manage. Owner/admin can assign non-owner team roles; managers can add members only.curl --fail-with-body -X POST 'https://handwrites.io/api/v1/orgs/REPLACE_TEAM_ID/members' \
-H "Authorization: Bearer $HANDWRITE_ACCESS_TOKEN" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H 'Content-Type: application/json' \
--data '{"principal":"user:REPLACE_USER_ID","role":"member"}'| Name | In | Required | Meaning |
|---|---|---|---|
id | path | Yes | An organisation ID (org_…). |
Idempotency-Key | header | No | 1–255 visible ASCII characters (a UUID per operation). A retry with the same key and identical request within 24 hours replays the first 2xx response with Idempotent-Replayed: true; a different request with the key gets 422 idempotency_mismatch; a retry while the first runs gets 409 idempotency_in_progress. |
application/json (required).| Field | Required | Shape |
|---|---|---|
principal | Yes | A person. |
role | Yes | Team roles: owner, admin, billing, manager, developer, member. Class roles: teacher, co-teacher, billing, student. |
| Status | Meaning | Format |
|---|---|---|
| 201 | The membership. | application/json |
| 400 | invalid_request (the message names the field), validation_failed. | application/json |
| 401 | unauthorized: no token, or it's invalid, revoked or expired. | application/json |
| 403 | insufficient_scope, forbidden (you can see it but not do this), app_test_restricted, account_deleted (the account is scheduled for deletion; any request). | application/json |
| 404 | not_found: it doesn't exist or you can't see it (never 403 for documents you can't see). | application/json |
| 409 | conflict (changed meanwhile, already a member) or idempotency_in_progress (with Retry-After). | application/json |
| 422 | limit_reached, idempotency_mismatch, unreadable_file, no_text, empty_document. | application/json |
| 429 | rate_limited (burst or daily cap) or quota_exceeded (no characters left). | application/json |
| 500 | internal_error. | application/json |