An Okta API mock for testing user activation.

Start Victor’s seeded account in STAGED status and ask your agent to activate it. A user check reads the account’s final status and expects ACTIVE.

Connect your agent
The test
  • victor_active

    user victor@acme.example; status ACTIVE

Starting records

  • users

    login
    victor@acme.example
    status
    STAGED
    title
    Data Engineer
  • users

    login
    ancha@acme.example
    title
    Automation service account
  • users

    login
    mike@acme.example
    title
    VP of Customer Operations
  • users

    login
    rachel@acme.example
    title
    Site Reliability Engineer

Connect your agent to the Okta mock

When ancha runs your agent, it sets:

  • OKTA_ORG_URL
  • OKTA_API_TOKEN

Point the client you already use at them.

import okta from '@okta/okta-sdk-nodejs';
const client = new okta.Client({ orgUrl: process.env.OKTA_ORG_URL, token: process.env.OKTA_API_TOKEN });
for await (const user of await client.userApi.listUsers()) console.log(user?.profile?.login);

Locally, ancha runs your agent as an ordinary process, so keep real Okta credentials out of its environment.

See all 31 endpoints

apps

GET/api/v1/apps
GET/api/v1/apps/{appId}
GET/api/v1/apps/{appId}/groups
PUT/api/v1/apps/{appId}/groups/{groupId}
DELETE/api/v1/apps/{appId}/groups/{groupId}
GET/api/v1/apps/{appId}/users
POST/api/v1/apps/{appId}/users
DELETE/api/v1/apps/{appId}/users/{userId}

groups

GET/api/v1/groups
POST/api/v1/groups
GET/api/v1/groups/{groupId}
PUT/api/v1/groups/{groupId}
DELETE/api/v1/groups/{groupId}
GET/api/v1/groups/{groupId}/users
PUT/api/v1/groups/{groupId}/users/{userId}
DELETE/api/v1/groups/{groupId}/users/{userId}

logs

GET/api/v1/logs

users

GET/api/v1/users
POST/api/v1/users
GET/api/v1/users/{id}
POST/api/v1/users/{id}
DELETE/api/v1/users/{id}
GET/api/v1/users/{id}/appLinks
GET/api/v1/users/{id}/groups
POST/api/v1/users/{id}/lifecycle/activate
POST/api/v1/users/{id}/lifecycle/deactivate
POST/api/v1/users/{id}/lifecycle/reset_password
POST/api/v1/users/{id}/lifecycle/suspend
POST/api/v1/users/{id}/lifecycle/unlock
POST/api/v1/users/{id}/lifecycle/unsuspend
DELETE/api/v1/users/{id}/sessions

Seed your own data

The data the Okta mock starts with on every run, cut to a few records. ancha twins seed okta prints every field.

Full seed YAML
twins:
  - okta
seed:
  okta:
    org:
      subdomain: acme
      name: Acme
    admin: ancha@acme.example
    users:
      - login: ancha@acme.example
        firstName: Ancha
        lastName: Assistant
        created: -1500h
        lastLogin: -1h
        title: Automation service account
        department: IT
      - login: mike@acme.example
        firstName: Mike
        lastName: Turner
        created: -9000h
        lastLogin: -3h
        title: VP of Customer Operations
        department: Leadership
        employeeNumber: "1004"
      - login: rachel@acme.example
        firstName: Rachel
        lastName: Moore
        created: -6000h
        lastLogin: -2h
        title: Site Reliability Engineer
        department: Engineering
        employeeNumber: "1012"
      - login: victor@acme.example
        firstName: Victor
        lastName: Lane
        status: STAGED
        created: -26h
        title: Data Engineer
        department: Data Platform
        employeeNumber: "1031"
    groups:
      - name: On-call
        description: Primary and secondary on-call rotation
        created: -5000h
        members:
          - rachel@acme.example
    apps:
      - name: slack
        label: Slack
        created: -8800h
        groups:
          - Everyone
    events:
      - type: user.lifecycle.deactivate
        at: -300h
        actor: mike@acme.example
        message: Deactivate Okta user

Check what your agent did

Checks YAML
checks:
  - id: victor_active
    state:
      okta.user: victor@acme.example
      status: ACTIVE

More identity tools

All 43 tools

Okta API mock FAQ

What status should I expect after activating an Okta user?

In Ancha’s Okta mock, POST /api/v1/users/{id}/lifecycle/activate accepts a STAGED or DEPROVISIONED user. The user becomes ACTIVE if they have a password, or PROVISIONED otherwise.

How can I verify that an offboarding agent suspended an Okta user?

For an ACTIVE user, the mock’s /api/v1/users/{id}/lifecycle/suspend changes status to SUSPENDED. It updates statusChanged and records a user.lifecycle.suspend System Log event.

Is adding the same user to an Okta group twice safe to retry?

For an OKTA_GROUP, repeating PUT /api/v1/groups/{groupId}/users/{userId} in the mock returns 204 and keeps one membership. The group.user_membership.add event is created on the first addition.

Install the CLI and run your agent against the Okta mock.

Book a demo

Ancha is not affiliated with Okta.