---
title: "Update user's enabled states"
method: POST
path: "/users/{id}/states"
tags: ["Users"]
---

# Update user's enabled states

`POST /users/{id}/states`

Update the list of states (geographic regions) that a user is enabled to work in.

**Authentication Required**: Yes
**Permissions**: User must be updating their own states or have admin permissions

**Request Body**:
```json
{
    "states": ["state1", "state2", "state3"]
}
```

**Process**:
1. Validates the states data
2. Immediately updates cache
3. Writes to database immediately if worksite filters changed,
   otherwise schedules a flush task (USER_STATES_FLUSH_DELAY)
4. Returns immediate confirmation

**Note**: Updates are cached immediately. Filter changes are
persisted to the database immediately; other changes are persisted
by a delayed flush task.

## Request body

- UpdateUserStates
  - `states` object, required

## Response `200`

States updated successfully

## Other responses

- `400` — Invalid states data
- `403` — Permission denied
- `404` — User not found

---

[API](https://skmtc.dev/crisiscleanup/apis/crisiscleanup-api.md) · [All operations](https://skmtc.dev/crisiscleanup/apis/crisiscleanup-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crisiscleanup/crisiscleanup-api/revisions/3fa73d4b2895/schema)
