First-party app
Clerk

Clerk

Manage a Clerk instance — users, organizations, sessions, invitations and sign-in tokens — through the Backend API.

stable Security & IdentityDeveloper Tools

About

Clerk ships in the w6w first-party pack. It declares 30 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.clerk
Version
0.1.0
Author
w6w
Licence
MIT
Categories
Security & Identity · Developer Tools

Overview

Clerk is a user authentication and management platform, and this app drives its Backend API — the server-to-server surface, distinct from the Frontend API and client SDKs a Clerk-powered app itself embeds. It creates, looks up, updates, bans and deletes users; merges metadata onto a user without clobbering the rest; manages B2B organizations, their memberships and invitations; lists and revokes sessions; and mints or revokes the two ways a backend hands someone a live session without touching a password: application-wide invitations and one-time sign-in tokens.

The API is a single global host (api.clerk.com) shared by every Clerk instance — the credential, not the URL, says which instance a call reaches, unlike platforms that key an integration off a per-tenant subdomain. It is also a moving target on shape: as of API version 2026-05-12, PATCH /users/{id} and PATCH /organizations/{id} no longer accept metadata fields at all — those now live behind dedicated /metadata endpoints with explicit merge (PATCH) or replace (PUT) semantics — and roughly half of this app’s list endpoints answer a bare JSON array while the other half wrap the same data in { data, total_count }, with no way to tell which from the URL alone.

Deliberately out of scope: anything from the Frontend API (client-side sign-in/sign-up flows, that surface’s own session cookies), JWT template and OAuth application management, SAML/enterprise SSO configuration, SCIM directory sync, and billing — all instance configuration or Frontend-only concepts, not workflow-shaped operations on the four resources above.

Build with Clerk

Three routes to the same 30 actions. The Workflow tab is generated from Clerk's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Invite to application

invitation-create

Invite someone by email to sign up for this application.

List application invitations

invitation-list

List application invitations.

Revoke application invitation

invitation-revoke

Revoke a pending application invitation. Does not prevent the invitee from signing up on their own through the regular sign-up flow.

Create organization

organization-create

Create a new organization.

Delete organization

organization-delete

Permanently delete an organization, its memberships, and its invitations.

Get organization

organization-get

Retrieve a single organization by ID or slug.

Invite to organization

organization-invitation-create

Invite someone to an organization by email, sending them a join link.

List organization invitations

organization-invitation-list

List pending/accepted/revoked/expired invitations for an organization.

Revoke organization invitation

organization-invitation-revoke

Revoke a pending organization invitation so the link can no longer be used.

List organizations

organization-list

List organizations on this instance.

Add organization member

organization-membership-create

Add an existing user to an organization with a given role.

List organization members

organization-membership-list

List the members of an organization.

Remove organization member

organization-membership-remove

Remove a member from an organization. The user account itself is untouched.

List organization roles

organization-role-list

List the organization roles configured for this instance.

Update organization

organization-update

Update an organization's name or slug. Does not touch metadata — use "Update organization metadata" for that.

Update organization metadata

organization-update-metadata

Deep-merge public/private metadata onto an organization. Set a key to null to remove it.

Get session

session-get

Retrieve a single session by ID.

List sessions

session-list

List sessions for a given user or client. Old/inactive sessions are periodically cleaned up and will not appear here.

Revoke session

session-revoke

Revoke a session, signing the user out of that device.

Create sign-in token

sign-in-token-create

Mint a one-time sign-in token for a user, redeemable to start a session without a password.

Revoke sign-in token

sign-in-token-revoke

Revoke a pending sign-in token before it is redeemed.

Ban user

user-ban

Ban a user: revokes their active sessions and blocks further sign-in. Reversible.

Count users

user-count

Count users matching the given filters, without fetching the users themselves.

Create user

user-create

Create a new user with an email address and/or phone number.

Delete user

user-delete

Permanently delete a user. Frees their email/phone for a future signup. Prefer "Ban user" when the intent is to revoke access rather than erase the account.

Get user

user-get

Retrieve a single user by ID.

List users

user-list

List users, optionally filtered by email, phone, username, or a free-text query.

Unban user

user-unban

Remove the ban mark from a user, allowing them to sign in again.

Update user

user-update

Update a user's name, username, or password. Does not touch metadata — use "Update user metadata" for that.

Update user metadata

user-update-metadata

Deep-merge public/private/unsafe metadata onto a user. Set a key to null to remove it.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Clerk's real ids.

{
  "manifestVersion": "2",
  "name": "clerk-example",
  "steps": [
    {
      "id": "invitation-create",
      "uses": {
        "app": "io.w6w.clerk",
        "action": "invitation-create",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "emailAddress": "<emailAddress>"
      }
    }
  ]
}

Here are some of the things you can do

  • Invite to application

    perform
    invitation-create
  • List application invitations

    read
    invitation-list
  • Create organization

    perform
    organization-create
  • Get organization

    read
    organization-get
  • Invite to organization

    perform
    organization-invitation-create

+25 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Clerk, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Clerk. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "invitation-create",
  payload: {
    emailAddress: "<value>",
    // redirectUrl: "<value>",
    // ignoreExisting: "<value>",
    // expiresInDays: "<value>",
    // publicMetadata: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action invitation-create --payload '{"emailAddress":"<value>"}'

Give an AI agent Clerk — without giving it Clerk's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.clerk#invitation-create",
    "input": {
      "emailAddress": "<emailAddress>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Clerk connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Clerk's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Clerk itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Clerk declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Clerk platform status

Atlassian Statuspage rollup for status.clerk.com, with per-component detail. Unauthenticated and unsigned.

dependency

Instance reachability

Reads this connection's own Clerk instance and reports whether it is development or production — the two enforce different rate limits and validation.