Create an API resource secret

View as Markdown
POST
/resources/api_resources/{api_id}/secrets

Creates a new secret credential for the API resource, used to authenticate the resource during token introspection.

ScaleX

Access to the API secret creation endpoint requires an active ScaleX subscription.

Authorization

API-Key
headerX-API-KEY<token>

MonoCloud APIs require authentication with an API key. Retrieve your key from the Tenant Settings section of the MonoCloud dashboard and include it in the request header as: X-API-Key: <your_api_key>

Path Parameters

api_id*string

The unique identifier of the API resource.

Request Body

application/json

The request payload used to create an API resource secret.

TypeScript Definitions

Use the request body type in TypeScript.

Create Secret Request: Represents a request to create a credential used by a client or API resource.

Response Headers

201

location?string

Returns the location header

Formaturi

Response Body

201

application/json

The API resource secret was created successfully

TypeScript Definitions

Use the response body type in TypeScript.

Secret Response: Represents a credential used by a client or API resource.

Errors

401Unauthorized

403Forbidden

curl -X POST "https://your-domain.us.monocloud.com/api/resources/api_resources/n8TniSuy4WN9ROJYNwir6/secrets" \  -H "X-API-KEY: <token>" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "description": null,  "expiration": null,  "type": "shared_secret",  "creation_time": 0,  "last_updated": 0,  "secret_value": "string"}
© 2026 MonoCloud. All rights reserved.