Skip to content

Workspace

The workspace the request acts in: the token’s workspace, or the one named by X-Mayadyn-Tenant for a session. Field names say tenant.

Single sign-on settings: Workspace single sign-on. Sign-in rules and how they affect API calls: Authentication.

Get the workspace.

Auth: session or token. No scope is required: any caller that has entered the workspace (including a project token, or a token without read) gets it.

Response 200 (Tenant):

{"id": "6f1c2a9e-3b7d-4c1e-9a52-1d8e4b7f0c31", "slug": "acme", "name": "Acme",
"require_mfa": false, "require_sso": false, "created_at": "2026-10-02T07:58:11Z"}
Terminal window
curl -s "$MAYADYN/v1/tenant" -H "Authorization: Bearer $TOKEN"

Set the workspace’s sign-in rules.

Auth: session only, signed in as yourself (tokens: 403 permission_denied “this is done in the console, signed in as yourself”); role with admin (admin or owner).

Request body

Field Type Required Description
require_mfa boolean no (omitted: unchanged) every request in the workspace needs two-step sign-in
require_sso boolean no (omitted: unchanged) every request in the workspace needs the workspace’s single sign-on

Send only the rule you change; an omitted field keeps its current value.

{"require_mfa": true, "require_sso": false}

Response 200 with the updated Tenant.

Errors

Status Code When
409 conflict require_mfa: true but the current session has no second factor that counts in this workspace: “turn on two-step sign-in for yourself and sign in with it first”
409 conflict require_sso: true but the current session did not sign in through this workspace’s SSO: “sign in with this workspace’s single sign-on first”
403 permission_denied token, or role below admin

Notes: turning a rule on immediately refuses sessions and tokens that do not meet it (403 mfa_required / sso_required), including existing tokens created from a session that did not meet it. Audit: tenant.rules with require_mfa and require_sso.

Terminal window
curl -s -b jar -X PATCH "$MAYADYN/v1/tenant" \
-H "X-Mayadyn-Tenant: acme" -H "X-Mayadyn-CSRF: 1" -H "Content-Type: application/json" \
-d '{"require_mfa": true, "require_sso": false}'