A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "api_calls",
"name": "<string>",
"description": "<string>",
"kind": "boolean",
"unit_name": "<string>",
"reset_period": "day",
"archived": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Create a feature
Requires billing:write. Declares one thing your product does, that your plans may or may not include. Yours, not UserKit’s — the key is a string your code gates on, and this namespace never meets the one our own plans use.
The kind decides what else the feature must carry, in both directions:
boolean— nounit_nameand noreset_period. It counts nothing.metered— both are required. A limit with no unit is a number nobody can read, and the reset period is what makes “how much this period” answerable.credit—unit_nameis required andreset_periodis forbidden: a balance is granted and spent, never reset. The grant’s cadence belongs to the plan.
How a feature is measured is permanent once created — see PATCH /v1/organization/catalogue/features/{id}.
A feature created here is on no plan. Put it on one with PUT /v1/organization/catalogue/plans/{planId}/features/{featureId}.
A valid request URL is required to generate request examples{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "api_calls",
"name": "<string>",
"description": "<string>",
"kind": "boolean",
"unit_name": "<string>",
"reset_period": "day",
"archived": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}{
"error": {
"code": "forbidden",
"message": "your role does not allow this action"
}
}Autorizações
A staff session token, uk_st_…. Minted by sign-up, sign-in or the two-factor exchange. Only a 401 means it is spent; not_a_member (403) is about the organization named in X-Organization-Id and leaves the token good for the others.
Cabeçalhos
The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.
Parâmetros de consulta
Which environment to act in. A view parameter, valid only on the staff surface — a machine credential never chooses its environment, it is resolved from the key.
live, test Corpo
Lowercase letters, digits, _, - and .. Unique within the environment. What your own code compares against.
64"api_calls"
boolean, metered, credit What one unit is called (seats, runs, tokens). Required for metered and credit, forbidden for boolean.
Required for metered and forbidden for the other kinds. billing_period is renewal to renewal rather than a calendar unit.
day, week, month, year, billing_period Resposta
The feature.
One thing your product does, that your plans may or may not include. Yours, not UserKit's — the key is a string your code gates on.
Lowercase letters, digits, _, - and .. What your own code compares against.
"api_calls"
boolean is on or off. metered is counted against a ceiling that resets. credit is spent from a balance — a counter answers “how much this period”, a balance answers “how much is left”.
boolean, metered, credit What one unit is called (seats, runs, tokens). Empty on a boolean feature and required on the others: a limit with no unit is a number nobody can read.
How a metered feature's counter is bucketed; null for the other kinds. It belongs to the feature rather than to the plan, so a counter keeps its shape when a customer changes plan mid-period.
day, week, month, year, billing_period, null