Skip to main content
PUT
Set user extra usage budget
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 for that.

Base URL

Dedicated deploymentsReplace 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

Set an extra usage budget

PUT /users/{userId}/extra-usage-budget takes the budget directly. There is no wrapper field.
{ "type": "none" } removes the extra allowance. { "type": "unlimited" } removes the numeric cap. A limited amount may be zero. If the effective budget was limited and the new effective budget is higher or unlimited, the member’s pending usage request is closed. The same budget or a lower one leaves the request open. Without usageRequestId, the budget is saved even if closing the request fails. Pass usageRequestId as a query parameter to answer that request in the same write. The budget is kept only when the request belongs to this member, is still pending, and the effective budget rises as described above. 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. A change 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.
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.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Path Parameters

userId
string<uuid>
required

Query Parameters

usageRequestId
string<uuid>

Optional pending usage request this write answers. The write is rejected with 404 unless the request belongs to this member, 409 USAGE_REQUEST_NOT_PENDING if it is no longer pending, or 409 USAGE_REQUEST_NOT_ANSWERED if the write does not increase the member's allowance (an unchanged or lower limit, or a plan the member already has); nothing is written in those cases. A real increase or upgrade resolves the member's pending request with or without this parameter.

Body

application/json
type
enum<string>
required
Available options:
limited
amount
number
required
Required range: x >= 0

Response

Updated resource. Spending is null; GET retrieves spending.

USD. The highest plan/group monthly budget configures weekly and session allowances. Extra usage can start when those included allowances are exhausted. Spend is null when private and always null in mutation responses.

id
string<uuid>
required
plan
enum<string>
required
Available options:
standard,
power_user
monthlyBudget
object
required
extraUsageBudget
object
required
extraUsagePeriodSpend
number | null
required
Required range: x >= 0
email
string<email>

Present only when the key also has the USER_MANAGEMENT_API scope.

name
string | null

Present only when the key also has the USER_MANAGEMENT_API scope.