Skip to main content
Version: 2.x (Latest)

Protocols & Admin API

Added in @authorizerdev/authorizer-js for Authorizer 2.3.0-rc.9.

Protocol selection

The Authorizer client can talk to the server over two wire protocols. graphql is the default and is 100% backward compatible — existing code keeps working unchanged.

protocolTransportNotes
'graphql'POST /graphqlDefault.
'rest'Typed POST/GET /v1/... routesSame flat responses as GraphQL.

No gRPC in JS. Browsers cannot speak raw gRPC. Passing protocol: 'grpc' throws a clear error at construction time. Use the Go or Python SDKs for gRPC.

As of 2.3.0-rc.9 all public methods work over both protocols, and both return identical flat response shapes.

import { Authorizer } from '@authorizerdev/authorizer-js'

const authRef = new Authorizer({
authorizerURL: 'YOUR_AUTHORIZER_URL',
redirectURL: window.location.origin,
clientID: 'YOUR_CLIENT_ID',
protocol: 'rest', // 'graphql' (default) | 'rest'
})

await authRef.login({ email: 'user@example.com', password: 'Abc@123' })

OAuth endpoints (/oauth/token, /oauth/revoke) always use REST regardless of the selected protocol.

Admin client

The admin API is a separate client, AuthorizerAdmin, constructed with the admin secret (the value of --admin-secret). Admin auth is sent on every call as the x-authorizer-admin-secret header.

Keep the admin secret on the server side — never ship it to a browser bundle.

import { AuthorizerAdmin } from '@authorizerdev/authorizer-js'

const admin = new AuthorizerAdmin({
authorizerURL: 'https://your-instance.authorizer.dev',
adminSecret: 'YOUR_ADMIN_SECRET',
protocol: 'graphql', // 'graphql' (default) | 'rest'
})

// List users
const { data, errors } = await admin.users()
if (!errors?.length) {
data.users.forEach((u) => console.log(u.email))
}

Config

KeyDescription
authorizerURLBase URL of your Authorizer instance.
adminSecretValue of --admin-secret, sent as x-authorizer-admin-secret.
protocol'graphql' (default) or 'rest'. gRPC is not supported.

Admin methods

Each method declares which protocols support it. Calling a method on an unsupported protocol returns a clear error rather than emitting a 404.

⚠ Destructive: deleteUser, deleteWebhook, deleteEmailTemplate, fgaWriteModel (overwrites the model), fgaDeleteTuples, fgaReset (wipes all FGA data), deleteClient, rotateClientSecret (invalidates the old secret immediately), deleteTrustedIssuer, deleteOrganization, removeOrgMember, deleteOrgOIDCConnection, deleteOrgSAMLConnection, deleteSAMLServiceProvider, retireSAMLIDPKey, deleteScimEndpoint, rotateScimToken (invalidates the old token immediately), and deleteOrgDomain permanently change, remove, or invalidate data.

Pagination shape: the paginated list methods (users, verificationRequests, webhooks, webhookLogs, emailTemplates, auditLogs, clients, trustedIssuers, organizations, orgMembers, userOrganizations, listSAMLServiceProviders, orgDomains, …) take pagination fields (limit, page) directly on the params object — e.g. admin.webhooks({ limit: 10 }). There is no pagination wrapper. If you have older code written as admin.webhooks({ pagination: { limit: 10 } }), drop the wrapper.

Auth, session & meta

MethodDescriptionrestgql
adminLoginExchange the admin secret for a session.
adminLogoutEnd the admin session.
adminSessionGet the current admin session.
adminMetaServer metadata / feature flags.

Users & access

MethodDescriptionrestgql
usersList users (paginated).
userGet a single user.
updateUserUpdate a user.
deleteUserDelete a user.
verificationRequestsList pending verification requests.
revokeAccessRevoke a user's access.
enableAccessRe-enable a user's access.
inviteMembersInvite members by email.

Webhooks

MethodDescriptionrestgql
addWebhookCreate a webhook.
updateWebhookUpdate a webhook.
deleteWebhookDelete a webhook.
getWebhookGet a single webhook.
webhooksList webhooks.
webhookLogsList webhook delivery logs.
testEndpointSend a test event to a webhook.

Email templates

MethodDescriptionrestgql
addEmailTemplateCreate an email template.
updateEmailTemplateUpdate an email template.
deleteEmailTemplateDelete an email template.
emailTemplatesList email templates.

Audit

MethodDescriptionrestgql
auditLogsList audit logs.

FGA admin

MethodDescriptionrestgql
fgaGetModelGet the current FGA model.
fgaWriteModelWrite/overwrite the FGA model.
fgaWriteTuplesWrite relationship tuples.
fgaDeleteTuplesDelete relationship tuples.
fgaReadTuplesRead relationship tuples.
fgaListUsersList users with a relation to an object.
fgaExpandExpand a relation into its userset.
fgaResetReset all FGA data.

OAuth clients (service accounts / M2M)

Registered OAuth clients used by the client_credentials and RFC 8693 token-exchange grants (see getToken). client_secret is returned exactly once, at creation and at rotation, and is never projected back afterwards.

MethodDescriptionrestgql
createClientRegister a new OAuth client / service account.
updateClientUpdate a client's name, description, scopes, or active state.
deleteClientDelete a client.
rotateClientSecretMint a fresh secret; the old one stops working immediately.
clientGet a single client by id (never includes the secret).
clientsList clients (paginated).

Trusted issuers (secretless client authentication)

External token issuers trusted to authenticate a service account via RFC 7523 client_assertion (Kubernetes SA tokens, SPIFFE JWT-SVIDs, cloud OIDC tokens) instead of a shared secret.

MethodDescriptionrestgql
addTrustedIssuerRegister a trusted issuer for a service account.
updateTrustedIssuerUpdate an existing trusted issuer.
deleteTrustedIssuerDelete a trusted issuer; its tokens stop authenticating immediately.
trustedIssuerGet a single trusted issuer by id.
trustedIssuersList trusted issuers, optionally filtered by service account (paginated).

Organizations

Tenant grouping of users. Organizations, their SSO connections, SCIM endpoints, and verified domains gained REST routes in server 2.4.0; on older servers these are GraphQL only.

MethodDescriptionrestgql
createOrganizationCreate a new organization.
updateOrganizationUpdate an existing organization.
deleteOrganizationDelete an organization.
organizationGet a single organization by id.
organizationsList organizations (paginated).
addOrgMemberAdd a user to an organization with optional per-org roles.
removeOrgMemberRemove a user from an organization.
orgMembersList an organization's members (paginated).
userOrganizationsList the organizations a user belongs to, with roles per org (paginated).

Org SSO connections

Per-organization upstream identity providers. createOrgOIDCConnection brokers Authorizer as an OIDC Relying Party; createOrgSAMLConnection brokers Authorizer as a SAML 2.0 Service Provider. Upstream secrets/certificates are accepted on write but never projected back.

MethodDescriptionrestgql
createOrgOIDCConnectionCreate a per-org upstream OIDC connection.
updateOrgOIDCConnectionUpdate a per-org upstream OIDC connection.
deleteOrgOIDCConnectionDelete a per-org upstream OIDC connection; SSO stops immediately.
orgOIDCConnectionGet a connection by id OR by org_id (supply exactly one).
createOrgSAMLConnectionCreate a per-org upstream SAML connection.
updateOrgSAMLConnectionUpdate a per-org upstream SAML connection.
deleteOrgSAMLConnectionDelete a per-org upstream SAML connection; SSO stops immediately.
orgSAMLConnectionGet a connection by id OR by org_id (supply exactly one).

SAML IdP (Authorizer as Identity Provider)

The inverse of the org SAML connection above: downstream Service Providers that Authorizer issues signed SAML assertions to, plus the per-org IdP signing keypairs used to sign them.

MethodDescriptionrestgql
createSAMLServiceProviderRegister a downstream SP.
updateSAMLServiceProviderUpdate a downstream SP's name, endpoints, certificate, mapping, or state.
deleteSAMLServiceProviderDelete a downstream SP; SSO for that SP stops immediately.
samlServiceProviderGet a single downstream SP by id.
listSAMLServiceProvidersList downstream SPs for an org (paginated).
rotateSAMLIDPCertGenerate a new current signing keypair for an org's SAML IdP.
retireSAMLIDPKeyRetire a published-but-superseded key (cannot retire the current key).
listSAMLIDPKeysList all SAML IdP signing keys for an org (unpaginated).
importSAMLSPMetadataParse pasted SP metadata XML into entity_id/acs_url/certificate (does not create a record).

SCIM endpoints

Per-org inbound SCIM 2.0 provisioning credential. The bearer token is returned exactly once, at creation and at rotation, and is never projected back afterwards.

MethodDescriptionrestgql
createScimEndpointProvision the org's inbound SCIM endpoint.
rotateScimTokenMint a fresh bearer token; the old one stops working immediately.
deleteScimEndpointRemove the org's SCIM endpoint; inbound provisioning stops immediately.
scimEndpointGet the org's SCIM endpoint (never includes the token).

Org verified domains

Verified DNS-domain-to-organization mappings used for home-realm discovery.

MethodDescriptionrestgql
requestOrgDomainStart domain verification, returning the DNS TXT challenge to publish.
verifyOrgDomainCheck the published DNS challenge and record the verified domain.
addVerifiedOrgDomainRecord a verified domain without a DNS challenge (super-admin only).
deleteOrgDomainRemove a verified domain; home-realm discovery for it stops immediately.
orgDomainsList an organization's verified domains (paginated).

GraphQL-only extras

These have no REST equivalent and work over GraphQL only:

MethodDescription
adminSignupBootstrap the first admin.
updateEnvDeprecated server-side — v2 configures everything via CLI flags; the resolver always errors.
generateJWTKeysGenerate a new JWT signing key pair.