Test an inline hook script with a sample context.
Body
Required
-
The inline hook script to test.
-
The inline hook type to test.
Values are
inlineHook.postFirstFactorVerificationorinlineHook.postSignIn. -
The environment variables for the inline hook script.
Responses
-
The result of the inline hook script testing.
-
The request body or response body is invalid.
-
Unauthorized
-
Cloud connection does not have enough permission to perform the action or the tenant's subscription plan does not support this feature.
-
The inline hook script failed to execute.
POST
/api/configs/inline-hooks/test
curl \
--request POST 'https://[tenant_id].logto.app/api/configs/inline-hooks/test' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"script":"string","hookType":"inlineHook.postFirstFactorVerification","event":{},"environmentVariables":{"additionalProperty1":"string","additionalProperty2":"string"}}'
Request examples
{
"script": "string",
"hookType": "inlineHook.postFirstFactorVerification",
"event": {},
"environmentVariables": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
Response examples (200)
Object-1
{}
[
"string"
]
string
42.0
true