Skip to main content
POST
/
features
Create Feature
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    id: '<string>',
    type: 'static',
    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>",
  "type": "boolean",
  "name": "<string>",
  "display": {
    "singular": "<string>",
    "plural": "<string>"
  },
  "credit_schema": [
    {
      "metered_feature_id": "<string>",
      "credit_cost": 123
    }
  ],
  "archived": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
id
string
required

The ID of the feature. This is used to refer to it in other API calls like /track or /check.

type
enum<string>
required

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.

Available options:
static,
boolean,
single_use,
continuous_use,
credit_system
name
string | null

The name of the feature.

display
object

Singular and plural display names for the feature in your user interface.

credit_schema
object[] | null

A schema that maps 'single_use' feature IDs to credit costs. Applicable only for 'credit_system' features.

Response

200 - application/json
id
string
required

The ID of the feature, used to refer to it in other API calls like /track or /check.

type
enum<string>
required
Available options:
boolean,
single_use,
continuous_use,
credit_system
name
string | null

The name of the feature.

display
object

Singular and plural display names for the feature.

credit_schema
object[] | null

Credit cost schema for credit system features.

archived
boolean | null

Whether or not the feature is archived.