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

Protocols & Admin API

Added in authorizer-py for Authorizer 2.3.0-rc.9.

Protocol selection​

Both the sync (AuthorizerClient) and async (AsyncAuthorizerClient) user clients can talk to the server over three wire protocols. graphql is the default and is 100% backward compatible — existing code keeps working unchanged.

protocol=TransportNotes
"graphql"POST /graphqlDefault.
"rest"Typed POST/GET /v1/... routesSame flat responses as GraphQL.
"grpc"Generated gRPC stubUses a separate endpoint (default :9091).

As of 2.3.0-rc.9 all public methods work over every protocol, and all three return identical flat response shapes.

from authorizer import AuthorizerClient, LoginRequest

# REST
client = AuthorizerClient(
client_id="YOUR_CLIENT_ID",
authorizer_url="https://your-instance.authorizer.dev",
protocol="rest",
)
token = client.login(LoginRequest(email="user@example.com", password="Abc@123"))

gRPC​

gRPC requires the optional extra:

pip install 'authorizer-py[grpc]'

It listens on its own port, separate from the HTTP URL. When grpc_endpoint is omitted, the target is derived from authorizer_url's host with the default gRPC port 9091.

client = AuthorizerClient(
client_id="YOUR_CLIENT_ID",
authorizer_url="https://your-instance.authorizer.dev",
protocol="grpc",
grpc_endpoint="your-instance.authorizer.dev:9091", # optional
)

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

Admin client​

The admin API is a separate client constructed with the admin secret (the value of --admin-secret) — AuthorizerAdminClient (sync) and AsyncAuthorizerAdminClient (async). Admin auth is sent on every call as the x-authorizer-admin-secret header (gRPC: metadata key x-authorizer-admin-secret).

from authorizer import AuthorizerAdminClient

admin = AuthorizerAdminClient(
authorizer_url="https://your-instance.authorizer.dev",
admin_secret="YOUR_ADMIN_SECRET",
)

# List users
res = admin.users()
for u in res.users:
print(u.email)

admin.close()

The async client mirrors the sync one method-for-method; await the calls and use async with / await admin.aclose().

Constructor options​

AuthorizerAdminClient(
authorizer_url: str,
admin_secret: str,
extra_headers: dict[str, str] | None = None,
protocol: str = "graphql",
grpc_endpoint: str = "",
)
ParameterDescriptionRequired
authorizer_urlBase URL of your Authorizer instance, no trailing slash.yes
admin_secretValue of --admin-secret.yes
extra_headersExtra headers sent on every admin request.no
protocol"graphql" (default), "rest", or "grpc".no
grpc_endpointgRPC target (default: URL host + :9091).no

Admin methods​

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

⚠ Destructive: delete_user, delete_webhook, delete_email_template, fga_write_model (overwrites the model), fga_delete_tuples, fga_reset (wipes all FGA data), delete_client, rotate_client_secret/rotate_scim_token (invalidate the old secret/token), delete_trusted_issuer, delete_organization, delete_org_oidc_connection/delete_org_saml_connection, delete_saml_service_provider, retire_saml_idp_key, delete_org_domain, and delete_scim_endpoint permanently change or remove data — see each method's note below.

Auth, session & meta​

MethodDescriptiongrpcrestgql
admin_loginExchange the admin secret for a session.✓✓✓
admin_logoutEnd the admin session.✓✓✓
admin_sessionGet the current admin session.✓✓✓
admin_metaServer metadata / feature flags.✓✓✓

Users & access​

MethodDescriptiongrpcrestgql
usersList users (paginated).✓✓✓
userGet a single user.✓✓✓
update_userUpdate a user.✓✓✓
delete_userDelete a user.✓✓✓
verification_requestsList pending verification requests.✓✓✓
revoke_accessRevoke a user's access.✓✓✓
enable_accessRe-enable a user's access.✓✓✓
invite_membersInvite members by email.✓✓✓

Webhooks​

MethodDescriptiongrpcrestgql
add_webhookCreate a webhook.✓✓✓
update_webhookUpdate a webhook.✓✓✓
delete_webhookDelete a webhook.✓✓✓
get_webhookGet a single webhook.✓✓✓
webhooksList webhooks.✓✓✓
webhook_logsList webhook delivery logs.✓✓✓
test_endpointSend a test event to a webhook.✓✓✓

Email templates​

MethodDescriptiongrpcrestgql
add_email_templateCreate an email template.✓✓✓
update_email_templateUpdate an email template.✓✓✓
delete_email_templateDelete an email template.✓✓✓
email_templatesList email templates.✓✓✓

Audit​

MethodDescriptiongrpcrestgql
audit_logsList audit logs.✓✓✓

FGA admin​

MethodDescriptiongrpcrestgql
fga_get_modelGet the current FGA model.✓✓✓
fga_write_modelWrite/overwrite the FGA model.✓✓✓
fga_write_tuplesWrite relationship tuples.✓✓✓
fga_delete_tuplesDelete relationship tuples.✓✓✓
fga_read_tuplesRead relationship tuples.✓✓✓
fga_list_usersList users with a relation to an object.✓✓✓
fga_expandExpand a relation into its userset.✓✓✓
fga_resetReset all FGA data.✓✓✓

Clients (service accounts / machine identities)​

Clients created here authenticate over /oauth/token with the client_credentials and token-exchange grants — see Machine-to-machine & agent delegation.

MethodDescriptiongrpcrestgql
create_clientCreate a client. client_secret is shown once.✓✓✓
update_clientUpdate a client.✓✓✓
delete_clientDelete a client — its tokens stop resolving.✓✓✓
rotate_client_secretRotate a client's secret (old one invalidated, new one shown once).✓✓✓
get_clientGet a single client.✓✓✓
clientsList clients (paginated).✓✓✓

Trusted issuers​

External OIDC/JWT issuers Authorizer accepts tokens from (e.g. for federated machine/agent identities).

MethodDescriptiongrpcrestgql
add_trusted_issuerAdd a trusted issuer.✓✓✓
update_trusted_issuerUpdate a trusted issuer.✓✓✓
delete_trusted_issuerDelete a trusted issuer — its tokens stop authenticating.✓✓✓
get_trusted_issuerGet a single trusted issuer.✓✓✓
trusted_issuersList trusted issuers (paginated).✓✓✓

SAML Identity Provider​

Authorizer acting as a SAML IdP for downstream service providers.

MethodDescriptiongrpcrestgql
create_saml_service_providerRegister a downstream SP.✓✓✓
update_saml_service_providerUpdate a registered SP.✓✓✓
delete_saml_service_providerDelete a registered SP — it can no longer be issued assertions.✓✓✓
get_saml_service_providerGet a single registered SP.✓✓✓
list_saml_service_providersList registered SPs (paginated).✓✓✓
rotate_saml_idp_certGenerate a new signing keypair; the previous key stays active.✓✓✓
retire_saml_idp_keyRetire a signing key — drops out of IdP metadata; cannot retire the current key.✓✓✓
list_saml_idp_keysList signing keys (-> list[SAMLIDPKey]).✓✓✓
import_saml_sp_metadataParse pasted SP metadata XML (no record is created, no URL fetched).✓✓✓

Organizations, org SSO, SCIM and org domains​

Multi-tenant organizations, their membership, upstream SSO connections, inbound SCIM provisioning, and the verified domains that drive home-realm discovery. These were GraphQL-only until server 2.4.0, which added the proto RPCs and REST bindings — against an older server they still work over graphql only.

Most are authorized for a super-admin or that organization's own org-admin (the reserved authorizer:org_admin role); the platform-wide operations (organizations, create_organization, delete_organization, add_verified_org_domain) stay super-admin only.

MethodDescriptiongqlrestgrpc
create_organizationCreate an organization.✓✓✓
update_organizationUpdate an organization.✓✓✓
delete_organizationDelete an organization.✓✓✓
get_organizationGet a single organization.✓✓✓
organizationsList organizations (paginated).✓✓✓
add_org_memberAdd a member to an organization.✓✓✓
remove_org_memberRemove a member from an organization.✓✓✓
org_membersList an organization's members.✓✓✓
user_organizationsList the organizations a user belongs to.✓✓✓
request_org_domainStart home-realm-discovery domain verification (DNS challenge).✓✓✓
verify_org_domainVerify a requested domain's DNS challenge.✓✓✓
add_verified_org_domainSuper-admin only: trust-assert a domain as verified, skipping the DNS challenge.✓✓✓
delete_org_domainDelete a verified org domain — it stops routing logins to the org.✓✓✓
org_domainsList an organization's verified domains.✓✓✓
create_org_oidc_connectionCreate an org-scoped OIDC SSO connection.✓✓✓
update_org_oidc_connectionUpdate an org-scoped OIDC SSO connection.✓✓✓
delete_org_oidc_connectionDelete an org-scoped OIDC SSO connection — members lose this SSO path.✓✓✓
get_org_oidc_connectionGet an org-scoped OIDC SSO connection.✓✓✓
create_org_saml_connectionCreate an org-scoped SAML SSO connection.✓✓✓
update_org_saml_connectionUpdate an org-scoped SAML SSO connection.✓✓✓
delete_org_saml_connectionDelete an org-scoped SAML SSO connection — members lose this SSO path.✓✓✓
get_org_saml_connectionGet an org-scoped SAML SSO connection.✓✓✓
create_scim_endpointCreate a SCIM provisioning endpoint. Bearer token shown once.✓✓✓
rotate_scim_tokenRotate a SCIM endpoint's bearer token (old one invalidated, new one shown once).✓✓✓
delete_scim_endpointDelete a SCIM endpoint — provisioning stops working.✓✓✓
get_scim_endpointGet a single SCIM endpoint.✓✓✓

Clients (service accounts / machine identities)​

Clients created here authenticate over /oauth/token with the client_credentials and token-exchange grants — see Machine-to-machine & agent delegation.

MethodDescriptiongrpcrestgql
create_clientCreate a client. client_secret is shown once.✓✓✓
update_clientUpdate a client.✓✓✓
delete_clientDelete a client — its tokens stop resolving.✓✓✓
rotate_client_secretRotate a client's secret (old one invalidated, new one shown once).✓✓✓
get_clientGet a single client.✓✓✓
clientsList clients (paginated).✓✓✓

Trusted issuers​

External OIDC/JWT issuers Authorizer accepts tokens from (e.g. for federated machine/agent identities).

MethodDescriptiongrpcrestgql
add_trusted_issuerAdd a trusted issuer.✓✓✓
update_trusted_issuerUpdate a trusted issuer.✓✓✓
delete_trusted_issuerDelete a trusted issuer — its tokens stop authenticating.✓✓✓
get_trusted_issuerGet a single trusted issuer.✓✓✓
trusted_issuersList trusted issuers (paginated).✓✓✓

SAML Identity Provider​

Authorizer acting as a SAML IdP for downstream service providers.

MethodDescriptiongrpcrestgql
create_saml_service_providerRegister a downstream SP.✓✓✓
update_saml_service_providerUpdate a registered SP.✓✓✓
delete_saml_service_providerDelete a registered SP — it can no longer be issued assertions.✓✓✓
get_saml_service_providerGet a single registered SP.✓✓✓
list_saml_service_providersList registered SPs (paginated).✓✓✓
rotate_saml_idp_certGenerate a new signing keypair; the previous key stays active.✓✓✓
retire_saml_idp_keyRetire a signing key — drops out of IdP metadata; cannot retire the current key.✓✓✓
list_saml_idp_keysList signing keys (-> list[SAMLIDPKey]).✓✓✓
import_saml_sp_metadataParse pasted SP metadata XML (no record is created, no URL fetched).✓✓✓

GraphQL-only extras​

These are the only admin operations with no proto RPC, so they work over GraphQL only:

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