Skip to main content
POST
/
features
Create Feature
curl --request POST \
  --url https://api.useautumn.com/v1/features \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "<string>",
  "name": "<string>",
  "type": "static",
  "display": {
    "singular": "<string>",
    "plural": "<string>"
  },
  "credit_schema": [
    {
      "metered_feature_id": "<string>",
      "credit_cost": 123
    }
  ]
}'
{
  "id": "tokens",
  "name": "Tokens",
  "type": "single_use",
  "display": {
    "singular": "token",
    "plural": "tokens"
  },
  "credit_schema": null,
  "archived": false
}

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 | null

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 | null

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.