POST
/
plans
Create a new plan
curl --request POST \
  --url http://localhost:3001/portal-api/plans \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "CID": "2r7p8aUnkzby17hCJk8w2XvK3K6",
  "AutoApproveAccessRequests": true,
  "Catalogues": [
    1
  ],
  "DisplayName": "Free plan",
  "Description": "Free plan offers only basic functionality",
  "JWTScope": "free-plan",
  "KeyExpiresIn": 3600,
  "MetaData": {
    "data1": "1",
    "data2": "2"
  },
  "Name": "free_plan_2",
  "Per": 10,
  "PlanQuota": 2,
  "PlanQuotaRenewalRate": 3600,
  "Quota": 0,
  "QuotaRenewalRate": -1,
  "RateLimit": 5,
  "UnlimitedQuota": true,
  "UnlimitedRateLimit": false,
  "ProviderID": 1
}'
{
  "CID": "2r7p8aUnkzby17hCJk8w2XvK3K6",
  "AutoApproveAccessRequests": true,
  "Catalogues": [
    1
  ],
  "DisplayName": "Free plan",
  "Description": "Free plan offers only basic functionality",
  "JWTScope": "free-plan",
  "KeyExpiresIn": 3600,
  "MetaData": {
    "data1": "1",
    "data2": "2"
  },
  "Name": "free_plan_2",
  "Per": 10,
  "PlanQuota": 2,
  "PlanQuotaRenewalRate": 3600,
  "Quota": 0,
  "QuotaRenewalRate": -1,
  "RateLimit": 5,
  "UnlimitedQuota": true,
  "UnlimitedRateLimit": false,
  "ProviderID": 1,
  "ID": 1,
  "ReferenceID": "6490fd451ba6a6000108864e"
}

Authorizations

Authorization
string
header
required

Body

application/json
Name
string
required

Name of the plan

Example:

"free_plan_2"

ProviderID
integer
required

ID of the provider

Example:

1

CID
string

Client ID for the plan

Example:

"2r7p8aUnkzby17hCJk8w2XvK3K6"

AutoApproveAccessRequests
boolean

Whether access requests are automatically approved

Example:

true

Catalogues
integer[]

List of catalogue IDs this plan belongs to

Example:
[1]
DisplayName
string

Display name of the plan

Example:

"Free plan"

Description
string

Description of the plan

Example:

"Free plan offers only basic functionality"

JWTScope
string

JWT scope for the plan

Example:

"free-plan"

KeyExpiresIn
integer

Key expiration time in seconds

Example:

3600

MetaData
object

Additional metadata for the plan

Example:
{ "data1": "1", "data2": "2" }
Per
number

Time period for rate limiting in seconds

Example:

10

PlanQuota
integer

Plan quota value

Example:

2

PlanQuotaRenewalRate
integer

Plan quota renewal rate in seconds

Example:

3600

Quota
integer

Quota value

Example:

0

QuotaRenewalRate
integer

Quota renewal rate in seconds

Example:

-1

RateLimit
number

Rate limit for the plan

Example:

5

UnlimitedQuota
boolean

Whether the plan has unlimited quota

Example:

true

UnlimitedRateLimit
boolean

Whether the plan has unlimited rate limit

Example:

false

Response

OK

Name
string
required

Name of the plan

Example:

"free_plan_2"

ProviderID
integer
required

ID of the provider

Example:

1

CID
string

Client ID for the plan

Example:

"2r7p8aUnkzby17hCJk8w2XvK3K6"

AutoApproveAccessRequests
boolean

Whether access requests are automatically approved

Example:

true

Catalogues
integer[]

List of catalogue IDs this plan belongs to

Example:
[1]
DisplayName
string

Display name of the plan

Example:

"Free plan"

Description
string

Description of the plan

Example:

"Free plan offers only basic functionality"

JWTScope
string

JWT scope for the plan

Example:

"free-plan"

KeyExpiresIn
integer

Key expiration time in seconds

Example:

3600

MetaData
object

Additional metadata for the plan

Example:
{ "data1": "1", "data2": "2" }
Per
number

Time period for rate limiting in seconds

Example:

10

PlanQuota
integer

Plan quota value

Example:

2

PlanQuotaRenewalRate
integer

Plan quota renewal rate in seconds

Example:

3600

Quota
integer

Quota value

Example:

0

QuotaRenewalRate
integer

Quota renewal rate in seconds

Example:

-1

RateLimit
number

Rate limit for the plan

Example:

5

UnlimitedQuota
boolean

Whether the plan has unlimited quota

Example:

true

UnlimitedRateLimit
boolean

Whether the plan has unlimited rate limit

Example:

false

ID
integer

Unique identifier of the plan

Example:

1

ReferenceID
string

Reference ID of the plan in the provider system

Example:

"6490fd451ba6a6000108864e"