Members
A workspace’s memberships and their roles.
Workspaces explains who may join a workspace, and why it always keeps an owner.
Paths are relative to https://api.agentpost.tools/v1/identity, and every request follows the API basics. Who may call explains each kind of caller.
List members
GET /workspaces/:id/members
A workspace’s members.
- Who may call: Your server or a signed-in principal.
- Access: Needs
identity.member:view. - Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - SDK:
client.members.list(workspaceId, query) - Pages:
limit, 1 to 500, default 100, withnextandafter. Lists has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | A workspace ID, wsp_…. The id of a Workspace. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer |
No | 1–500; default 100. |
after |
string |
No | 1–64 characters. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
members |
Membership array |
Always | |
next |
string |
When set |
Errors
forbidden(403)
Any operation can also answer with the codes Conventions lists.
Add a member
POST /workspaces/:id/members
Adds a principal directly, without an invitation, such as an agent.
- Who may call: Your server or a signed-in principal.
- Access: Needs
identity.member:add. Adding an owner pastworkspaces.maxOwnedPerPrincipalis refused for every caller when the limit is set. - Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - SDK:
client.members.add(workspaceId, input) - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | A workspace ID, wsp_…. The id of a Workspace. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
principalId |
string |
Yes | A principal ID, prn_…. |
role |
string |
Yes | A role key from the config, such as “member”. |
Response
201 Created, with:
| Name | Type | Present | Description |
|---|---|---|---|
membership |
Membership |
Always |
Errors
conflict(409)forbidden(403)not_found(404)role_not_assignable(422)workspace_limit(403)
Any operation can also answer with the codes Conventions lists.
Update a member
PATCH /workspaces/:id/members/:memberId
Changes a member’s role, or suspends or reactivates them.
- Who may call: Your server or a signed-in principal.
- Access: Needs
identity.member:update. Making someone an owner pastworkspaces.maxOwnedPerPrincipalis refused for every caller when the limit is set. - Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - SDK:
client.members.patch(workspaceId, memberId, patch) - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | A workspace ID, wsp_…. The id of a Workspace. |
memberId |
string |
Yes | A membership ID, mem_…. The id of a Membership. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
role |
string |
No | A role key from the config, such as “member”. |
status |
"active" or "suspended" |
No |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
membership |
Membership |
Always |
Errors
forbidden(403)last_owner(409)not_a_member(404)not_found(404)role_not_assignable(422)workspace_limit(403)
Any operation can also answer with the codes Conventions lists.
Remove a member
DELETE /workspaces/:id/members/:memberId
Removes a member. The last owner stays.
- Who may call: Your server or a signed-in principal.
- Access: Needs
identity.member:remove. - Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - SDK:
client.members.remove(workspaceId, memberId) - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | A workspace ID, wsp_…. The id of a Workspace. |
memberId |
string |
Yes | A membership ID, mem_…. The id of a Membership. |
Response
204 No Content, with no body.
Errors
forbidden(403)last_owner(409)not_a_member(404)
Any operation can also answer with the codes Conventions lists.
The Membership object
| Name | Type | Present | Description |
|---|---|---|---|
id |
string |
Always | A membership ID, mem_…. |
workspaceId |
string |
Always | A workspace ID, wsp_…. |
principalId |
string |
Always | A principal ID, prn_…. |
principalKind |
string |
When set | A principal’s kind: guest, which IdentityHound sets while someone uses a product before signing in, or a label the principal chose for itself (human, agent, or service), or none. A principal can change its label at any time, and every setting treats the declared kinds alike. One of "human", "guest", "agent", or "service". |
role |
string |
Always | |
status |
"active" or "suspended" |
Always | |
source |
string |
Always | One of "creator", "invitation", "direct_add", or "import". |
invitationId |
string |
When set | An invitation ID, inv_…. |
addedBy |
string |
When set | A principal ID, prn_…, or "trusted_caller". |
createdAt |
string |
Always | An ISO 8601 date and time. |
updatedAt |
string |
Always | An ISO 8601 date and time. |