Skip to main content
PUT
/
v1
/
api_keys
/
{id}
Update
curl --request PUT \
  --url https://api.incident.io/v1/api_keys/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My test API key",
  "role_names": [
    "viewer",
    "incident_creator"
  ],
  "team_ids": [
    "01FCNDV6P870EA6S7TK1DSYDG0"
  ],
  "team_role_names": [
    "schedules_editor"
  ]
}
'
{
  "api_key": {
    "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"
  }
}

Authorizations

Authorization
string
header
required

API key from your incident.io dashboard (Settings → API keys)

Path Parameters

id
string
required

Unique identifier of the API key to update

Example:

"01FCNDV6P870EA6S7TK1DSYDG0"

Body

application/json
name
string
required

Human-readable name for the API key

Required string length: 1 - 200
Example:

"My test API key"

role_names
enum<string>[]
required

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.

Available options:
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
Example:
["viewer", "incident_creator"]
team_ids
string[]
required

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.

Example:
["01FCNDV6P870EA6S7TK1DSYDG0"]
team_role_names
enum<string>[]
required

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.

Available options:
schedules_editor,
schedules_reader,
schedule_overrides_editor,
on_call_editor,
escalation_creator,
api_keys_manage
Example:
["schedules_editor"]

Response

200 - application/json

OK response.

api_key
object
required
Example:
{
"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"
}