Change what someone joining by a domain gets
const url = 'https://example.com/v1/auth/join-domains/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"viewer"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/auth/join-domains/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "viewer" }'A raise (none to viewer to runner) gives joiners more, so it takes allowing’s rules: a person who’s a tenant admin for their own proved email’s domain, or the operator, and only the operator when it manages sign-in. A lower role takes any tenant admin, an API key too. The same role writes nothing. People who joined already keep what they have. Audited.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”What someone joining by the domain gets from now on. People who joined already keep what they have.
object
Responses
Section titled “Responses”The domain now.
An email domain the workspace lets people join from.
object
Example
{ "role": "viewer"}A body that isn’t { role } (bad-input).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Not a tenant admin (permission-denied). Without an authorization store, a tenant admin is the deployment’s API token, an admin key, or a console signed in with either. Not the caller’s to widen (join-domain-not-yours): an API key or a service account, a session whose sign-in proved another domain or no email, or one by a way in that doesn’t count for it (GitHub; the workspace’s own provider for a domain the deployment doesn’t route to the workspace). Or this deployment’s operator manages sign-in (join-domains-operator-managed, KINDGI_AUTH_TENANT_PROVIDERS=off): only kindgi:system lets more people in.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The workspace doesn’t allow that domain (join-domain-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}A raise for a domain the operator has since verified for another workspace (join-domain-verified-elsewhere), or an Idempotency-Key reused with another body. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/auth/join-domains: The email domains people may join the workspace fromPOST /v1/auth/join-domains: Let people at an email domain join the workspacePOST /v1/auth/join-domains/{domain}/unregister: Stop letting people at a domain join- People, API keys and service accounts
- Error code
authz-backend-unavailable - Error code
bad-input - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
join-domain-not-found - Error code
join-domain-not-yours - Error code
join-domain-verified-elsewhere - Error code
join-domains-operator-managed - Error code
permission-denied - Error code
rate-limit-exceeded - Error code
request-too-large - Error code
tenant-state-unavailable - Every error code