EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
Manage API Keys with the Platform API
List, inspect and delete GraphOS API keys programmatically
You can manage API keys with the Rover CLI or the GraphOS Platform API. This page documents Platform API operations for key lifecycle tasks.
For Rover commands, see the Rover api-key documentation.
List all API keys
To view all keys in your organization, use the apiKeys query:
query ApiKeys($organizationId: ID!) {
organization(id: $organizationId) {
apiKeys {
totalCount
nodes {
createdAt
expiresAt
id
keyName
resources {
resourceId
resourceType
}
token
}
}
}
}Include a request payload with the following properties, using your own values:
{
"organizationId": "test-organization-id"
}Example response payload:
{
"data": {
"organization": {
"apiKeys": {
"totalCount": 2,
"nodes": [
{
"createdAt": "2025-08-22T16:39:55.333903000Z",
"expiresAt": "2026-08-22T16:40:17.876252636Z",
"id": "00f8a1f8-53cb-47b9-b6f8-9a12d94d101f",
"keyName": "Subgraph Test Key 1",
"resources": [
{
"resourceId": "test-graph-id:staging:test-subgraph-name",
"resourceType": "SUBGRAPH"
},
{
"resourceId": "test-graph-id:staging:another-subgraph",
"resourceType": "SUBGRAPH"
}
]
},
{
"createdAt": "2025-08-26T17:40:17.992591000Z",
"expiresAt": "2026-08-26T17:40:17.876252636Z",
"id": "982e5fbf-bbe6-4efa-bf05-0ce9fd5110ab",
"keyName": "Subgraph Test Key 2",
"resources": [
{
"resourceId": "test-graph-id:prod:test-subgraph-name",
"resourceType": "SUBGRAPH"
}
]
}
]
}
}
}
}View a single API key's details
To view a single subgraph API key, use the apiKey query with the keyId of the key you want to view.
You can read keyId from the response when you first create the key or from the id field when you list all API keys.
query ApiKey($keyId: ID!, $organizationId: ID!) {
organization(id: $organizationId) {
apiKey(keyId: $keyId) {
createdAt
expiresAt
id
keyName
resources {
resourceId
resourceType
}
}
}
}Include a request payload with the following properties, using your own values:
{
"keyId": "982e5fbf-bbe6-4efa-bf05-0ce9fd5110ab",
"organizationId": "test-organization-id"
}Example response payload:
{
"data": {
"organization": {
"apiKey": {
"createdAt": "2025-08-26T17:40:17.992591000Z",
"expiresAt": "2026-08-26T17:40:17.876252636Z",
"id": "982e5fbf-bbe6-4efa-bf05-0ce9fd5110ab",
"keyName": "Subgraph test key",
"resources": [
{
"resourceId": "test-graph-id:prod:test-subgraph-name",
"resourceType": "SUBGRAPH"
}
]
}
}
}
}Delete an API key using the Platform API
To delete an API key, use the deleteKey mutation from the Platform API.
mutation DeleteKey($keyId: ID!, $organizationId: ID!) {
organization(id: $organizationId) {
deleteKey(keyId: $keyId)
}
}Include a request payload with the following properties, using your own values:
{
"keyId": "982e5fbf-bbe6-4efa-bf05-0ce9fd5110ab",
"organizationId": "test-organization-id"
}Example response payload for a successful deletion (returns the deleted keyId):
{
"data": {
"organization": {
"deleteKey": "982e5fbf-bbe6-4efa-bf05-0ce9fd5110ab"
}
}
}Store API keys
After you create an API key, store the token value in your secret manager of choice. You can't view an API key's value after you create it.
For an overview of all key types, see API Keys.