> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Virtual Member

> Creates a VIRTUAL member — a login-less managed identity that appears in the roster, holds a role, and acts only through API keys issued for it (POST /api-keys with member_principal_id)

```
POST /openapi/memorylake/admin/v1/members
```

Creates a VIRTUAL member — a login-less managed identity that appears in the roster, holds a role, and acts only through API keys issued for it (POST /api-keys with member\_principal\_id). Human members join through invitations only.

<Note>
  **Permission required:** `member:manage_virtual`

  * Changes that give someone an admin role, or that reduce what an admin can reach, also require the team owner or an admin.
</Note>

### Headers

<ParamField header="Idempotency-Key" type="string">
  Optional. Retrying with the same value replays the first result.
</ParamField>

### Request Body

<ParamField body="display_name" type="string" required>
  Display name of the virtual member
</ParamField>

<ParamField body="role" type="string" required>
  Role: tenant\_admin, tenant\_member, or a custom role key of this team. The owner role cannot be assigned.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://app.memorylake.ai/openapi/memorylake/admin/v1/members' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Idempotency-Key: 7c1d2e3f-0a9b-4c8d-b7e6-f5a4d3c2b1a0' \
    -H 'Content-Type: application/json' \
    -d '{
      "display_name": "Alice",
      "role": "tenant_member"
    }'
  ```
</RequestExample>

### Response

<ResponseField name="data" type="object">
  <Expandable title="Member object">
    <ResponseField name="display_name" type="string">Member's display name</ResponseField>
    <ResponseField name="joined_at" type="integer">Time this member joined, Unix seconds</ResponseField>
    <ResponseField name="member_type" type="string">human = joined via invitation, virtual = managed identity created by an owner/admin</ResponseField>
    <ResponseField name="principal_id" type="string">Stable identifier of this member</ResponseField>
    <ResponseField name="role" type="string">Primary role in this team: tenant\_owner | tenant\_admin | tenant\_member | \<custom role></ResponseField>
    <ResponseField name="status" type="string">Membership state. One of: `active`, `inactive`.</ResponseField>
    <ResponseField name="used_tokens" type="integer">Tokens consumed by this member</ResponseField>
    <ResponseField name="email" type="string">Only returned to team owners and admins</ResponseField>
    <ResponseField name="max_tokens" type="integer">Per-member cap in tokens. Omitted when the member is uncapped.</ResponseField>
    <ResponseField name="username" type="string">Only returned to team owners and admins</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (201) theme={null}
  {
    "success": true,
    "message": "Operation completed successfully",
    "data": {
      "display_name": "Alice",
      "joined_at": 1760000000,
      "member_type": "human",
      "principal_id": "42fbbd89934900ebbc74814c49f009d2",
      "role": "tenant_member",
      "status": "active",
      "used_tokens": 1200000,
      "email": "alice@example.com",
      "max_tokens": 1200000,
      "username": "alice"
    }
  }
  ```
</ResponseExample>

### Errors

Errors answer with `success: false`, a `message` and an `error_code`. See [Error Codes](/features/memorylake/api-reference/errors) for every code.

| Status | Meaning |
| - | - |
| `400` | A parameter or the body is invalid |
| `401` | The API key is missing, invalid, disabled or expired |
| `403` | The key is not allowed to do this |
| `409` | The request conflicts with the current state, e.g. a duplicate or a limit reached |
| `422` | The body or a parameter failed validation |
| `429` | Too many requests. Wait for the time in `Retry-After` |
| `500` | Server-side error |
| `503` | Temporarily unavailable. Retry later |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.