Grant an API key access to a workspace
POST/v1/account/api_keys/{id}/workspaces
Grants this API key access to the specified workspace. Idempotent — adding an already-associated workspace is a no-op. Returns the updated API key with refreshed workspace preview and total.
Grant an API key access to a workspace
curl https://api.cadenya.com/v1/account/api_keys/$ID/workspaces \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CADENYA_API_KEY" \
-d '{}'{
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"token": "token",
"description": "description",
"permissions": [
"string"
],
"system": true
},
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_UNSPECIFIED",
"email": "email",
"name": "name"
}
},
"workspacesPreview": [
{
"id": "id",
"name": "name"
}
],
"workspacesTotal": 0
}
}Returns Examples
{
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"token": "token",
"description": "description",
"permissions": [
"string"
],
"system": true
},
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_UNSPECIFIED",
"email": "email",
"name": "name"
}
},
"workspacesPreview": [
{
"id": "id",
"name": "name"
}
],
"workspacesTotal": 0
}
}