const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
display: {singular: '<string>', plural: '<string>'},
credit_schema: [{metered_feature_id: '<string>', credit_cost: 123}]
})
};
fetch('https://api.useautumn.com/v1/features', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"name": "<string>",
"display": {
"singular": "<string>",
"plural": "<string>"
},
"credit_schema": [
{
"metered_feature_id": "<string>",
"credit_cost": 123
}
],
"archived": true
}Create Feature
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
display: {singular: '<string>', plural: '<string>'},
credit_schema: [{metered_feature_id: '<string>', credit_cost: 123}]
})
};
fetch('https://api.useautumn.com/v1/features', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"name": "<string>",
"display": {
"singular": "<string>",
"plural": "<string>"
},
"credit_schema": [
{
"metered_feature_id": "<string>",
"credit_cost": 123
}
],
"archived": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The ID of the feature. This is used to refer to it in other API calls like /track or /check.
^[a-zA-Z0-9_-]+$The type of the feature. 'single_use' features are consumed, like API calls, tokens, or messages. 'continuous_use' features are allocated, like seats, workspaces, or projects. 'credit_system' features are schemas that unify multiple 'single_use' features into a single credit system.
static, boolean, single_use, continuous_use, credit_system The name of the feature.
Singular and plural display names for the feature in your user interface.
Show child attributes
Show child attributes
A schema that maps 'single_use' feature IDs to credit costs. Applicable only for 'credit_system' features.
Show child attributes
Show child attributes
Response
The ID of the feature, used to refer to it in other API calls like /track or /check.
boolean, single_use, continuous_use, credit_system The name of the feature.
Singular and plural display names for the feature.
Show child attributes
Show child attributes
Credit cost schema for credit system features.
Show child attributes
Show child attributes
Whether or not the feature is archived.

