Manage the API keys of the organization the token was issued for, as well as the keys belonging to individual members. A key is issued its secret exactly once, at creation.
List the active API keys owned by the token’s organization. Secrets are never included.
| query OrganizationApiKeys($after: String, $before: String, $limit: Int, $order: PaginationOrder, $search: String) { | |
| organizationApiKeys(after: $after, before: $before, limit: $limit, order: $order, search: $search) { | |
| data { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| permissions | |
| updatedAt | |
| } | |
| listMetadata { | |
| after | |
| before | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "organizationApiKeys": { | |
| "data": [ | |
| { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "expiresAt": "2024-01-01T00:00:00.000Z", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "lastUsedAt": "2024-01-01T00:00:00.000Z", | |
| "name": "name_example", | |
| "obfuscatedValue": "obfuscatedValue_example", | |
| "permissions": [ | |
| "permissions_example" | |
| ], | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| ], | |
| "listMetadata": { | |
| "after": "after_example", | |
| "before": "before_example" | |
| } | |
| } | |
| } | |
| } |
organizationApiKeys
Parameters
after: String
before: String
limit: Int
Returns OrganizationApiKeyList!
Create an API key owned by the token’s organization. The plaintext secret is returned exactly once, in this response.
| mutation CreateOrganizationApiKey($input: CreateApiKeyInput!) { | |
| createOrganizationApiKey(input: $input) { | |
| __typename | |
| ... on ApiKeyPermissionsNotHeld { | |
| message | |
| unheldPermissions | |
| } | |
| ... on ApiKeyPermissionsUnsupportedForToken { | |
| message | |
| requestedPermissions | |
| } | |
| ... on InvalidApiKeyExpiration { | |
| message | |
| } | |
| ... on InvalidApiKeyName { | |
| message | |
| } | |
| ... on InvalidApiKeyPermissions { | |
| invalidPermissions | |
| message | |
| } | |
| ... on OrganizationApiKeyCreated { | |
| apiKey { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| permissions | |
| updatedAt | |
| } | |
| value | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "createOrganizationApiKey": { | |
| "__typename": "ApiKeyPermissionsNotHeld", | |
| "message": "message_example", | |
| "unheldPermissions": [ | |
| "unheldPermissions_example" | |
| ] | |
| } | |
| } | |
| } |
createOrganizationApiKey
Parameters CreateApiKeyInput!
Returns CreateOrganizationApiKeyResult!
Revoke an API key owned by the token’s organization by setting its expiration. The key and its audit trail are retained; use deleteOrganizationApiKey to remove it.
| mutation ExpireOrganizationApiKey($input: ExpireApiKeyInput!) { | |
| expireOrganizationApiKey(input: $input) { | |
| __typename | |
| ... on ApiKeyAlreadyExpired { | |
| apiKeyId | |
| } | |
| ... on OrganizationApiKeyExpired { | |
| apiKey { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| permissions | |
| updatedAt | |
| } | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "expireOrganizationApiKey": { | |
| "__typename": "ApiKeyAlreadyExpired", | |
| "apiKeyId": "apiKeyId_01EHWNCE74X7JSDV0X3SZ3KJNY" | |
| } | |
| } | |
| } |
expireOrganizationApiKey
Parameters ExpireApiKeyInput!
Returns ExpireOrganizationApiKeyResult!
Delete an API key owned by the token’s organization and return the deleted key. Unlike expiring, this removes the key entirely.
| mutation DeleteOrganizationApiKey($apiKeyId: ID!) { | |
| deleteOrganizationApiKey(apiKeyId: $apiKeyId) { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| permissions | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "deleteOrganizationApiKey": { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "expiresAt": "2024-01-01T00:00:00.000Z", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "lastUsedAt": "2024-01-01T00:00:00.000Z", | |
| "name": "name_example", | |
| "obfuscatedValue": "obfuscatedValue_example", | |
| "permissions": [ | |
| "permissions_example" | |
| ], | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| } | |
| } |
deleteOrganizationApiKey
Parameters
apiKeyId: ID!
Returns OrganizationApiKey!
createdAt: DateTime!
id: ID!
updatedAt: DateTime!
List the active user-scoped API keys in the token’s organization. Returns only the token user’s own keys unless the token holds the organization-wide user API key grant. Secrets are never included.
| query UserApiKeys($after: String, $before: String, $limit: Int, $order: PaginationOrder, $search: String) { | |
| userApiKeys(after: $after, before: $before, limit: $limit, order: $order, search: $search) { | |
| data { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| owner { | |
| displayName | |
| firstName | |
| id | |
| lastName | |
| } | |
| permissions | |
| updatedAt | |
| } | |
| listMetadata { | |
| after | |
| before | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "userApiKeys": { | |
| "data": [ | |
| { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "expiresAt": "2024-01-01T00:00:00.000Z", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "lastUsedAt": "2024-01-01T00:00:00.000Z", | |
| "name": "name_example", | |
| "obfuscatedValue": "obfuscatedValue_example", | |
| "owner": { | |
| "displayName": "displayName_example", | |
| "email": "email_example", | |
| "firstName": "firstName_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "lastName": "lastName_example" | |
| }, | |
| "permissions": [ | |
| "permissions_example" | |
| ], | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| ], | |
| "listMetadata": { | |
| "after": "after_example", | |
| "before": "before_example" | |
| } | |
| } | |
| } | |
| } |
userApiKeys
Parameters
after: String
before: String
limit: Int
Returns UserApiKeyList!
Create an API key owned by the token user within the organization the token was issued for. The plaintext secret is returned exactly once, in this response.
| mutation CreateUserApiKey($input: CreateApiKeyInput!) { | |
| createUserApiKey(input: $input) { | |
| __typename | |
| ... on ApiKeyPermissionsNotHeld { | |
| message | |
| unheldPermissions | |
| } | |
| ... on ApiKeyPermissionsUnsupportedForToken { | |
| message | |
| requestedPermissions | |
| } | |
| ... on InvalidApiKeyExpiration { | |
| message | |
| } | |
| ... on InvalidApiKeyName { | |
| message | |
| } | |
| ... on InvalidApiKeyPermissions { | |
| invalidPermissions | |
| message | |
| } | |
| ... on UserApiKeyCreated { | |
| apiKey { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| permissions | |
| updatedAt | |
| } | |
| value | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "createUserApiKey": { | |
| "__typename": "ApiKeyPermissionsNotHeld", | |
| "message": "message_example", | |
| "unheldPermissions": [ | |
| "unheldPermissions_example" | |
| ] | |
| } | |
| } | |
| } |
createUserApiKey
Parameters CreateApiKeyInput!
Returns CreateUserApiKeyResult!
Revoke a user-scoped API key by setting its expiration. The key and its audit trail are retained; use deleteUserApiKey to remove it.
| mutation ExpireUserApiKey($input: ExpireApiKeyInput!) { | |
| expireUserApiKey(input: $input) { | |
| __typename | |
| ... on ApiKeyAlreadyExpired { | |
| apiKeyId | |
| } | |
| ... on UserApiKeyExpired { | |
| apiKey { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| permissions | |
| updatedAt | |
| } | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "expireUserApiKey": { | |
| "__typename": "ApiKeyAlreadyExpired", | |
| "apiKeyId": "apiKeyId_01EHWNCE74X7JSDV0X3SZ3KJNY" | |
| } | |
| } | |
| } |
expireUserApiKey
Parameters ExpireApiKeyInput!
Returns ExpireUserApiKeyResult!
Delete a user-scoped API key and return the deleted key. Unlike expiring, this removes the key entirely.
| mutation DeleteUserApiKey($apiKeyId: ID!) { | |
| deleteUserApiKey(apiKeyId: $apiKeyId) { | |
| createdAt | |
| expiresAt | |
| id | |
| lastUsedAt | |
| name | |
| obfuscatedValue | |
| owner { | |
| displayName | |
| firstName | |
| id | |
| lastName | |
| } | |
| permissions | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "deleteUserApiKey": { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "expiresAt": "2024-01-01T00:00:00.000Z", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "lastUsedAt": "2024-01-01T00:00:00.000Z", | |
| "name": "name_example", | |
| "obfuscatedValue": "obfuscatedValue_example", | |
| "owner": { | |
| "displayName": "displayName_example", | |
| "email": "email_example", | |
| "firstName": "firstName_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "lastName": "lastName_example" | |
| }, | |
| "permissions": [ | |
| "permissions_example" | |
| ], | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| } | |
| } |