Predict.aiDocs
Workspaces

Workspace members

Share a single workspace — list, add, and remove members without organization-wide access.

A workspace member is a per-workspace access grant: it gives one user access to one workspace, nothing else. For organization-owned workspaces the grantee must already be a member of that organization (they accepted their invitation) — invite people to the organization first, then share workspaces with them. See Organizations and Invitations.

List members

Anyone who can access the workspace can see its member list:

curl "$API_BASE/v1/workspace/$WORKSPACE_ID/members" \
  -H "Authorization: Bearer $TOKEN"
{
  "data": {
    "members": [
      {
        "user_id": "e1c62b7a-9f04-4d3b-8a15-2c7d90e4b638",
        "email": "[email protected]",
        "name": "Ada Norberg",
        "role": "owner",
        "is_owner": true,
        "granted_at": null,
        "granted_by": null
      },
      {
        "user_id": "4b8f2a90-6d17-4c3e-b5a2-9e01d7c84f53",
        "email": "[email protected]",
        "name": "Sam Okafor",
        "role": "editor",
        "is_owner": false,
        "granted_at": "2026-07-08T11:20:00+00:00",
        "granted_by": "e1c62b7a-9f04-4d3b-8a15-2c7d90e4b638"
      }
    ]
  }
}

The owner always appears first with role: "owner"; explicit grants follow with when and by whom they were added.

Errors

StatusWhyExample message
404No such workspace, or you can't access it"Workspace not found in this account"

Add a member

Only the workspace owner can manage members, and adding them requires a Team plan or above. Identify the person by user_id or email — they must already have a predictAI account:

curl -X POST "$API_BASE/v1/workspace/$WORKSPACE_ID/members" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "role": "editor" }'
{
  "data": {
    "member": {
      "user_id": "4b8f2a90-6d17-4c3e-b5a2-9e01d7c84f53",
      "email": "[email protected]",
      "name": "Sam Okafor",
      "role": "editor",
      "is_owner": false,
      "granted_at": null,
      "granted_by": null
    }
  }
}
FieldMeaning
email requiredWho to add — or send user_id instead. They must already have a predictAI account.
user_id optionalThe alternative identifier to email.
role optionalviewer, editor (default), or admin.

Adding someone who's already a member updates their role in place.

For organization-owned workspaces, the organization's allowed_email_domains policy applies: emails outside the allowed domains are rejected.

Errors

StatusWhyExample message
400Neither user_id nor email given"Provide user_id or email"
400Unknown role"Invalid role. Allowed: ['admin', 'editor', 'viewer']"
403Not the workspace owner"Only the workspace owner or an org admin can manage members"
403Plan doesn't include member invites"Inviting members requires a Team plan or above."
403Email outside the organization's allowed domains"This organization only allows members from: acme.dev"
403Target hasn't joined the workspace's organization"That user is not a member of this workspace's organization yet. …"
404No account matches"No user found for that user_id/email"
409Target is the workspace owner"That user already owns this workspace"

The plan and domain-policy errors come back structured:

{
  "error": {
    "code": "upgrade_required",
    "message": "Inviting members requires a Team plan or above.",
    "details": { }
  },
  "status": "Inviting members requires a Team plan or above."
}

Remove a member

curl -X DELETE "$API_BASE/v1/workspace/$WORKSPACE_ID/members/$MEMBER_USER_ID" \
  -H "Authorization: Bearer $TOKEN"
{ "data": { "message": "Member removed" } }

Removal is idempotent — removing someone who isn't a member still returns 200.

Errors

StatusWhyExample message
400Target is the workspace owner"Cannot remove the workspace owner"
403Not the workspace owner"Only the workspace owner or an org admin can manage members"
404No such workspace"Workspace not found"

On this page