---
title: "IdentityHound API: Members"
description: "List members, add a member, update a member, or remove a member, with the IdentityHound API."
url: "https://agentpost.tools/docs/identityhound/reference/members"
kind: reference
---

# Members

A workspace’s memberships and their roles.

[Workspaces](/docs/identityhound/concepts/workspaces.md#members) 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](/docs/platform/api-basics.md). [Who may call](/docs/identityhound/reference.md#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](/docs/platform/api-basics.md#lists) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | A workspace ID, `wsp_…`. The `id` of a [`Workspace`](/docs/identityhound/reference/workspaces.md#the-workspace-object). |

### 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`](/docs/identityhound/reference/members.md#the-membership-object) array | Always |  |
| `next` | `string` | When set |  |

### Errors

-   [`forbidden`](/docs/identityhound/errors.md#forbidden) (403)

Any operation can also answer with the codes [Conventions](/docs/identityhound/reference.md#conventions) lists.

```bash tab="curl"
curl 'https://api.agentpost.tools/v1/identity/workspaces/wsp_01JDGKQN2K4RF0M0Z2HBASFA62/members?limit=20' \
  -H "Authorization: Bearer sk_test_…"
```

```ts tab="SDK"
import { createClient } from '@agentpost-tools/identityhound-sdk';

const client = createClient({ token: 'sk_test_…' });
const { members } = await client.members.list(
  'wsp_01JDGKQN2K4RF0M0Z2HBASFA62',
  { limit: 20 },
);
```

```json title="Response"
{
  "members": [
    {
      "id": "mem_01JDXB0ZDTSYYZJNQZJQ1MEA8Y",
      "workspaceId": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62",
      "principalId": "prn_01JDG9X6KH1ZEF2ZWP185VMW9D",
      "principalKind": "human",
      "role": "owner",
      "status": "active",
      "source": "creator",
      "createdAt": "2026-11-02T14:05:00.000Z",
      "updatedAt": "2026-11-02T14:05:00.000Z"
    },
    {
      "id": "mem_01JD4CX40XT3YPEZHJ8VY0RG03",
      "workspaceId": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62",
      "principalId": "prn_01JD1F7TG1SVVEHCFCS56KF78R",
      "principalKind": "human",
      "role": "member",
      "status": "active",
      "source": "invitation",
      "invitationId": "inv_01JD4S9TK4EQEZ4YB4S2GTG2BB",
      "createdAt": "2026-11-05T10:12:00.000Z",
      "updatedAt": "2026-11-05T10:12:00.000Z"
    }
  ]
}
```

## 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](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | A workspace ID, `wsp_…`. The `id` of a [`Workspace`](/docs/identityhound/reference/workspaces.md#the-workspace-object). |

### 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`](/docs/identityhound/reference/members.md#the-membership-object) | Always |  |

### Errors

-   [`conflict`](/docs/identityhound/errors.md#conflict) (409)
-   [`forbidden`](/docs/identityhound/errors.md#forbidden) (403)
-   [`not_found`](/docs/identityhound/errors.md#not_found) (404)
-   [`role_not_assignable`](/docs/identityhound/errors.md#role_not_assignable) (422)
-   [`workspace_limit`](/docs/identityhound/errors.md#workspace_limit) (403)

Any operation can also answer with the codes [Conventions](/docs/identityhound/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/identity/workspaces/wsp_01JDGKQN2K4RF0M0Z2HBASFA62/members \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "principalId": "prn_01JDWRHCP925GR1HC5AP0MCFKH",
    "role": "member"
  }'
```

```ts tab="SDK"
import { createClient } from '@agentpost-tools/identityhound-sdk';

const client = createClient({ token: 'sk_test_…' });
const { membership } = await client.members.add(
  'wsp_01JDGKQN2K4RF0M0Z2HBASFA62',
  { principalId: 'prn_01JDWRHCP925GR1HC5AP0MCFKH', role: 'member' },
);
```

```json title="Response"
{
  "membership": {
    "id": "mem_01JDNPKC9ZP7A94J2F9MBQ4TCH",
    "workspaceId": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62",
    "principalId": "prn_01JDWRHCP925GR1HC5AP0MCFKH",
    "principalKind": "agent",
    "role": "member",
    "status": "active",
    "source": "direct_add",
    "addedBy": "prn_01JDG9X6KH1ZEF2ZWP185VMW9D",
    "createdAt": "2026-11-13T09:30:00.000Z",
    "updatedAt": "2026-11-13T09:30:00.000Z"
  }
}
```

## 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](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | A workspace ID, `wsp_…`. The `id` of a [`Workspace`](/docs/identityhound/reference/workspaces.md#the-workspace-object). |
| `memberId` | `string` | Yes | A membership ID, `mem_…`. The `id` of a [`Membership`](/docs/identityhound/reference/members.md#the-membership-object). |

### 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`](/docs/identityhound/reference/members.md#the-membership-object) | Always |  |

### Errors

-   [`forbidden`](/docs/identityhound/errors.md#forbidden) (403)
-   [`last_owner`](/docs/identityhound/errors.md#last_owner) (409)
-   [`not_a_member`](/docs/identityhound/errors.md#not_a_member) (404)
-   [`not_found`](/docs/identityhound/errors.md#not_found) (404)
-   [`role_not_assignable`](/docs/identityhound/errors.md#role_not_assignable) (422)
-   [`workspace_limit`](/docs/identityhound/errors.md#workspace_limit) (403)

Any operation can also answer with the codes [Conventions](/docs/identityhound/reference.md#conventions) lists.

```bash tab="curl"
curl -X PATCH https://api.agentpost.tools/v1/identity/workspaces/wsp_01JDGKQN2K4RF0M0Z2HBASFA62/members/mem_01JD4CX40XT3YPEZHJ8VY0RG03 \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "admin"
  }'
```

```ts tab="SDK"
import { createClient } from '@agentpost-tools/identityhound-sdk';

const client = createClient({ token: 'sk_test_…' });
const { membership } = await client.members.patch(
  'wsp_01JDGKQN2K4RF0M0Z2HBASFA62',
  'mem_01JD4CX40XT3YPEZHJ8VY0RG03',
  { role: 'admin' },
);
```

```json title="Response"
{
  "membership": {
    "id": "mem_01JD4CX40XT3YPEZHJ8VY0RG03",
    "workspaceId": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62",
    "principalId": "prn_01JD1F7TG1SVVEHCFCS56KF78R",
    "principalKind": "human",
    "role": "admin",
    "status": "active",
    "source": "invitation",
    "invitationId": "inv_01JD4S9TK4EQEZ4YB4S2GTG2BB",
    "createdAt": "2026-11-05T10:12:00.000Z",
    "updatedAt": "2026-11-13T09:30:00.000Z"
  }
}
```

## 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](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | A workspace ID, `wsp_…`. The `id` of a [`Workspace`](/docs/identityhound/reference/workspaces.md#the-workspace-object). |
| `memberId` | `string` | Yes | A membership ID, `mem_…`. The `id` of a [`Membership`](/docs/identityhound/reference/members.md#the-membership-object). |

### Response

`204 No Content`, with no body.

### Errors

-   [`forbidden`](/docs/identityhound/errors.md#forbidden) (403)
-   [`last_owner`](/docs/identityhound/errors.md#last_owner) (409)
-   [`not_a_member`](/docs/identityhound/errors.md#not_a_member) (404)

Any operation can also answer with the codes [Conventions](/docs/identityhound/reference.md#conventions) lists.

```bash tab="curl"
curl -X DELETE https://api.agentpost.tools/v1/identity/workspaces/wsp_01JDGKQN2K4RF0M0Z2HBASFA62/members/mem_01JD4CX40XT3YPEZHJ8VY0RG03 \
  -H "Authorization: Bearer sk_test_…"
```

```ts tab="SDK"
import { createClient } from '@agentpost-tools/identityhound-sdk';

const client = createClient({ token: 'sk_test_…' });
await client.members.remove(
  'wsp_01JDGKQN2K4RF0M0Z2HBASFA62',
  'mem_01JD4CX40XT3YPEZHJ8VY0RG03',
);
```

```text title="Response"
204 No Content
```

## 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. |

```json title="The Membership object"
{
  "id": "mem_01JDXB0ZDTSYYZJNQZJQ1MEA8Y",
  "workspaceId": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62",
  "principalId": "prn_01JDG9X6KH1ZEF2ZWP185VMW9D",
  "principalKind": "human",
  "role": "owner",
  "status": "active",
  "source": "creator",
  "createdAt": "2026-11-02T14:05:00.000Z",
  "updatedAt": "2026-11-02T14:05:00.000Z"
}
```
