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

# Reorder User Memories

> Set the display order of your memories

Reorders the authenticated user's memories. Pass **every** memory id in the desired order — the request is rejected if the set of ids doesn't match the member's memories exactly. Returns the memories in their new order.

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from the [authenticate](/api-reference/authentication/authenticate) endpoint.
</ParamField>

<ParamField body="memory_ids" type="string[]" required>
  All of the member's memory ids, in the order you want them stored.
</ParamField>

## Response

<ResponseField name="user_memories" type="array" required>
  The member's memories in the new order. Each object matches the [List User Memories](/api-reference/user-memories/list-user-memories) shape.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.trellis.sh/v1/user-memories/reorder \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "memory_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890", "b2c3d4e5-f6a7-8901-bcde-f12345678901"]
    }'
  ```

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

  response = requests.post(
      "https://api.trellis.sh/v1/user-memories/reorder",
      headers={
          "Authorization": "Bearer YOUR_TOKEN",
          "Content-Type": "application/json",
      },
      json={"memory_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890", "b2c3d4e5-f6a7-8901-bcde-f12345678901"]},
  )
  memories = response.json()["user_memories"]
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch("https://api.trellis.sh/v1/user-memories/reorder", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ memory_ids: ["a1b2c3d4-e5f6-7890-abcd-ef1234567890", "b2c3d4e5-f6a7-8901-bcde-f12345678901"] }),
  });
  const { user_memories } = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "user_memories": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "organization_id": "org_01HX...",
        "member_id": "member_01HX...",
        "content": "Prefers responses in bullet points",
        "idx": 0,
        "tier": "preference",
        "created_at": "2025-03-01T10:00:00+00:00",
        "updated_at": "2025-03-15T14:30:00+00:00"
      }
    ]
  }
  ```

  ```json 400 Incomplete id set theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Expected 3 memory IDs, got 2"
  }
  ```
</ResponseExample>
