data
Okta CLI for AI Agents
Use the Okta CLI from KosmoKrator to call Okta tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Okta CLI Setup
Okta can be configured headlessly with `kosmokrator integrations:configure okta`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure okta --set api_token="$OKTA_API_TOKEN" --set domain="$OKTA_DOMAIN" --enable --read allow --write ask --json
kosmokrator integrations:doctor okta --json
kosmokrator integrations:status --json Credentials
Authentication type: API token api_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_token | OKTA_API_TOKEN | Secret secret | yes | API Token |
domain | OKTA_DOMAIN | Text string | yes | Okta Domain |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call okta.okta_list_users '{"limit":1,"q":"example_q"}' --json kosmo integrations:okta okta_list_users '{"limit":1,"q":"example_q"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs okta --json
kosmo integrations:docs okta.okta_list_users --json
kosmo integrations:schema okta.okta_list_users --json
kosmo integrations:search "Okta" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
okta.okta_list_users
List users in the Okta organization. Returns user profiles with IDs, names, emails, and status. Supports search filtering by name or email.
read - Parameters
- limit, q
kosmo integrations:call okta.okta_list_users '{"limit":1,"q":"example_q"}' --json kosmo integrations:okta okta_list_users '{"limit":1,"q":"example_q"}' --json okta.okta_get_user
Get details for a specific Okta user by ID or login email. Returns the full user profile including status, group memberships, and assigned applications.
read - Parameters
- id
kosmo integrations:call okta.okta_get_user '{"id":"example_id"}' --json kosmo integrations:okta okta_get_user '{"id":"example_id"}' --json okta.okta_get_current_user
Get the profile of the currently authenticated Okta API token owner. Useful for verifying the integration connection and identifying which service account is in use.
read - Parameters
- none
kosmo integrations:call okta.okta_get_current_user '{}' --json kosmo integrations:okta okta_get_current_user '{}' --json okta.okta_create_user
Create a new user in Okta. Requires a profile with at least firstName, lastName, email, and login. Optionally provide credentials (password) and control activation.
write - Parameters
- profile, credentials, activate
kosmo integrations:call okta.okta_create_user '{"profile":"example_profile","credentials":"example_credentials","activate":true}' --json kosmo integrations:okta okta_create_user '{"profile":"example_profile","credentials":"example_credentials","activate":true}' --json okta.okta_update_user
Update an existing Okta user profile. Provide only the profile fields you want to change — other fields remain unchanged.
write - Parameters
- id, profile, credentials
kosmo integrations:call okta.okta_update_user '{"id":"example_id","profile":"example_profile","credentials":"example_credentials"}' --json kosmo integrations:okta okta_update_user '{"id":"example_id","profile":"example_profile","credentials":"example_credentials"}' --json okta.okta_deactivate_user
Deactivate an Okta user. The user will be unable to sign in but their data is retained. This action can be reversed by reactivating the user in the Okta admin console.
write - Parameters
- id
kosmo integrations:call okta.okta_deactivate_user '{"id":"example_id"}' --json kosmo integrations:okta okta_deactivate_user '{"id":"example_id"}' --json okta.okta_list_groups
List groups in the Okta organization. Returns group names and IDs. Supports search filtering by group name.
read - Parameters
- q
kosmo integrations:call okta.okta_list_groups '{"q":"example_q"}' --json kosmo integrations:okta okta_list_groups '{"q":"example_q"}' --json okta.okta_get_group
Get details for a specific Okta group by ID. Returns the group name, description, and type.
read - Parameters
- id
kosmo integrations:call okta.okta_get_group '{"id":"example_id"}' --json kosmo integrations:okta okta_get_group '{"id":"example_id"}' --json okta.okta_add_user_to_group
Add a user to an Okta group. The user will inherit the group's assigned applications and permissions.
write - Parameters
- groupId, userId
kosmo integrations:call okta.okta_add_user_to_group '{"groupId":"example_groupId","userId":"example_userId"}' --json kosmo integrations:okta okta_add_user_to_group '{"groupId":"example_groupId","userId":"example_userId"}' --json okta.okta_list_applications
List applications in the Okta organization. Returns application names, IDs, statuses, and types.
read - Parameters
- none
kosmo integrations:call okta.okta_list_applications '{}' --json kosmo integrations:okta okta_list_applications '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
okta.okta_list_users 2 parameters
kosmo integrations:schema okta.okta_list_users --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of users to return (1–200, default: 200). |
q | string | no | Search query to filter users by first name, last name, or email. |
okta.okta_get_user 1 parameters
kosmo integrations:schema okta.okta_get_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Okta user ID or login email address. |
okta.okta_get_current_user 0 parameters
kosmo integrations:schema okta.okta_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
okta.okta_create_user 3 parameters
kosmo integrations:schema okta.okta_create_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
profile | object | yes | User profile object. Required fields: firstName, lastName, email, login. Optional: mobilePhone, secondEmail, title, department, organization, etc. |
credentials | object | no | User credentials. Example: {"password": {"value": "TempPass123!"}}. Omit to let Okta send an activation email. |
activate | boolean | no | Whether to activate the user immediately (default: true). If false, the user is created in STAGED status. |
okta.okta_update_user 3 parameters
kosmo integrations:schema okta.okta_update_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Okta user ID or login email to update. |
profile | object | yes | Updated profile fields. Only include fields you want to change (e.g., firstName, lastName, email, title, department, etc.). |
credentials | object | no | Updated credentials (e.g., new password). Optional. |
okta.okta_deactivate_user 1 parameters
kosmo integrations:schema okta.okta_deactivate_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Okta user ID or login email to deactivate. |
okta.okta_list_groups 1 parameters
kosmo integrations:schema okta.okta_list_groups --json | Parameter | Type | Required | Description |
|---|---|---|---|
q | string | no | Search query to filter groups by name. |
okta.okta_get_group 1 parameters
kosmo integrations:schema okta.okta_get_group --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Okta group ID. |
okta.okta_add_user_to_group 2 parameters
kosmo integrations:schema okta.okta_add_user_to_group --json | Parameter | Type | Required | Description |
|---|---|---|---|
groupId | string | yes | The Okta group ID. |
userId | string | yes | The Okta user ID. |
okta.okta_list_applications 0 parameters
kosmo integrations:schema okta.okta_list_applications --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.