/v1/workspaces/{workspace_slug}/invitesAuthCreate a workspace invite link. Cookie/JWT only — invites bring new humans into the workspace.
Path parameters
workspace_slug*stringSlug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve("acme")`); the product APIs bind `workspace_id` instead.
Headers
Idempotency-KeystringOpaque client-generated string (1-256 chars, `[A-Za-z0-9._:-]`) that deduplicates retries for 24 h. A retry with the same key and body returns the first response with `Idempotent-Replay: true` instead of creating a second resource. The SDKs send one on every create.
Request body
emailstringOptional invitee email. When set, the invite is locked to that address.
Example: "alice@example.com"
role_idstringUUID of the role to grant on accept. Use to target custom roles.
Example: "11111111-1111-1111-1111-111111111111"
roleenum (3)System role shortcut: 'owner' | 'admin' | 'member'.
max_usesnumberMaximum number of accepts. Defaults to 1. Use higher values for "team link" invites.
Example: 1
expires_in_hoursnumberHours until the invite expires. Defaults to 168 (7 days).
Example: 168
Response · 201
id*string · uuidId of the invite.
workspace_id*string · uuidId of the workspace the invite joins.
code*stringSingle-use invite code embedded in the invite URL.
email*string · emailEmail the invite is restricted to, or `null` for an open invite link.
role_id*string · uuidId of the role the invitee gets, or `null` for the default member role.
max_uses*numberHow many times the invite can be accepted, or `null` for unlimited.
use_count*numberHow many times the invite has been accepted.
expires_at*string · date-timeWhen the invite stops working, or `null` if it never expires.
revoked_at*string · date-timeWhen the invite was revoked, or `null` while it is live.
created_at*string · date-timeWhen the invite was created.
created_by*string · uuidAccount id of the member who created the invite.
Example
Request
POST https://api.platform-auth.productcraft.co/v1/workspaces/{workspace_slug}/invites
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"email": "alice@example.com",
"role_id": "11111111-1111-1111-1111-111111111111",
"role": "owner",
"max_uses": 1,
"expires_in_hours": 168
}Response
{
"id": "00000000-0000-0000-0000-000000000000",
"workspace_id": "00000000-0000-0000-0000-000000000000",
"code": "string",
"email": "user@example.com",
"role_id": "00000000-0000-0000-0000-000000000000",
"max_uses": 0,
"use_count": 0,
"expires_at": "2026-01-01T00:00:00.000Z",
"revoked_at": "2026-01-01T00:00:00.000Z",
"created_at": "2026-01-01T00:00:00.000Z",
"created_by": "00000000-0000-0000-0000-000000000000"
}