swift-honey-17379
05/23/2024, 10:59 AMchilly-king-10285
05/23/2024, 10:59 AMchilly-king-10285
05/23/2024, 11:00 AMswift-honey-17379
05/23/2024, 11:02 AMchilly-king-10285
05/23/2024, 11:02 AMchilly-king-10285
05/23/2024, 11:02 AMswift-honey-17379
02/25/2026, 6:17 AMchilly-king-10285
02/25/2026, 6:17 AMchilly-king-10285
02/25/2026, 6:17 AMory patch oauth2-config --project <project-id> --workspace <workspace-id> \
--replace '/oauth2/token_hook/url="https://my-example.app/new-token-hook"' \
--format yaml
If you haven’t configured it before, you may need to set the full object instead of just the URL, for example:
ory patch oauth2-config --project <project-id> --workspace <workspace-id> \
--add '/oauth2/token_hook={"url":"https://my-example.app/new-token-hook","auth":{"type":"api_key","config":{"name":"X-API-Key","value":"MY_API_KEY","in":"header"}}}' \
--format yaml
The token hook configuration and CLI usage are described in the OAuth2 CLI and webhook docs.[Configure OAuth2; Token webhook]
2. Other project configuration webhooks (identity, actions, etc.)
For other webhooks that live in the project configuration (for example, Ory Actions or identity hooks), you change them with `ory patch project`:
ory patch project --project <project-id> --workspace <workspace-id> \
--replace '/services/identity/config/selfservice/flows/login/after/hooks/0/config/url="https://my-example.app/new-hook"' \
--format json-pretty
The exact JSON path depends on where the webhook is defined in your config; you can first fetch the project config:
ory get project --project <project-id> --workspace <workspace-id> --format json
Then adjust the relevant url field using --replace (or --add) as shown in the general project-config guide.[Configure projects; Patch project]
If you clarify which webhook (OAuth2 token hook, identity hook, Ory Action, etc.), I can give the exact JSON path to patch. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.