Prepare a sandbox for `ohauthcat init`
POST /v1/dev/init: Prepare a sandbox for `ohauthcat init`.
POST /v1/dev/init
Sandbox discovery for ohauthcat init, and an idempotent redirect URI registration. Returns the environment and, when redirect_uri is given, its registered redirect URI (created when missing, redirect_uri_created; localhost is allowed in sandbox). With test_connection, also returns the test organization, its test IdP connection and a test sign-in URL. Sandbox environments only (sandbox_required).
- Scope
environment:write- Auth
- Secret key (
sk_…) - Since
- 1.0
Headers
Section titled “Headers”
Minor version; defaults to the environment’s pin.OhAuthCat-Versionstring
Request body
Section titled “Request body”
Registered when missing (exact match).redirect_uristring (uri)
When true, also returns the sandbox’s test organization and its SAML connection to the hosted test IdP (created on the first call, then found by the fixed external IDtest_connectionbooleanohauthcat-test-organization) and a fresh one-timetest_urlfor a test sign-in. Answersservice_unavailablewhere no test IdP is available.
Responses
Section titled “Responses”- 200 OK DevInit
- 400 Invalid request. Codes: parameter_invalid, parameter_missing, version_unsupported and resource-specific codes from the catalogue. Error
- 401 Codes: authentication_required, api_key_invalid. Error
- 403 Codes: api_key_scope_missing, ip_not_allowed, plan_limit_reached. Error
- 429 Code: rate_limited. Retry-After is set. Error
- 503 Code: service_unavailable. Retry-After is set; writes are paused. Error
- default Any other error, including internal_error. Every code is in the error catalogue. Error
Errors share one shape; see the error code catalogue.
curl -X POST \ "https://api.ohauthcat.com/v1/dev/init" \ -H "Authorization: Bearer $OHAUTHCAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "redirect_uri": "https://app.acme.com/callback", "test_connection": true}'const response = await fetch("https://api.ohauthcat.com/v1/dev/init", { method: "POST", headers: { Authorization: `Bearer ${process.env.OHAUTHCAT_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "redirect_uri": "https://app.acme.com/callback", "test_connection": true }),});const data = await response.json();import osimport requests
response = requests.post( "https://api.ohauthcat.com/v1/dev/init", headers={"Authorization": f"Bearer {os.environ['OHAUTHCAT_API_KEY']}"}, json={ "redirect_uri": "https://app.acme.com/callback", "test_connection": True, },)data = response.json(){ "object": "dev_init", "environment": { "id": "env_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "object": "environment", "project": "proj_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "name": "Acme Corp", "type": "sandbox", "consent_screen_default": "on", "sign_in_failed_events": true, "gusto_oauth_available": true, "bamboohr_oauth_available": true, "google_oauth_available": true, "compat_workos_enabled": false, "version_pin": "example_version_pin", "home_region": "example_home_region", "portal_success_urls": {}, "disabled_notices": [ "cert_expiry" ], "portal_logo_url": "https://app.acme.com/callback", "portal_embed_origins": [ "example_portal_embed_origin" ], "support_email": "jane@acme.com", "sign_ins_disabled": true, "sign_ins_disabled_at": "2026-01-15T09:30:00Z", "sign_ins_disabled_by": "customer", "residency": { "region": "eu", "data_classes": [ { "data_class": "example_data_class", "description": "Primary SSO connection for Acme Corp.", "scope": "home_region", "region": "eu", "personal_data": true } ] } }, "redirect_uri": { "id": "ruri_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "object": "redirect_uri", "uri": "https://app.acme.com/callback", "created_at": "2026-01-15T09:30:00Z" }, "redirect_uri_created": true, "relay_path": "example_relay_path", "organization": { "id": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "object": "organization", "legacy_ids": { "workos": "org_01H8ZQ4M7K2X8V3N5B6C1D0E9F" }, "name": "Acme Corp", "external_id": "acme-123", "status": "active", "allowed_intents": [ "sso" ], "consent_screen": "environment_default", "metadata": { "plan": "enterprise" }, "created_at": "2026-01-15T09:30:00Z", "updated_at": "2026-01-15T09:30:00Z" }, "connection": { "oidc_managed": { "provider": "google_workspace", "entra_tenant_id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "allow_personal_accounts": false }, "catalogue_idp": "okta", "id": "conn_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "object": "connection", "legacy_ids": { "workos": "org_01H8ZQ4M7K2X8V3N5B6C1D0E9F" }, "forwarding": { "acs_urls": [ "https://app.acme.com/callback" ], "redirect_uris": [ "https://app.acme.com/callback" ], "until": "2026-01-15T09:30:00Z", "expires_in_days": 0, "last_warning_days": 1, "hint": "example_hint" }, "idp_initiated": { "enabled": false, "client_id": "client_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "default_redirect_uri": "https://app.acme.com/callback" }, "organization_id": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5", "name": "Acme Corp", "type": "saml", "state": "draft", "sp_entity_id": "https://idp.acme.com/saml/metadata", "sp_metadata_url": "https://app.acme.com/callback", "test_idp": true, "acs_urls": [ "https://app.acme.com/callback" ], "sp_slo_urls": [ "https://app.acme.com/callback" ], "routing_domains": [ "acme.com" ], "standby_registered": true, "import_source": "example_import_source", "import_lever": "A", "standby_acs_selection": "url", "idp_entity_id": "https://idp.acme.com/saml/metadata", "oidc_issuer": "https://idp.acme.com/saml/metadata", "metadata_stale_since": "2026-01-15T09:30:00Z", "untested_since": "2026-01-15T09:30:00Z", "created_at": "2026-01-15T09:30:00Z", "updated_at": "2026-01-15T09:30:00Z" }, "test_url": "https://app.acme.com/callback", "test_url_expires_at": "2026-01-15T09:30:00Z"}