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

# Set User Plan

> Move a member between Standard and Power user, optionally answering a usage request

List active human members, change a plan, and set the extra usage budget beyond the included allowance. Amounts are US dollars.

The calls use the workspace API key's `BILLING_API` scope. Writes run as the key's service account owner. This API does not invite or deactivate members. Use the [User Management API](https://docs.langdock.com/en/developer/user-management-api/user-management-overview.md) for that.

## Base URL

```
https://api.langdock.com/billing/v1/bring-your-own-keys/users/{userId}/plan
```

> [!WARNING]
>
> **Dedicated deployments**
>
> Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.

## Prerequisites

* **API key** with the `BILLING_API` scope
* The key owner is a service account that has not been deleted and has an active Admin membership
* `USER_MANAGEMENT_API` on the same key when you need `email`, `name`, or an email filter

## Change a plan

`PUT /users/{userId}/plan` takes the plan directly.

```json theme={null}
{ "plan": "power_user" }
```

`standard` is the other value. When Langdock manages plans, setting the plan the member already has does not change the plan. Moving the member to `power_user` closes the pending usage request linked to that upgrade. Moving the member to `standard` does not. A request created after the upgrade stays open. Setting `power_user` again retries a linked request that did not close the first time, but does not close that newer request. Without `usageRequestId`, the plan change is saved even if closing the request fails.

The call returns `409` with `code` `CONFLICT` and message `Roles are managed by your identity provider via SCIM` when role management is set to the identity provider and at least one SCIM group is mapped to a plan. Nothing is written, including a request for the plan the member already has. With no plan mapping, the call still sets the plan.

Pass `usageRequestId` as a query parameter to answer that request in the same write. The plan is kept only when the request belongs to this member, is still pending, and the move is from `standard` to `power_user`. Otherwise nothing is written. A missing request, or one that is not this member's, returns `404` with `code` `NOT_FOUND`. A request that is no longer pending returns `409` with `code` `USAGE_REQUEST_NOT_PENDING`. The current status is in `details.status`. A move that does not raise the allowance returns `409` with `code` `USAGE_REQUEST_NOT_ANSWERED`. The request stays pending.

The response is the member object with `extraUsagePeriodSpend` set to `null`.

> [!NOTE]
>
> Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on [API Key Best Practices](https://docs.langdock.com/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices.md).


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