Update an existing API key’s name, roles, or team assignments. All fields must be provided (PUT semantics). The calling API key can only assign roles whose scopes are a subset of its own. An API key cannot edit itself, and the api_keys_manage role cannot be assigned via the API.
This endpoint requires a valid API key with the api_keys_manage role at either the account level or team level.
API key from your incident.io dashboard (Settings → API keys)
Unique identifier of the API key to update
"01FCNDV6P870EA6S7TK1DSYDG0"
Human-readable name for the API key
1 - 200"My test API key"
Account-level roles for the API key. These roles apply across the entire account, not scoped to specific teams. Pass an empty array if no account-level roles are needed.
viewer, incident_creator, incident_editor, manage_settings, global_access, catalog_viewer, catalog_editor, incident_memberships_editor, schedules_editor, schedules_reader, schedule_overrides_editor, workflows_editor, private_workflows_editor, on_call_editor, escalation_creator, post_incident_flow_opt_out, security_settings_editor, investigation_download, team_memberships_manage, status_page_publisher, postmortems_manage, api_keys_manage ["viewer", "incident_creator"]IDs of teams to scope the team_role_names to. If provided, team_role_names must also be a non-empty array, and vice versa. Pass an empty array if the key should not be scoped to any teams.
["01FCNDV6P870EA6S7TK1DSYDG0"]Roles to grant for the teams specified in team_ids. If provided, team_ids must also be a non-empty array, and vice versa. Pass an empty array if no team-level roles are needed.
schedules_editor, schedules_reader, schedule_overrides_editor, on_call_editor, escalation_creator, api_keys_manage ["schedules_editor"]OK response.
{
"created_at": "2021-08-17T13:28:57.801578Z",
"creator": {
"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"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "My test API key",
"roles": [
{
"description": "Can create incidents",
"name": "viewer"
}
],
"team_ids": ["01FCNDV6P870EA6S7TK1DSYDG0"],
"team_roles": [
{
"description": "Can read schedules",
"name": "schedules_editor"
}
],
"token_last_issued_at": "2021-08-17T13:28:57.801578Z"
}