ApiManagementV1WorkspacesWorkspaceidApplicationsAppidPortal

Create a portal session for an application

Creates a one-time code that can be exchanged for a portal session token. Optional metadata (max 10 string key-value pairs, no nested objects) is attached to all endpoints created during the session — useful for tracking which of your users created the endpoint.

POST
/management/v1/workspaces/{workspaceId}/applications/{appId}/portal
AuthorizationBearer <token>

Management token (nhm_...)

In: header

Path Parameters

appIdstring
role?string

Portal session role. admin: full CRUD on endpoints and subscriptions. editor: create/update endpoints and subscriptions, no delete. viewer: read-only access to endpoints, subscriptions, and deliveries.

Default"editor"
Value in"admin" | "editor" | "viewer"
expiresInMinutes?integer

Session lifetime in minutes (1-60, default 60)

Default60
Range1 <= value <= 60
metadata?object

Flat key-value metadata (max 10 keys, string values only). Automatically attached to endpoints created in this session. Use to identify which of your users created the endpoint (e.g. {"userId": "usr_123", "email": "[email protected]"}).

Propertiesproperties <= 10

Empty Object

Response Body

curl -X POST "https://loading/management/v1/workspaces/{workspaceId}/applications/string/portal" \  -H "Content-Type: application/json" \  -d '{}'
{
  "portalUrl": "string",
  "code": "string",
  "expiresAt": "2019-08-24T14:15:22Z"
}

{
  "error": {
    "code": "validation_error",
    "message": "expiresInSeconds must be between 60 and 86400 (24h)"
  }
}

{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid authorization header"
  }
}

{
  "error": {
    "code": "token_disabled",
    "message": "Management token is disabled"
  }
}

{
  "error": {
    "code": "not_found",
    "message": "Application not found"
  }
}