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

# Create User Memory

> Create a memory for a specific member (admin)

Creates a new memory for the specified member. Useful for pre-populating preferences or context for users before they begin using the product.

<Note>
  This endpoint requires admin privileges. Members can create their own memories via the [self-service API](/api-reference/user-memories/create-user-memory).
</Note>

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from the authenticate endpoint. The authenticated user must be an admin.
</ParamField>

<ParamField body="member_id" type="string" required>
  ID of the member to create the memory for.
</ParamField>

<ParamField body="content" type="string" required>
  The memory content to store.
</ParamField>

## Response

Returns the created memory object.

<ResponseField name="id" type="string">
  Unique memory ID (UUID).
</ResponseField>

<ResponseField name="organization_id" type="string">
  Organization this memory belongs to.
</ResponseField>

<ResponseField name="member_id" type="string">
  Member this memory belongs to.
</ResponseField>

<ResponseField name="content" type="string">
  The memory content.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when the memory was created.
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 timestamp when the memory was last updated.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.trellis.sh/v1/admin/user-memories \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "member_id": "member_01HX...",
      "content": "Focus on the APAC region for sales queries"
    }'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests

  response = requests.post(
      "https://api.trellis.sh/v1/admin/user-memories",
      headers={
          "Authorization": "Bearer YOUR_TOKEN",
          "Content-Type": "application/json",
      },
      json={
          "member_id": "member_01HX...",
          "content": "Focus on the APAC region for sales queries",
      },
  )

  memory = response.json()
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch("https://api.trellis.sh/v1/admin/user-memories", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      member_id: "member_01HX...",
      content: "Focus on the APAC region for sales queries",
    }),
  });

  const memory = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "organization_id": "org_01HX...",
    "member_id": "member_01HX...",
    "content": "Focus on the APAC region for sales queries",
    "created_at": "2025-03-01T10:00:00+00:00",
    "updated_at": "2025-03-01T10:00:00+00:00"
  }
  ```

  ```json 400 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Member not found"
  }
  ```

  ```json 401 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Missing Authorization header"
  }
  ```

  ```json 403 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Admin privileges required"
  }
  ```
</ResponseExample>
