POST
/v1/mgmt/tenant/create/batchAuthorization
Descope Project ID and Management Key AuthorizationBearer <token>
Project ID:Management Key as bearer token.
In: header
Request Body
application/json
tenants*array<CreateTenantRequest>
Items
1 <= itemsstrict?boolean
When true, setting custom attributes the project does not declare for tenants returns error E111843 listing them for every item in the batch: an item that sets one fails and the others are saved. When false (default), those keys are ignored. An attribute declared in the last few seconds may still be ignored.
Create multiple tenants in a single batch, using a valid management key. Each tenant is created independently; per-tenant failures are returned in the response body.
curl -X POST "https://api.descope.com/v1/mgmt/tenant/create/batch" \ -H "Content-Type: application/json" \ -d '{ "tenants": [ { "name": "string" } ] }'{ "createdTenants": [ { "id": "string", "name": "string" } ], "failedTenants": [ { "failure": "string", "tenant": { "name": "string", "id": "string", "selfProvisioningDomains": [ "string" ], "customAttributes": { "attribute-key": "attribute-value" }, "authType": "none", "disabled": true, "enforceSSO": true, "enforceSSOExclusions": [ "string" ], "federatedAppIds": [ "string" ], "parent": "string", "roleInheritance": "none", "approvedDomains": [ "string" ], "enforceSSOExclusionPermissions": [ "string" ], "strict": true } } ], "additionalErrors": { "property1": "string", "property2": "string" }}export interface Response {createdTenants?: CreatedTenantResponse[]failedTenants?: CreateTenantBatchFailureResponse[]additionalErrors?: {[k: string]: string}}export interface CreatedTenantResponse {id?: stringname?: string}export interface CreateTenantBatchFailureResponse {failure?: stringtenant?: {name: stringid?: stringselfProvisioningDomains?: string[]/** * Custom attributes as key-value pairs. Keys must be strings; values can be strings, numbers, booleans, or arrays. */customAttributes?: {[k: string]: string}authType?: ("none" | "saml" | "oidc" | "")disabled?: booleanenforceSSO?: booleanenforceSSOExclusions?: string[]federatedAppIds?: string[]parent?: stringroleInheritance?: ("none" | "userOnly" | "")/** * The tenant's vanity hostname (e.g. surveys.example.com), unique across the project's tenants. Requests that reach the project through its trusted proxy on this hostname are bound to this tenant. One item for now * * @maxItems 1 */approvedDomains?: []|[string]/** * Permission names or IDs whose holders in the tenant may sign in without SSO while enforceSSO is on (break-glass accounts) */enforceSSOExclusionPermissions?: string[]/** * When true, setting custom attributes the project does not declare for tenants returns error E111843 listing them: the request fails and nothing is saved. When false (default), those keys are ignored. An attribute declared in the last few seconds may still be ignored. */strict?: boolean}} Was this helpful?