Skip to main content

Management API: REST API Management

You're reading API Gateway 1.1.0. The newest release is 1.2.0. Go to the newest release

CRUD operations for Rest APIs

Create a new RestAPI​

POST /rest-apis

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/rest-apis \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Add a new RestAPI to the Gateway.

Payload

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "RestApi",
"metadata": {
"name": "reading-list-api-v1.0"
},
"spec": {
"displayName": "Reading-List-API",
"version": "v1.0",
"context": "/reading-list/$version",
"upstream": {
"main": {
"url": "https://apis.bijira.dev/samples/reading-list-api-service/v1.0"
}
},
"policies": [
{
"name": "set-headers",
"version": "v1",
"params": {
"request": {
"headers": [
{
"name": "x-wso2-apip-gateway-version",
"value": "v1.0.0"
}
]
},
"response": {
"headers": [
{
"name": "x-environment",
"value": "development"
}
]
}
}
}
],
"operations": [
{
"method": "GET",
"path": "/books"
},
{
"method": "POST",
"path": "/books"
},
{
"method": "GET",
"path": "/books/{id}"
},
{
"method": "PUT",
"path": "/books/{id}"
},
{
"method": "DELETE",
"path": "/books/{id}"
}
]
}
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
bodybodyRestAPIRequesttruenone

Example responses

201 Response

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "RestApi",
"metadata": {
"name": "reading-list-api-v1.0"
},
"spec": {
"displayName": "Reading-List-API",
"version": "v1.0",
"context": "/reading-list/$version",
"upstream": {
"main": {
"url": "https://apis.bijira.dev/samples/reading-list-api-service/v1.0"
}
},
"policies": [
{
"name": "set-headers",
"version": "v1",
"params": {
"request": {
"headers": [
{
"name": "x-wso2-apip-gateway-version",
"value": "v1.0.0"
}
]
},
"response": {
"headers": [
{
"name": "x-environment",
"value": "development"
}
]
}
}
}
],
"operations": [
{
"method": "GET",
"path": "/books"
},
{
"method": "POST",
"path": "/books"
},
{
"method": "GET",
"path": "/books/{id}"
},
{
"method": "PUT",
"path": "/books/{id}"
},
{
"method": "DELETE",
"path": "/books/{id}"
}
]
},
"status": {
"id": "reading-list-api-v1.0",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}

Responses​

StatusMeaningDescriptionSchema
201CreatedRestAPI created successfullyRestAPI
400Bad RequestInvalid configuration (validation failed)ErrorResponse
409ConflictConflict - API with same name and version already existsErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

List all RestAPIs​

GET /rest-apis

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/rest-apis \
-u {username}:{password} \
-H 'Accept: application/json'

List RestAPIs registered in the Gateway, optionally filtered by name, version, context, or status.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
displayNamequerystringfalseFilter by API display name
versionquerystringfalseFilter by API version
contextquerystringfalseFilter by API context/path
statusquerystringfalseFilter by deployment status

Enumerated Values​

ParameterValue
statusdeployed
statusundeployed

Example responses

200 Response

{
"status": "success",
"count": 5,
"apis": [
{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "RestApi",
"metadata": {
"name": "reading-list-api-v1.0"
},
"spec": {
"displayName": "Reading-List-API",
"version": "v1.0",
"context": "/reading-list/$version",
"upstream": {
"main": {
"url": "https://apis.bijira.dev/samples/reading-list-api-service/v1.0"
}
},
"policies": [
{
"name": "set-headers",
"version": "v1",
"params": {
"request": {
"headers": [
{
"name": "x-wso2-apip-gateway-version",
"value": "v1.0.0"
}
]
},
"response": {
"headers": [
{
"name": "x-environment",
"value": "development"
}
]
}
}
}
],
"operations": [
{
"method": "GET",
"path": "/books"
},
{
"method": "POST",
"path": "/books"
},
{
"method": "GET",
"path": "/books/{id}"
},
{
"method": "PUT",
"path": "/books/{id}"
},
{
"method": "DELETE",
"path": "/books/{id}"
}
]
},
"status": {
"id": "reading-list-api-v1.0",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}
]
}

Responses​

StatusMeaningDescriptionSchema
200OKList of RestAPIsInline
500Internal Server ErrorInternal server errorErrorResponse

Response Schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
statusstringfalsenonenone
countintegerfalsenonenone
apis[allOf]falsenonenone

allOf

NameTypeRequiredRestrictionsDescription
anonymousRestAPIRequestfalsenonenone
apiVersionstringtruenoneAPI specification version
kindstringtruenoneAPI type
metadataMetadatatruenonenone
namestringtruenoneUnique handle for the resource
labelsobjectfalsenoneLabels are key-value pairs for organizing and selecting APIs. Keys must not contain spaces.
additionalPropertiesstringfalsenonenone
annotationsobjectfalsenoneAnnotations are arbitrary non-identifying metadata. Use domain-prefixed keys.
additionalPropertiesstringfalsenonenone
specAPIConfigDatatruenonenone
displayNamestringtruenoneHuman-readable API name (must be URL-friendly - only letters, numbers, spaces, hyphens, underscores, and dots allowed)
versionstringtruenoneSemantic version of the API
contextstringtruenoneBase path for all API routes (must start with /, no trailing slash). Use $version to embed the version in the path (e.g., /reading-list/$version resolves to /reading-list/v1.0).
upstreamDefinitions[UpstreamDefinition]falsenoneList of reusable upstream definitions with optional timeout configurations
namestringtruenoneUnique identifier for this upstream definition
basePathstringfalsenoneBase path prefix for all endpoints in this upstream (e.g., /api/v2). All requests to this upstream will have this path prepended.
timeoutUpstreamTimeoutfalsenoneTimeout configuration for upstream requests
connectstringfalsenoneConnection timeout duration (e.g., "5s", "500ms")
upstreams[object]truenoneList of backend targets with optional weights for load balancing
urlstring(uri)truenoneBackend URL (host and port only, path comes from basePath)
weightintegerfalsenoneWeight for load balancing (optional, default 100)
upstreamobjecttruenoneAPI-level upstream configuration
mainUpstreamtruenoneUpstream backend configuration (single target or reference)
urlstring(uri)falsenoneDirect backend URL to route traffic to
refstringfalsenoneReference to a predefined upstreamDefinition
hostRewritestringfalsenoneControls how the Host header is handled when routing to the upstream. auto delegates host rewriting to Envoy, which rewrites the Host header using the upstream cluster host. manual disables automatic rewriting and expects explicit configuration.

oneOf

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone

xor

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone

continued

NameTypeRequiredRestrictionsDescription
sandboxUpstreamfalsenoneUpstream backend configuration (single target or reference)
vhostsobjectfalsenoneCustom virtual hosts/domains for the API
mainstringtruenoneCustom virtual host/domain for production traffic
sandboxstringfalsenoneCustom virtual host/domain for sandbox traffic
subscriptionPlans[string]falsenoneList of subscription plan names available for this API
policies[Policy]falsenoneList of API-level policies applied to all operations unless overridden
namestringtruenoneName of the policy
versionstringtruenoneVersion of the policy. Only major-only version is allowed (e.g., v0, v1). Full semantic version (e.g., v1.0.0) is not accepted and will be rejected. The Gateway Controller resolves the major version to the single matching full version installed in the gateway image.
executionConditionstringfalsenoneExpression controlling conditional execution of the policy
paramsobjectfalsenoneArbitrary parameters for the policy (free-form key/value structure)
operations[Operation]truenoneList of HTTP operations/routes
methodstringtruenoneHTTP method
pathstringtruenoneRoute path with optional {param} placeholders
policies[Policy]falsenoneList of policies applied only to this operation (overrides or adds to API-level policies)
deploymentStatestringfalsenoneDesired deployment state - 'deployed' (default) or 'undeployed'. When set to 'undeployed', the API is removed from router traffic but configuration, API keys, and policies are preserved for potential redeployment.

and

NameTypeRequiredRestrictionsDescription
anonymousobjectfalsenonenone
statusResourceStatusfalseread-onlyServer-managed lifecycle fields. Populated on responses.
idstringfalsenoneUnique identifier assigned by the server (equal to metadata.name)
statestringfalsenoneDesired deployment state reported by the server
createdAtstring(date-time)falsenoneTimestamp when the resource was first created (UTC)
updatedAtstring(date-time)falsenoneTimestamp when the resource was last updated (UTC)
deployedAtstring(date-time)falsenoneTimestamp when the resource was last deployed (omitted when undeployed)

Enumerated Values​

PropertyValue
apiVersiongateway.api-platform.wso2.com/v1alpha1
kindRestApi
hostRewriteauto
hostRewritemanual
methodGET
methodPOST
methodPUT
methodDELETE
methodPATCH
methodHEAD
methodOPTIONS
deploymentStatedeployed
deploymentStateundeployed
statedeployed
stateundeployed

Get RestAPI by id​

GET /rest-apis/{id}

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/rest-apis/{id} \
-u {username}:{password} \
-H 'Accept: application/json'

Get a RestAPI by its ID.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier for the API.

Detailed descriptions​

id: Unique public identifier for the API.

Example responses

200 Response

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "RestApi",
"metadata": {
"name": "reading-list-api-v1.0"
},
"spec": {
"displayName": "Reading-List-API",
"version": "v1.0",
"context": "/reading-list/$version",
"upstream": {
"main": {
"url": "https://apis.bijira.dev/samples/reading-list-api-service/v1.0"
}
},
"policies": [
{
"name": "set-headers",
"version": "v1",
"params": {
"request": {
"headers": [
{
"name": "x-wso2-apip-gateway-version",
"value": "v1.0.0"
}
]
},
"response": {
"headers": [
{
"name": "x-environment",
"value": "development"
}
]
}
}
}
],
"operations": [
{
"method": "GET",
"path": "/books"
},
{
"method": "POST",
"path": "/books"
},
{
"method": "GET",
"path": "/books/{id}"
},
{
"method": "PUT",
"path": "/books/{id}"
},
{
"method": "DELETE",
"path": "/books/{id}"
}
]
},
"status": {
"id": "reading-list-api-v1.0",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKRestAPI detailsRestAPI
404Not FoundRestAPI not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Update an existing RestAPI​

PUT /rest-apis/{id}

Code samples


curl -X PUT http://localhost:9090/api/management/v0.9/rest-apis/{id} \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Update an existing RestAPI in the Gateway.

Payload

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "RestApi",
"metadata": {
"name": "reading-list-api-v1.0"
},
"spec": {
"displayName": "Reading-List-API",
"version": "v1.0",
"context": "/reading-list/$version",
"upstream": {
"main": {
"url": "https://apis.bijira.dev/samples/reading-list-api-service/v1.0"
}
},
"policies": [
{
"name": "set-headers",
"version": "v1",
"params": {
"request": {
"headers": [
{
"name": "x-wso2-apip-gateway-version",
"value": "v1.0.0"
}
]
},
"response": {
"headers": [
{
"name": "x-environment",
"value": "development"
}
]
}
}
}
],
"operations": [
{
"method": "GET",
"path": "/books"
},
{
"method": "POST",
"path": "/books"
},
{
"method": "GET",
"path": "/books/{id}"
},
{
"method": "PUT",
"path": "/books/{id}"
},
{
"method": "DELETE",
"path": "/books/{id}"
}
]
}
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier of the API to update.
bodybodyRestAPIRequesttruenone

Detailed descriptions​

id: Unique public identifier of the API to update.

Example responses

200 Response

{
"apiVersion": "gateway.api-platform.wso2.com/v1alpha1",
"kind": "RestApi",
"metadata": {
"name": "reading-list-api-v1.0"
},
"spec": {
"displayName": "Reading-List-API",
"version": "v1.0",
"context": "/reading-list/$version",
"upstream": {
"main": {
"url": "https://apis.bijira.dev/samples/reading-list-api-service/v1.0"
}
},
"policies": [
{
"name": "set-headers",
"version": "v1",
"params": {
"request": {
"headers": [
{
"name": "x-wso2-apip-gateway-version",
"value": "v1.0.0"
}
]
},
"response": {
"headers": [
{
"name": "x-environment",
"value": "development"
}
]
}
}
}
],
"operations": [
{
"method": "GET",
"path": "/books"
},
{
"method": "POST",
"path": "/books"
},
{
"method": "GET",
"path": "/books/{id}"
},
{
"method": "PUT",
"path": "/books/{id}"
},
{
"method": "DELETE",
"path": "/books/{id}"
}
]
},
"status": {
"id": "reading-list-api-v1.0",
"state": "deployed",
"createdAt": "2026-04-24T07:21:13Z",
"updatedAt": "2026-04-24T07:21:13Z",
"deployedAt": "2026-04-24T07:21:13Z"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKRestAPI updated successfullyRestAPI
400Bad RequestInvalid configuration (validation failed)ErrorResponse
404Not FoundRestAPI not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Delete a RestAPI​

DELETE /rest-apis/{id}

Code samples


curl -X DELETE http://localhost:9090/api/management/v0.9/rest-apis/{id} \
-u {username}:{password} \
-H 'Accept: application/json'

Delete a RestAPI from the Gateway.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier of the API to delete.

Detailed descriptions​

id: Unique public identifier of the API to delete.

Example responses

200 Response

{
"status": "success",
"message": "RestAPI deleted successfully",
"id": "reading-list-api-v1.0"
}

Responses​

StatusMeaningDescriptionSchema
200OKRestAPI deleted successfullyInline
404Not FoundRestAPI not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Response Schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
statusstringfalsenonenone
messagestringfalsenonenone
idstringfalsenonenone

Create a new API key for an API​

POST /rest-apis/{id}/api-keys

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/rest-apis/{id}/api-keys \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Generate a new API key for a RestAPI in the Gateway. The key is a 32-byte random value encoded in hexadecimal, prefixed with apip_. Use the API Key policy on the API to validate incoming requests with this key.

Payload

{
"name": "my-production-key"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier of the API to generate the key for
bodybodyAPIKeyCreationRequesttruenone

Detailed descriptions​

id: Unique public identifier of the API to generate the key for

Example responses

201 Response

{
"status": "success",
"message": "API key generated successfully",
"remainingApiKeyQuota": 9,
"apiKey": {
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
}

Responses​

StatusMeaningDescriptionSchema
201CreatedAPI key created successfullyAPIKeyCreationResponse
400Bad RequestInvalid configuration (validation failed)ErrorResponse
404Not FoundRestAPI not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Get the list of API keys for an API​

GET /rest-apis/{id}/api-keys

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/rest-apis/{id}/api-keys \
-u {username}:{password} \
-H 'Accept: application/json'

List all API keys for a RestAPI in the Gateway.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier of the API to retrieve the keys for

Detailed descriptions​

id: Unique public identifier of the API to retrieve the keys for

Example responses

200 Response

{
"apiKeys": [
{
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
],
"totalCount": 3,
"status": "success"
}

Responses​

StatusMeaningDescriptionSchema
200OKList of API keysAPIKeyListResponse
404Not FoundRestAPI not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Regenerate API key for an API​

POST /rest-apis/{id}/api-keys/{apiKeyName}/regenerate

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/rest-apis/{id}/api-keys/{apiKeyName}/regenerate \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Regenerate an existing API key for a RestAPI in the Gateway. The previous key is revoked and replaced with a new 32-byte random value encoded in hexadecimal, prefixed with apip_.

Payload

{}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier of the API to generate the key for
apiKeyNamepathstringtrueName of the API key to regenerate
bodybodyAPIKeyRegenerationRequesttruenone

Detailed descriptions​

id: Unique public identifier of the API to generate the key for

apiKeyName: Name of the API key to regenerate

Example responses

200 Response

{
"status": "success",
"message": "API key generated successfully",
"remainingApiKeyQuota": 9,
"apiKey": {
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKAPI key rotated successfullyAPIKeyCreationResponse
400Bad RequestInvalid configuration (validation failed)ErrorResponse
404Not FoundRestAPI not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Update an API key with a new regenerated value​

PUT /rest-apis/{id}/api-keys/{apiKeyName}

Code samples


curl -X PUT http://localhost:9090/api/management/v0.9/rest-apis/{id}/api-keys/{apiKeyName} \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Update an API key with a custom value instead of auto-generating one.

Payload

{
"name": "my-production-key"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier of the API
apiKeyNamepathstringtrueName of the API key to update
bodybodyAPIKeyUpdateRequesttruenone

Detailed descriptions​

id: Unique public identifier of the API

apiKeyName: Name of the API key to update

Example responses

200 Response

{
"status": "success",
"message": "API key generated successfully",
"remainingApiKeyQuota": 9,
"apiKey": {
"name": "my-production-key",
"displayName": "My Production Key",
"apiKey": "apip_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"apiId": "reading-list-api-v1.0",
"status": "active",
"createdAt": "2026-04-01T10:30:00Z",
"createdBy": "admin",
"expiresAt": null,
"source": "local"
}
}

Responses​

StatusMeaningDescriptionSchema
200OKAPI key updated successfullyAPIKeyCreationResponse
400Bad RequestInvalid request (validation failed)ErrorResponse
404Not FoundAPI or API key not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Revoke an API key​

DELETE /rest-apis/{id}/api-keys/{apiKeyName}

Code samples


curl -X DELETE http://localhost:9090/api/management/v0.9/rest-apis/{id}/api-keys/{apiKeyName} \
-u {username}:{password} \
-H 'Accept: application/json'

Revoke an API key. Once revoked, it can no longer be used to authenticate requests.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `consumer`

Parameters​

NameInTypeRequiredDescription
idpathstringtrueUnique public identifier of the API to revoke the key for
apiKeyNamepathstringtrueName of the API key to revoke

Detailed descriptions​

id: Unique public identifier of the API to revoke the key for

apiKeyName: Name of the API key to revoke

Example responses

200 Response

{
"status": "success",
"message": "API key revoked successfully"
}

Responses​

StatusMeaningDescriptionSchema
200OKAPI key revoked successfullyAPIKeyRevocationResponse
400Bad RequestInvalid configuration (validation failed)ErrorResponse
404Not FoundRestAPI not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Create a subscription plan​

POST /subscription-plans

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/subscription-plans \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Create a subscription plan that defines rate limits and access tiers for API subscriptions.

Payload

{
"planName": "Gold",
"billingPlan": "COMMERCIAL",
"stopOnQuotaReach": true,
"throttleLimitCount": 1000,
"throttleLimitUnit": "Hour",
"expiryTime": "2026-12-31T23:59:59Z",
"status": "ACTIVE"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
bodybodySubscriptionPlanCreateRequesttruenone

Example responses

201 Response

{
"id": "string",
"planName": "string",
"billingPlan": "string",
"stopOnQuotaReach": true,
"throttleLimitCount": 0,
"throttleLimitUnit": "string",
"expiryTime": "2019-08-24T14:15:22Z",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Responses​

StatusMeaningDescriptionSchema
201CreatedSubscription plan createdSubscriptionPlanResponse
400Bad RequestBad requestErrorResponse
409ConflictConflictErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

List subscription plans​

GET /subscription-plans

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/subscription-plans \
-u {username}:{password} \
-H 'Accept: application/json'

List all subscription plans available in the Gateway.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Example responses

200 Response

{
"subscriptionPlans": [
{
"id": "string",
"planName": "string",
"billingPlan": "string",
"stopOnQuotaReach": true,
"throttleLimitCount": 0,
"throttleLimitUnit": "string",
"expiryTime": "2019-08-24T14:15:22Z",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
],
"count": 0
}

Responses​

StatusMeaningDescriptionSchema
200OKList of subscription plansSubscriptionPlanListResponse
500Internal Server ErrorInternal server errorErrorResponse

Get a subscription plan by ID​

GET /subscription-plans/{planId}

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/subscription-plans/{planId} \
-u {username}:{password} \
-H 'Accept: application/json'

Get the details of a subscription plan by its ID.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
planIdpathstringtruenone

Example responses

200 Response

{
"id": "string",
"planName": "string",
"billingPlan": "string",
"stopOnQuotaReach": true,
"throttleLimitCount": 0,
"throttleLimitUnit": "string",
"expiryTime": "2019-08-24T14:15:22Z",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Responses​

StatusMeaningDescriptionSchema
200OKSubscription plan detailsSubscriptionPlanResponse
404Not FoundNot foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Update a subscription plan​

PUT /subscription-plans/{planId}

Code samples


curl -X PUT http://localhost:9090/api/management/v0.9/subscription-plans/{planId} \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Update an existing subscription plan in the Gateway.

Payload

{
"planName": "string",
"billingPlan": "string",
"stopOnQuotaReach": true,
"throttleLimitCount": 0,
"throttleLimitUnit": "Min",
"expiryTime": "2019-08-24T14:15:22Z",
"status": "ACTIVE"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
planIdpathstringtruenone
bodybodySubscriptionPlanUpdateRequestfalsenone

Example responses

200 Response

{
"id": "string",
"planName": "string",
"billingPlan": "string",
"stopOnQuotaReach": true,
"throttleLimitCount": 0,
"throttleLimitUnit": "string",
"expiryTime": "2019-08-24T14:15:22Z",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Responses​

StatusMeaningDescriptionSchema
200OKSubscription plan updatedSubscriptionPlanResponse
404Not FoundNot foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Delete a subscription plan​

DELETE /subscription-plans/{planId}

Code samples


curl -X DELETE http://localhost:9090/api/management/v0.9/subscription-plans/{planId} \
-u {username}:{password} \
-H 'Accept: application/json'

Delete a subscription plan from the Gateway.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
planIdpathstringtruenone

Example responses

404 Response

{
"status": "error",
"message": "Configuration validation failed",
"errors": [
{
"field": "spec.context",
"message": "Context must start with / and cannot end with /"
}
]
}

Responses​

StatusMeaningDescriptionSchema
204No ContentSubscription plan deletedNone
404Not FoundNot foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Create a subscription​

POST /subscriptions

Code samples


curl -X POST http://localhost:9090/api/management/v0.9/subscriptions \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Subscribe an application to a RestAPI in the Gateway.

Payload

{
"apiId": "c9f2b6ae-1234-5678-9abc-def012345678",
"subscriptionToken": "sub-token-abc123xyz",
"applicationId": "string",
"subscriptionPlanId": "string",
"billingCustomerId": "string",
"billingSubscriptionId": "string",
"status": "ACTIVE"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
bodybodySubscriptionCreateRequesttruenone

Example responses

201 Response

{
"id": "string",
"apiId": "string",
"applicationId": "string",
"subscriptionToken": "string",
"subscriptionPlanId": "string",
"billingCustomerId": "string",
"billingSubscriptionId": "string",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Responses​

StatusMeaningDescriptionSchema
201CreatedSubscription createdSubscriptionResponse
400Bad RequestBad requestErrorResponse
409ConflictConflict - subscription already existsErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

List subscriptions​

GET /subscriptions

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/subscriptions \
-u {username}:{password} \
-H 'Accept: application/json'

List subscriptions in the Gateway, optionally filtered by API, application, or status.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
apiIdquerystringfalseFilter by API ID (deployment ID or handle)
applicationIdquerystringfalsenone
statusquerystringfalsenone

Enumerated Values​

ParameterValue
statusACTIVE
statusINACTIVE
statusREVOKED

Example responses

200 Response

{
"subscriptions": [
{
"id": "string",
"apiId": "string",
"applicationId": "string",
"subscriptionToken": "string",
"subscriptionPlanId": "string",
"billingCustomerId": "string",
"billingSubscriptionId": "string",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
],
"count": 0
}

Responses​

StatusMeaningDescriptionSchema
200OKList of subscriptionsSubscriptionListResponse
500Internal Server ErrorInternal server errorErrorResponse

Get a subscription by ID​

GET /subscriptions/{subscriptionId}

Code samples


curl -X GET http://localhost:9090/api/management/v0.9/subscriptions/{subscriptionId} \
-u {username}:{password} \
-H 'Accept: application/json'

Get the details of a subscription by its ID.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
subscriptionIdpathstringtruenone

Example responses

200 Response

{
"id": "string",
"apiId": "string",
"applicationId": "string",
"subscriptionToken": "string",
"subscriptionPlanId": "string",
"billingCustomerId": "string",
"billingSubscriptionId": "string",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Responses​

StatusMeaningDescriptionSchema
200OKSubscription detailsSubscriptionResponse
404Not FoundSubscription not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Update a subscription​

PUT /subscriptions/{subscriptionId}

Code samples


curl -X PUT http://localhost:9090/api/management/v0.9/subscriptions/{subscriptionId} \
-u {username}:{password} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Update an existing subscription in the Gateway.

Payload

{
"status": "ACTIVE"
}

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
subscriptionIdpathstringtruenone
bodybodySubscriptionUpdateRequestfalsenone

Example responses

200 Response

{
"id": "string",
"apiId": "string",
"applicationId": "string",
"subscriptionToken": "string",
"subscriptionPlanId": "string",
"billingCustomerId": "string",
"billingSubscriptionId": "string",
"gatewayId": "string",
"status": "ACTIVE",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Responses​

StatusMeaningDescriptionSchema
200OKSubscription updatedSubscriptionResponse
404Not FoundSubscription not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Delete a subscription​

DELETE /subscriptions/{subscriptionId}

Code samples


curl -X DELETE http://localhost:9090/api/management/v0.9/subscriptions/{subscriptionId} \
-u {username}:{password} \
-H 'Accept: application/json'

Delete a subscription from the Gateway.

Authentication​

This operation requires Basic Auth authentication. Required roles: `admin`, `developer`

Parameters​

NameInTypeRequiredDescription
subscriptionIdpathstringtruenone

Example responses

404 Response

{
"status": "error",
"message": "Configuration validation failed",
"errors": [
{
"field": "spec.context",
"message": "Context must start with / and cannot end with /"
}
]
}

Responses​

StatusMeaningDescriptionSchema
204No ContentSubscription deletedNone
404Not FoundSubscription not foundErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Was this page helpful?