Skip to content
Get started

Create

POST/projects/{projectId}/api-keys

Create an API key for a particular project

Path ParametersExpand Collapse
projectId: string
Body ParametersJSONExpand Collapse
maxConsumption: optional number

Optional spending cap (CU) for this key over the billing period: a value >= 0 to cap, or -1 for unlimited. Omit to inherit the default.

name: optional string

The API Key name

role: optional string

Project role: a built-in role (admin | editor | reader) or a custom inline ”;“-separated scope list (e.g. “assets.read;workflows.run”). Defaults to editor.

ReturnsExpand Collapse
id: string
authorId: string
createdAt: string
ownerType: "project" or "team"
One of the following:
"project"
"team"
secret: string
userId: string

The key’s member id (apiu_...), taken by the member routes; the api-keys routes take id.

ownerId: optional string
teamId: optional string

Create

curl https://api.cloud.scenario.com/v1/projects/$PROJECT_ID/api-keys \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
{
  "id": "id",
  "authorId": "authorId",
  "createdAt": "createdAt",
  "ownerType": "project",
  "secret": "secret",
  "userId": "userId",
  "ownerId": "ownerId",
  "teamId": "teamId"
}
Returns Examples
{
  "id": "id",
  "authorId": "authorId",
  "createdAt": "createdAt",
  "ownerType": "project",
  "secret": "secret",
  "userId": "userId",
  "ownerId": "ownerId",
  "teamId": "teamId"
}