Skip to content
Dashboard
Theme
Theme

Prepare a sandbox for `ohauthcat init`

POST /v1/dev/init: Prepare a sandbox for `ohauthcat init`.

View Markdown

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
  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • redirect_uri string (uri)

    Registered when missing (exact match).

  • test_connection boolean

    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 ID ohauthcat-test-organization) and a fresh one-time test_url for a test sign-in. Answers service_unavailable where no test IdP is available.

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
}'
Response 200
{
"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"
}