Platform API reference

Platform API · Workspaces

post/v1/workspaces/{workspace_slug}/invitesAuth

Create a workspace invite link. Cookie/JWT only — invites bring new humans into the workspace.

Path parameters

workspace_slug*string

Slug 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-Keystring

Opaque 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

emailstring

Optional invitee email. When set, the invite is locked to that address.

Example: "alice@example.com"

role_idstring

UUID 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_usesnumber

Maximum number of accepts. Defaults to 1. Use higher values for "team link" invites.

Example: 1

expires_in_hoursnumber

Hours until the invite expires. Defaults to 168 (7 days).

Example: 168

Response · 201

id*string · uuid

Id of the invite.

workspace_id*string · uuid

Id of the workspace the invite joins.

code*string

Single-use invite code embedded in the invite URL.

email*string · email

Email the invite is restricted to, or `null` for an open invite link.

role_id*string · uuid

Id of the role the invitee gets, or `null` for the default member role.

max_uses*number

How many times the invite can be accepted, or `null` for unlimited.

use_count*number

How many times the invite has been accepted.

expires_at*string · date-time

When the invite stops working, or `null` if it never expires.

revoked_at*string · date-time

When the invite was revoked, or `null` while it is live.

created_at*string · date-time

When the invite was created.

created_by*string · uuid

Account 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"
}