Skip to content

Create a service user

Request

OPA roles:
  • resource_admin

Creates a service user that can be used to automate interactions with the Okta Privileged Access API

Security
bearerAuth
Path
team_namestringrequired

The name of your team

Bodyapplication/jsonrequired
namestring, (regex), [ 1 .. 255 ] charactersrequired

The name of the service user

curl -i -X POST \
  'https://{org_name}.pam.okta.com/v1/teams/{team_name}/service_users' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "OPA User"
  }'

Responses

Created

Bodyapplication/json
deleted_atstring or null, (date-time)read-onlyrequired

A timestamp indicating when the user was deleted

detailsobject or nullrequired

The details of the user synced from Okta

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

The UUID of the user

namestring, [ 1 .. 255 ] charactersrequired

The username for the user

oauth_client_application_idstring or null, [ 1 .. 255 ] charactersread-only

If defined, indicates the OAuth client application ID tied to a service user. Only available when the user was created as part of an OAuth approval flow.

role_grantsArray of stringsread-only

The permission roles available to the user

statusstringrequired

The status of the user: ACTIVE, DISABLED, or DELETED. Users can't disable or delete their own account.

team_namestringread-onlyrequired

The name of the team

user_typestring, [ 1 .. 255 ] charactersread-onlyrequired

The type of user. Possible values: service or human.

Response
{ "deleted_at": null, "details": null, "id": "aa225c16-af6e-4ab4-9150-456fd472e2d7", "name": "OPA User", "status": "ACTIVE", "team_name": "william-faulkner", "user_type": "service" }