{"openapi":"3.1.0","info":{"title":"algizian management API","version":"1.0.0","description":"Create and manage tenants, their OAuth clients, branding, custom domains and users. Needs a bearer token (ag_...): a platform token for everything, a tenant token (read or manage) for one tenant. Errors are RFC 9457 problem+json."},"servers":[{"url":"https://id.algizian.com/api/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API token ag_..., scope platform, read or manage"}}},"paths":{"/me":{"get":{"summary":"Who the token is","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants":{"get":{"summary":"List tenants (a tenant token sees its own)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"post":{"summary":"Create a tenant (platform token): slug, optional name, branding, providers and custom domain","security":[{"bearer":[]}],"tags":["Management"],"responses":{"201":{"description":"Created; the body carries a notice with the recommended wording for telling users about the shared Algizian provider apps"},"400":{"description":"Invalid or reserved slug"},"409":{"description":"Slug taken"}}}},"/tenants/{t}":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"get":{"summary":"Get a tenant with its issuer and custom domain state","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"patch":{"summary":"Update name, branding (null clears a field) and providers","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"delete":{"summary":"Delete a tenant with all its data (platform token)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/branding/logo":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"put":{"summary":"Upload the tenant logo: the raw PNG, JPEG or WebP file as the body (at most 1 MB; shorter side at least 128 and no side over 2048 pixels; SVG, GIF and animated images are refused). It is cropped to a centred square and stored at 128 x 128 pixels without metadata; the answer is the tenant with branding.logo {key, width, height}. Answers 503 while logo upload is not available","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"The tenant with its new logo"},"400":{"description":"Not an accepted image (problem+json says why)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"},"413":{"description":"Body too large"},"503":{"description":"Logo upload is not available"}},"requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}}},"delete":{"summary":"Remove the tenant logo","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/domain":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"put":{"summary":"Set the custom domain; the answer carries the CNAME to create","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"delete":{"summary":"Remove the custom domain","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/domain/refresh":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"post":{"summary":"Refresh the custom domain status","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/providers":{"get":{"summary":"List the sign-in providers algizian supports with the credential fields of an own app (generated from the provider adapters); never tenant data","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/providers/{provider}/setup":{"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["google","microsoft","apple"]}}],"get":{"summary":"The step-by-step guide to register an own app with this provider: scopes, steps, credential fields with examples, notes, how the account id and verified email behave","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/providers":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"get":{"summary":"List the sign-in providers with their source (shared or own app), client id and the redirect URIs to register; never a secret","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/providers/{provider}/credentials":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"},{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["google","microsoft","apple"]}}],"put":{"summary":"Use your own provider app. The fields per provider: google takes clientId, clientSecret; microsoft takes clientId, clientSecret; apple takes clientId, teamId, keyId, privateKey, domainAssociation (optional). Secrets are stored encrypted and never returned; the answer lists the redirect URIs to register (your sign-in hosts) and a warning that provider account ids change","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"delete":{"summary":"Remove your own provider app and go back to the shared one","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/clients":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"get":{"summary":"List OAuth clients","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"post":{"summary":"Create an OAuth client (public or confidential; a secret is shown once)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"201":{"description":"Created"}}}},"/tenants/{t}/clients/{id}":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a client","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"patch":{"summary":"Update a client","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"delete":{"summary":"Delete a client and its refresh tokens","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/keys":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"get":{"summary":"List the tenant signing keys (public parts)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/keys/rotate":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"post":{"summary":"Rotate the signing key: new tokens use the new key, the old key stays in the key set until its tokens have expired","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/tokens":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"get":{"summary":"List tenant API tokens (platform token)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"post":{"summary":"Create a tenant API token, scope read or manage (platform token; shown once)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"201":{"description":"Created"}}}},"/tenants/{t}/tokens/{id}":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Revoke a tenant API token (platform token)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/users":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"}],"get":{"summary":"List users (?limit, ?after, ?email, ?status)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"post":{"summary":"Create (import) a user before first sign-in: optional id, email, emailVerified, name, status, identities [{provider, subject}]","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/users/{id}":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a user with its linked identities","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}},"delete":{"summary":"Delete a user, its identities, sessions and refresh tokens","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/users/{id}/identities/{identityId}":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"identityId","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Unlink one identity from a user (409 when it is the last one)","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"The user with its remaining identities"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"},"409":{"description":"Last identity of the user"}}}},"/tenants/{t}/users/{id}/block":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Block a user on this tenant and end their sessions and refresh tokens","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}},"/tenants/{t}/users/{id}/unblock":{"parameters":[{"name":"t","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant slug"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Unblock a user","security":[{"bearer":[]}],"tags":["Management"],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input (problem+json)"},"401":{"description":"Missing or invalid token"},"403":{"description":"The token scope does not allow this"},"404":{"description":"Not found"}}}}}}