Skip to content
Dashboard
Theme
Theme

Create a sign-in hook

POST /v1/sign_in_hooks: Create a sign-in hook.

View Markdown

POST /v1/sign_in_hooks

Adds the environments hook for a point (Business and Enterprise; plan_limit_reached below). pre_profile_issue is called synchronously before every profile is issued and may deny the sign-in or add bounded claims; post_directory_event receives directory events asynchronously. The signing secret is returned once, in this response. A second hook for the same point is conflict.

Scope
policies:write
Auth
Secret key (sk_…)
Since
1.0
  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • point string Required

    one of pre_profile_issue, post_directory_event

  • url string Required

    min length 9 · max length 2048

  • fail_mode string

    closed (default) refuses the sign-in when the hook does not answer validly; open continues without claims.

    one of closed, open

  • timeout_ms integer

    min 100 · max 5000 · default 2000

  • enabled boolean

    default true

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/sign_in_hooks" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"point": "pre_profile_issue",
"url": "https://app.acme.com/callback"
}'
Response 201
{
"id": "hook_01J9ZQ4M7K2X8V3N5B6C1D0E9F",
"object": "sign_in_hook",
"point": "pre_profile_issue",
"url": "https://app.acme.com/callback",
"fail_mode": "closed",
"timeout_ms": 100,
"enabled": true,
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z",
"secret": "sk_test_example"
}