API endpoints for api keys
Rotate endpoint.Show, List, Create, Update, and Delete endpoints to automate API key lifecycle management.api_keys_manage role granted at either the account level or for specific teams.
In addition, the following rules apply, when a “caller” API key is managing a “target” API key:
viewer and incident_creator can assign those roles to a target key, but cannot assign the incident_editor role, since it has additional scopes.schedules_editor at the account level can create a target key with that role for a specific team, but a key with schedules_editor only for one team (Team A, say) cannot assign it at the account level or for another team, Team B.api_keys_manage role cannot be assigned via the API. To create a key with that role, you must go to Settings → API keys in the dashboard, and click “Add new”, creating a key with the “View, create, edit, delete or rotate API keys” role (api_keys_manage).Delete endpoint does not check whether the calling API key holds the scopes of the key being deleted. However, a team-scoped key can only delete keys belonging to its teams.role_names, team_ids, and team_role_names, go to Settings → API keys in the dashboard. Click to either edit an existing key or create a new one, select the desired roles and teams, and then use the copy button to get hold of the role and team identifiers as JSON.
When the API key was created
"2021-08-17T13:28:57.801578Z"
{
"api_key": {
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "My test API key"
},
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "viewer",
"slack_user_id": "U02AYNF2XJM"
}
}Unique identifier for this API key
"01FCNDV6P870EA6S7TK1DSYDG0"
The name of the API key, for the user's reference
"My test API key"
The account-level roles assigned to this API key
[
{
"description": "can view data, like public incidents and organization settings",
"name": "viewer"
}
]IDs of teams that this API key is scoped to
["abc123"]The team-level roles assigned to this API key
[
{
"description": "can view data, like public incidents and organization settings",
"name": "schedules_editor"
}
]When the current token for this API was last issued. This is the last time the token was rotated, or when it was initially created. Older tokens may remain valid for up to an hour after they have been rotated, configured when you call the rotate endpoint.
"2021-08-17T13:28:57.801578Z"
When the key was last used to authenticate a request
"2021-08-17T13:28:57.801578Z"