---
title: "Set the authenticated user's active org"
method: PATCH
path: "/me/context"
tags: ["Auth"]
---

# Set the authenticated user's active org

`PATCH /me/context`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/me/context`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`
  - API key in cookie `mnemom_session`

Switches the user's active org via `set_user_active_org` RPC; the `active_org_id` is persisted to `user_preferences.preferences`. Body is `{ org_id: string }`. Returns the same envelope shape as `GET /me/context`. Returns 403 with `code: 'not_a_member'` if the user is not a member of the target org. Per ADR-044 Piece 1 / migration 164.

## Request body

- object
  - `org_id` string, required: Org ID to switch the active context to. The user must be a member.

## Response `200`

Active org switched. Response envelope matches GET /me/context.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
