Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

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 dev secret key, sk_test_…, as Authorization: Bearer <token>.
  • SDK: client.members.list(workspaceId, query)
  • Pages: limit, 1 to 500, default 100, with next and after. 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

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 past workspaces.maxOwnedPerPrincipal is refused for every caller when the limit is set.
  • Credential: the examples send your project’s dev secret key, sk_test_…, as Authorization: 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

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 past workspaces.maxOwnedPerPrincipal is refused for every caller when the limit is set.
  • Credential: the examples send your project’s dev secret key, sk_test_…, as Authorization: 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

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 dev secret key, sk_test_…, as Authorization: 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

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.