Skip to content

Rotate all API keys

Request

OPA roles:
  • resource_admin

Rotates all API keys for a specified service user. This also sets an expiration date for the existing API keys.

Security
bearerAuth
Path
team_namestringrequired

The name of your team

user_namestringrequired

The username for an existing user

curl -i -X POST \
  'https://{org_name}.pam.okta.com/v1/teams/{team_name}/service_users/{user_name}/keys' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

OK

Bodyapplication/json
expires_atstring, (date-time)read-onlyrequired

A timestamp for when the API key expires

idstring, (regex)^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...read-onlyrequired

The UUID of the API key

issued_atstring, (date-time)read-onlyrequired

A timestamp for when the API key was issued

last_usedstring, (date-time)read-onlyrequired

A timestamp for when the API key was last used

secretstring, [ 1 .. 255 ] charactersread-onlyrequired

The secret associated with the API key and used to authenticate the service user. Don't share.

Response
{ "expires_at": "0001-01-01T00:00:00Z", "id": "ba7ffbe9-c8e4-45c9-bc07-45729711c952", "issued_at": "2020-04-07T00:00:00Z", "last_used": null, "secret": "NOvsvBg0g9mFXdHbLxEJcEFpu+LZjQSKsYezqMALq5WbGZTpUsxoS4vBqqHOO9O3xrhOq03B+oLf7bSTShbudw==" }