---
title: "Set Oauth Grant Default Context"
method: PUT
path: "/api/v1/me/oauth/grants/{client_id}/default-context"
tags: ["me-oauth"]
---

# Set Oauth Grant Default Context

`PUT /api/v1/me/oauth/grants/{client_id}/default-context`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/me/oauth/grants/{client_id}/default-context`
- Auth: none declared

Set (or, with ``null``, clear) the MCP default context of one grant.

The context must be readable by the caller now (viewer); otherwise 404
``Context not found``.

Raises:
    NotFoundException: The caller has no grant for ``client_id``, or
        cannot read the context (404).

## Path parameters

- `client_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- OAuthGrantDefaultContextUpdate: Body of ``PUT /me/oauth/grants/{client_id}/default-context``.
  - `default_context_id` string, uuid, nullable, required: The grant's MCP default context; null clears it

## Response `200`

Successful Response

- OAuthGrantResponse: One OAuth app the caller has authorized.
  - `client_id` unknown, required
  - `client_name` unknown, required
  - `scopes` unknown
  - `default_context_id` unknown
  - `default_context_name` unknown
  - `last_issued_at` unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-20** `09f17f5ada29`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/changes/api/v1/me/oauth/grants/:client_id/default-context/put.md)

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
