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

# Update Context

Update the region and locale stored against a `contextKey`. Subsequent requests that use the same token reflect the change - useful for region/language switching without minting a new token.

Scope is **not** changed via this endpoint. A scope transition (for example, an authenticated visitor moving from `public` to `b2b` after login) is handled server-side by issuing a new `contextKey` in the new scope.

## Path Parameters

**project-token** `string` *required*

Your project's Fetch token, embedded in the subdomain.

## Headers

**fs-context** `string` *required*

The `contextKey` to update. 36–50 characters.

**fs-secret** `string`

Required when the project has fetch API keys configured.

## Request Body

**region** `string` *required*

The new region key (e.g. `eu`). Must be a region available within the token's scope - see [List Contexts](https://docs.frontic.com/reference/fetch-api/list-contexts.md).

**locale** `string` *required*

The new locale key (e.g. `de-DE`). Must be one of the new region's supported locales.

## Response

**region** `string` *required*

The updated region key.

**locale** `string` *required*

The updated locale key.

**scope** `string` *required*

The unchanged scope key (returned for reference).

### Status codes

| Code | When |
| - | - |
| `200` | Context updated |
| `422` | `INVALID_TOKEN`, `INVALID_POST_BODY`, or `INVALID_PARAMETERS` - token is malformed, body isn't valid JSON, or `region`/`locale` aren't a valid combination for the token's scope |
| `401` | `fs-secret` missing or wrong (only when the project has fetch keys configured) |
| `404` | `TOKEN_NOT_FOUND` - token doesn't exist in this project |
| `404` | `NO_UPDATES_PROVIDED_EXCEPTION` - the body carries neither `region` nor `locale` |
| `422` | `FETCH_API_LIMIT_EXCEEDED` - project's plan limit for Fetch API requests exceeded |

```bash curl theme={"theme":"css-variables"}
curl -X PATCH 'https://fetch-<project-token>.frontic.com/context' \
  -H 'fs-context: <context-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "region": "eu",
    "locale": "de-DE"
  }'
```

```json 200 OK theme={"theme":"css-variables"}
{
  "region": "eu",
  "locale": "de-DE",
  "scope": "public"
}
```


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