Skip to main content
POST
JavaScript

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-ACCOUNT-ID
string

Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.

X-ENVIRONMENT-ID
string

Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).

Body

application/json

Request to create a new plan

id
string
required

The unique identifier for the entity

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
displayName
string
required

The display name of the package

Maximum string length: 255
productId
string
required

The product ID to associate the plan with

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
description
string | null

The description of the package

Maximum string length: 255
parentPlanId
string | null

The ID of the parent plan, if applicable

Maximum string length: 255
pricingType
enum<string> | null

The pricing type of the package

Available options:
FREE,
PAID,
CUSTOM
billingId
string | null

The unique identifier for the entity in the billing provider

Maximum string length: 255
status
enum<string>

The status of the package

Available options:
DRAFT,
PUBLISHED,
ARCHIVED
metadata
object

Metadata associated with the entity

defaultTrialConfig
DefaultTrialConfig · object | null

Default trial configuration for the plan

Response

The newly created plan object.

Response object

data
Plan · object
required

Plan configuration object