Skip to main content
POST
Create a lifecycle hook

Authorizations

Authorization
string
header
required

API key in format: rg_live_xxxx. Pass as a Bearer token in the Authorization header.

Path Parameters

agentId
string<uuid>
required

Agent ID.

Body

application/json
stage
enum<string>
required

Required.

Available options:
PRE_CALL,
POST_CALL
name
string
required
toolSlug
string

Use with toolFn to call an integration.

toolFn
string
functionId
string<uuid>

Use instead of toolSlug/toolFn to call a custom function.

input
object
exposeAs
string

Pre-call only.

Pattern: ^[a-z_][a-z0-9_]*$
required
boolean
default:false
timeoutMs
integer
default:3000
Required range: 100 <= x <= 30000
position
integer

Omit to append to the end of the stage.

Response

Hook created.

hook
object