---
title: "Update a user"
method: PATCH
path: "/api/users/{customer_identifier}/"
tags: ["Users"]
---

# Update a user

`PATCH /api/users/{customer_identifier}/`

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/users/{customer_identifier}/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Users are created automatically from usage. Use this endpoint to set budgets or update profile fields after creation.

## Path parameters

- `customer_identifier` string, required

## Query parameters

- `environment` 'prod' | 'test'

## Request body

- object
  - `email` string, nullable: User email address.
  - `name` string, nullable: User display name.
  - `metadata` object: Custom key-value metadata.
  - `period_budget` number, nullable: Spending budget per period in USD.
  - `budget_duration` 'daily' | 'weekly' | 'monthly': Budget renewal period.
  - `total_budget` number, nullable: Total lifetime spending budget in USD.
  - `period_start` string, date-time: Optional custom budget period start.
  - `period_end` string, date-time, nullable: Optional custom budget period end.
  - `markup_percentage` number: Markup percentage applied to usage reports for this user.

## Response `200`

Updated user details.

- object
  - `id` string: User identifier.
  - `name` string, nullable: User display name.
  - `email` string, nullable: User email address.
  - `customer_identifier` string: Your unique identifier for the user.
  - `environment` 'prod' | 'test': User environment.
  - `total_budget` number, nullable: Lifetime spending budget in USD.
  - `period_budget` number, nullable: Current period budget in USD.
  - `organization_name` string, nullable: Owning organization name.
  - `total_period_usage` number: Usage in the current budget period in USD.
  - `period_start` string, date-time: Start of the current budget period.
  - `period_end` string, date-time, nullable: End of the current budget period.
  - `budget_duration` 'daily' | 'weekly' | 'monthly': Budget renewal period.
  - `updated_at` string, date-time: Last update timestamp.

## Other responses

- `400`: Validation Error
- `403`: The API key is missing, invalid or expired.
- `404`: Not Found
- `429`: Rate Limited
- `500`: Internal Server Error

## Changes

- **2026-10-21** `c30bcb383ee8`: 12 breaking, 10 info
  - request body became required
  - the `period_budget` request property type changed from `number, null` to `number`, and format from `double` to no format
  - the `total_budget` request property type changed from `number, null` to `number`, and format from `double` to no format
  - the response property `email` became nullable for the status `200`
  - …18 more
- **2026-10-02** `b830b79cfd52`: 2 info
  - added the non-success response with the status `403`
  - removed the non-success response with the status `401`
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `update-user` removed and replaced with `users_updateUser`

[Operation history](https://skmtc.dev/respan/apis/respan-api/changes/api/users/:customer_identifier/patch.md)

---

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