Create
client.projects.apiKeys.create(stringprojectID, APIKeyCreateParams { maxConsumption, name, role } body, RequestOptionsoptions?): APIKeyCreateResponse { id, authorId, createdAt, 5 more }
POST/projects/{projectId}/api-keys
Create
import Scenario from '@scenario-labs/sdk';
const client = new Scenario({
apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});
const apiKey = await client.projects.apiKeys.create('projectId');
console.log(apiKey.id);{
"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"
}