87 lines
2.7 KiB
Plaintext
87 lines
2.7 KiB
Plaintext
---
|
|
title: "Get Feature"
|
|
openapi: "openapi POST /v1/features.get"
|
|
---
|
|
|
|
import { DynamicParamField } from "/snippets/dynamic-param-field.jsx";
|
|
import { DynamicResponseField } from "/snippets/dynamic-response-field.jsx";
|
|
import { DynamicResponseExample } from "/snippets/dynamic-response-example.jsx";
|
|
|
|
### Body Parameters
|
|
|
|
<DynamicParamField body="feature_id" type="string" required>
|
|
The ID of the feature.
|
|
</DynamicParamField>
|
|
|
|
|
|
### Response
|
|
|
|
<DynamicResponseField name="id" type="string">
|
|
The unique identifier for this feature, used in /check and /track calls.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="name" type="string">
|
|
Human-readable name displayed in the dashboard and billing UI.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="type" type="'boolean' | 'metered' | 'credit_system'">
|
|
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="consumable" type="boolean">
|
|
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="event_names" type="string[]">
|
|
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="credit_schema" type="object[]">
|
|
For credit_system features: maps metered features to their credit costs.
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="metered_feature_id" type="string">
|
|
ID of the metered feature that draws from this credit system.
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="credit_cost" type="number">
|
|
Credits consumed per unit of the metered feature.
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="display" type="object">
|
|
Display names for the feature in billing UI and customer-facing components.
|
|
<Expandable title="properties">
|
|
<DynamicResponseField name="singular" type="string | null">
|
|
Singular form for UI display (e.g., 'API call', 'seat').
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="plural" type="string | null">
|
|
Plural form for UI display (e.g., 'API calls', 'seats').
|
|
</DynamicResponseField>
|
|
|
|
</Expandable>
|
|
</DynamicResponseField>
|
|
|
|
<DynamicResponseField name="archived" type="boolean">
|
|
Whether the feature is archived and hidden from the dashboard.
|
|
</DynamicResponseField>
|
|
|
|
|
|
<ResponseExample>
|
|
```json 200
|
|
{
|
|
"id": "api-calls",
|
|
"name": "API Calls",
|
|
"type": "metered",
|
|
"consumable": true,
|
|
"archived": false,
|
|
"display": {
|
|
"singular": "API call",
|
|
"plural": "API calls"
|
|
}
|
|
}
|
|
```
|
|
</ResponseExample>
|