Create Invitation
POST /invitations422 on role=operator: that role is unreachable by invitation, ever.
Request body — InvitationCreate
Section titled “Request body — InvitationCreate”| Field | Type | Notes | |
|---|---|---|---|
email | string | null | optional | min length 3 max length 254 |
role | viewer | member | admin | owner | operator | optional | Default "member". |
scope | workspace | organization | platform | optional | Default "workspace". |
expires_in_s | integer | optional | Default 604800. min 300 max 2592000 |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
201 | Successful Response | InvitationWithLink |
422 | Validation Error | HTTPValidationError |
Example
Section titled “Example”The body shows the fields the schema always carries. Which combination is legal is a service rule the schema cannot express, so read the description above before copying this.
curl -X POST https://your-deployment.example.com/invitations \ -H "Authorization: Bearer $COBRE_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "role": "viewer", "scope": "workspace", "expires_in_s": 0 }'Response — InvitationWithLink
Section titled “Response — InvitationWithLink”| Field | Type | Notes | |
|---|---|---|---|
token | string | required | — |
invitation | InvitationView | required | — |
delivery | queued | unavailable | failed | optional | Default "unavailable". |