curl -X POST 'https://api.example.com/api-keys' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "CI Pipeline",
"description": "Used for automated deployments",
"tenantId": "tenant_acme",
"environmentId": "environment_prod",
"expiresAt": "2025-01-15T10:30:00Z",
"intendedUse": "ci-cd"
}'
{
"id": "apk_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"subjectId": "subject_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5c",
"tenantId": "tenant_acme",
"environmentId": "environment_prod",
"name": "CI Pipeline",
"description": "Used for automated deployments",
"prefix": "qs_live_xxxx",
"lastFour": "a1b2",
"secretKey": "qs_live_xxxx1234567890abcdefghijklmnopqrstuvwxyz",
"hashAlgo": "argon2id",
"createdBySubjectId": "subject_jane",
"createdAt": "2024-01-15T10:30:00Z",
"expiresAt": "2025-01-15T10:30:00Z",
"status": "active",
"intendedUse": "ci-cd"
}
Create a new API key
curl -X POST 'https://api.example.com/api-keys' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "CI Pipeline",
"description": "Used for automated deployments",
"tenantId": "tenant_acme",
"environmentId": "environment_prod",
"expiresAt": "2025-01-15T10:30:00Z",
"intendedUse": "ci-cd"
}'
{
"id": "apk_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"subjectId": "subject_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5c",
"tenantId": "tenant_acme",
"environmentId": "environment_prod",
"name": "CI Pipeline",
"description": "Used for automated deployments",
"prefix": "qs_live_xxxx",
"lastFour": "a1b2",
"secretKey": "qs_live_xxxx1234567890abcdefghijklmnopqrstuvwxyz",
"hashAlgo": "argon2id",
"createdBySubjectId": "subject_jane",
"createdAt": "2024-01-15T10:30:00Z",
"expiresAt": "2025-01-15T10:30:00Z",
"status": "active",
"intendedUse": "ci-cd"
}
curl -X POST 'https://api.example.com/api-keys' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "CI Pipeline",
"description": "Used for automated deployments",
"tenantId": "tenant_acme",
"environmentId": "environment_prod",
"expiresAt": "2025-01-15T10:30:00Z",
"intendedUse": "ci-cd"
}'
{
"id": "apk_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"subjectId": "subject_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5c",
"tenantId": "tenant_acme",
"environmentId": "environment_prod",
"name": "CI Pipeline",
"description": "Used for automated deployments",
"prefix": "qs_live_xxxx",
"lastFour": "a1b2",
"secretKey": "qs_live_xxxx1234567890abcdefghijklmnopqrstuvwxyz",
"hashAlgo": "argon2id",
"createdBySubjectId": "subject_jane",
"createdAt": "2024-01-15T10:30:00Z",
"expiresAt": "2025-01-15T10:30:00Z",
"status": "active",
"intendedUse": "ci-cd"
}
service. This subject can be used for permission checks and role assignments.Was this page helpful?