A Clerk API mock for creating dashboard users.
Start with the seeded dashboard users and organizations. Your agent creates a user; check the POST request and retrieve the user’s email addresses and metadata afterwards.
user_createdCalls POST /v1/users
signed_insessions email erin.walsh@ridgeway-robotics.example; status active; count at least 1
admin_membermemberships organization ridgeway-robotics; email erin.walsh@ridgeway-robotics.example; role org:admin; count 1
Starting records
users
erin.walsh@ridgeway-robotics.example
users
hector.ruiz@ridgeway-robotics.example
users
bao.tran@ridgeway-robotics.example
users
helen.brooks@pinecrest-health.example
Connect your agent to the Clerk mock
When ancha runs your agent, it sets:
CLERK_API_URLCLERK_SECRET_KEYCLERK_PUBLISHABLE_KEYNEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_JWT_KEYCLERK_WEBHOOK_SIGNING_SECRETCLERK_FRONTEND_API_URLCLERK_PROXY_URLNEXT_PUBLIC_CLERK_PROXY_URL
Point the client you already use at them.
import { createClerkClient } from '@clerk/backend';
const clerk = createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY, apiUrl: process.env.CLERK_API_URL, publishableKey: process.env.CLERK_PUBLISHABLE_KEY, jwtKey: process.env.CLERK_JWT_KEY, proxyUrl: process.env.CLERK_PROXY_URL });
const { data: users } = await clerk.users.getUserList({ limit: 10 });Locally, ancha runs your agent as an ordinary process, so keep real Clerk credentials out of its environment.
See all 52 endpoints
fapi
/fapi/.well-known/jwks.json/fapi/v1/client/fapi/v1/client/fapi/v1/client/fapi/v1/client/sessions/{session_id}/end/fapi/v1/client/sessions/{session_id}/remove/fapi/v1/client/sessions/{session_id}/tokens/fapi/v1/client/sessions/{session_id}/touch/fapi/v1/client/sign_ins/fapi/v1/client/sign_ins/{sign_in_id}/attempt_first_factor/fapi/v1/client/sign_ins/{sign_in_id}/prepare_first_factor/fapi/v1/client/sign_ups/fapi/v1/client/sign_ups/{sign_up_id}/attempt_verification/fapi/v1/client/sign_ups/{sign_up_id}/prepare_verification/fapi/v1/environmentinvitations
/v1/invitations/v1/invitations/v1/invitations/{invitation_id}/revokejwks
/v1/jwksorganizations
/v1/organizations/v1/organizations/v1/organizations/{organization_id}/v1/organizations/{organization_id}/v1/organizations/{organization_id}/v1/organizations/{organization_id}/invitations/v1/organizations/{organization_id}/invitations/v1/organizations/{organization_id}/invitations/{invitation_id}/v1/organizations/{organization_id}/invitations/{invitation_id}/revoke/v1/organizations/{organization_id}/memberships/v1/organizations/{organization_id}/memberships/v1/organizations/{organization_id}/memberships/{user_id}/v1/organizations/{organization_id}/memberships/{user_id}/v1/organizations/{organization_id}/metadatasessions
/v1/sessions/v1/sessions/v1/sessions/{session_id}/v1/sessions/{session_id}/revoke/v1/sessions/{session_id}/tokens/v1/sessions/{session_id}/tokens/{template_name}testing_tokens
/v1/testing_tokensusers
/v1/users/v1/users/v1/users/{user_id}/v1/users/{user_id}/v1/users/{user_id}/v1/users/{user_id}/ban/v1/users/{user_id}/lock/v1/users/{user_id}/metadata/v1/users/{user_id}/organization_memberships/v1/users/{user_id}/unban/v1/users/{user_id}/unlock/v1/users/countSeed your own data
The data the Clerk mock starts with on every run, cut to a few records. ancha twins seed clerk prints every field.
Full seed YAML
twins:
- clerk
seed:
clerk:
instance:
name: Acme dashboard
users:
- email: erin.walsh@ridgeway-robotics.example
firstName: Erin
lastName: Walsh
created: -60h
lastSignIn: -2h
lastActive: -1h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: Director of Operations
privateMetadata:
hubspot_contact_id: "30001"
- email: hector.ruiz@ridgeway-robotics.example
firstName: Hector
lastName: Ruiz
created: -50h
lastSignIn: -26h
lastActive: -20h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: Warehouse Lead
privateMetadata: {}
- email: bao.tran@ridgeway-robotics.example
firstName: Bao
lastName: Tran
created: -48h
lastSignIn: -30h
lastActive: -30h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: Operations Analyst
privateMetadata: {}
- email: helen.brooks@pinecrest-health.example
firstName: Helen
lastName: Brooks
created: -27h
lastSignIn: -6h
lastActive: -5h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: IT Director
privateMetadata: {}
- email: omar.haddad@pinecrest-health.example
firstName: Omar
lastName: Haddad
created: -25h
lastSignIn: -8h
lastActive: -8h
hasPassword: true
banned: false
locked: false
publicMetadata: {}
privateMetadata: {}
- email: grace.liu@pinecrest-health.example
firstName: Grace
lastName: Liu
created: -25h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: Finance Analyst
privateMetadata: {}
- email: dale.whitfield@kestrel-cu.example
firstName: Dale
lastName: Whitfield
created: -6000h
lastSignIn: -26h
lastActive: -25h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: VP Member Services
privateMetadata: {}
- email: nina.alvarez@kestrel-cu.example
firstName: Nina
lastName: Alvarez
created: -5000h
lastSignIn: -200h
lastActive: -200h
hasPassword: true
banned: false
locked: true
publicMetadata: {}
privateMetadata: {}
- email: carla.diaz@summitfreight.example
firstName: Carla
lastName: Diaz
created: -400h
lastSignIn: -3h
lastActive: -3h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: Logistics Manager
privateMetadata: {}
- email: pete.novak@summitfreight.example
firstName: Pete
lastName: Novak
created: -390h
lastSignIn: -50h
lastActive: -48h
hasPassword: true
banned: false
locked: false
publicMetadata: {}
privateMetadata: {}
- email: ivan.petrov@helix-mfg.example
firstName: Ivan
lastName: Petrov
created: -7000h
lastSignIn: -960h
lastActive: -960h
hasPassword: true
banned: false
locked: false
publicMetadata:
title: Plant Systems Manager
privateMetadata: {}
- email: laura@acme.example
firstName: Laura
lastName: Kim
created: -5000h
lastSignIn: -6h
lastActive: -6h
hasPassword: true
banned: false
locked: false
publicMetadata:
staff: true
privateMetadata:
support_role: customer-success
organizations:
- name: Ridgeway Robotics
slug: ridgeway-robotics
created: -60h
maxMembers: 25
publicMetadata:
plan: pilot
pilot_ends: 2026-11-30
privateMetadata: {}
members:
- email: erin.walsh@ridgeway-robotics.example
role: org:admin
- email: hector.ruiz@ridgeway-robotics.example
role: org:member
- email: bao.tran@ridgeway-robotics.example
role: org:member
invitations:
- email: marcus.bell@ridgeway-robotics.example
role: org:member
status: pending
created: -20h
expiresInDays: 30
inviter: erin.walsh@ridgeway-robotics.example
- email: june.park@ridgeway-robotics.example
role: org:member
status: pending
created: -20h
expiresInDays: 30
inviter: erin.walsh@ridgeway-robotics.example
- email: luis.ortega@ridgeway-robotics.example
role: org:member
status: pending
created: -19h
expiresInDays: 30
inviter: hector.ruiz@ridgeway-robotics.example
- name: Pinecrest Health
slug: pinecrest-health
created: -27h
maxMembers: 120
publicMetadata:
plan: enterprise
seats: 120
contract_start: 2026-12-01
privateMetadata: {}
members:
- email: helen.brooks@pinecrest-health.example
role: org:admin
- email: omar.haddad@pinecrest-health.example
role: org:member
- email: grace.liu@pinecrest-health.example
role: org:member
invitations: []
- name: Kestrel Credit Union
slug: kestrel-credit-union
created: -6000h
maxMembers: 50
publicMetadata:
plan: business
renewal: 2026-11-07
privateMetadata: {}
members:
- email: dale.whitfield@kestrel-cu.example
role: org:admin
- email: nina.alvarez@kestrel-cu.example
role: org:member
invitations: []
- name: Summit Freight
slug: summit-freight
created: -400h
maxMembers: 40
publicMetadata:
plan: business
privateMetadata: {}
members:
- email: carla.diaz@summitfreight.example
role: org:admin
- email: pete.novak@summitfreight.example
role: org:member
invitations:
- email: yard.office@summitfreight.example
role: org:member
status: pending
created: -900h
expiresInDays: 30
inviter: carla.diaz@summitfreight.example
- name: Helix Manufacturing
slug: helix-manufacturing
created: -7000h
maxMembers: 30
publicMetadata:
plan: business
renewal: 2026-12-15
privateMetadata: {}
members:
- email: ivan.petrov@helix-mfg.example
role: org:admin
invitations: []
invitations:
- email: security@bluefield-logistics.example
status: pending
created: -8h
expiresInDays: 30
Check what your agent did
Checks YAML
checks:
- id: user_created
trace:
called: POST /v1/users
- id: signed_in
state:
clerk.sessions:
email: erin.walsh@ridgeway-robotics.example
status: active
count_gte: 1
- id: admin_member
state:
clerk.memberships:
organization: ridgeway-robotics
email: erin.walsh@ridgeway-robotics.example
role: org:admin
count: 1More identity tools
All 43 toolsClerk API mock FAQ
Does banning a Clerk user revoke their active sessions in the mock?
POST / sets banned to true and changes that user's active sessions to revoked. Read the user and its sessions again to verify both changes.
How are nested Clerk metadata updates applied during a test?
PATCH / merges public_metadata, private_metadata and unsafe_metadata into their existing values. Nested objects merge recursively, and a key with a null value is removed.
What can I check when an agent adds a user to a Clerk organization?
Ancha's POST / creates the membership and marks pending invitations for that user's email in that organization as accepted. Adding the same user again returns 422 already_a_member_in_organization.
Install the CLI and run your agent against the Clerk mock.
Ancha is not affiliated with Clerk.