Skip to content

Create Subscription

Open in ChatGPT Open in Claude
POST
/v1/subscription
curl --request POST \
--url https://api.foldspace.ai/v1/subscription \
--header 'Content-Type: application/json' \
--header 'X-FOLDSPACE-API-KEY: <X-FOLDSPACE-API-KEY>' \
--data '{ "identifyId": "subscription_1234", "name": "Acme Org Subscription", "domain": "acme.org", "planId": "PLAN-123456", "lastSeenDate": 1734539909141, "customAttributes": { "additionalProperty": {} }, "products": [ { "product": "X7B69NRTTBM7", "environment": 1 } ] }'

Creates a new subscription.

DTO for creating a new subscription. identifyId is required.

Media type application/json

Subscription Data Transfer Object

object
id

System-managed subscription ID (not updatable)

string
identifyId
required

Unique identify ID for the subscription. Required during creation, not updatable.

string
0 <= 255 characters
Example
subscription_1234
name

Subscription name

string
0 <= 255 characters
Example
Acme Org Subscription
domain

Domain associated with this subscription

string
0 <= 255 characters
Example
acme.org
planId

Plan ID or SKU

string
0 <= 255 characters
Example
PLAN-123456
lastSeenDate

Last seen date (epoch ms). Must be a positive value.

integer format: int64
Example
1734539909141
lastModifiedDate

Last modified date (system-managed)

integer format: int64
customAttributes

Custom attributes as map of key-value pairs

object
key
additional properties

Custom attributes as map of key-value pairs

object
products

Products associated with this subscription (1=prod, 2=stage, 3=test, 4=dev)

Array<object>
0 <= 20 items unique items

Details about product and environment association

object
product

Product code

string
0 <= 16 characters
Example
X7B69NRTTBM7
environment

Environment code (1=prod, 2=stage, 3=test, 4=dev)

integer format: int32
>= 1 <= 4
Example
1

Subscription created successfully

Media type application/json
string
Example
{
"message": "Subscription created successfully"
}

Bad Request

Media type */*
string

Unauthorized

Media type */*
string

Rate limit exceeded for subscription

Media type */*
string
Example
{
"error": "Rate limit exceeded for subscription"
}

Internal server error

Media type */*
string