Set the webhook endpoint
curl --request PUT \
--url https://guidinghand.ai/v1/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/guidinghand",
"events": [],
"rotate_secret": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/guidinghand', events: [], rotate_secret: true})
};
fetch('https://guidinghand.ai/v1/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/webhook"
payload = {
"url": "https://example.com/guidinghand",
"events": [],
"rotate_secret": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"object": "webhook",
"url": "<string>",
"events": [
"session.connected"
],
"has_secret": true,
"secret": "<string>",
"event_types": [
"session.connected"
]
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}Webhooks
Set the webhook endpoint
Only the fields you send change: without url the endpoint stays, without events the filter stays (so { "rotate_secret": true } alone just makes a new secret). Send { "url": null } to remove the endpoint. The signing secret is returned when it is first made (or with rotate_secret), never again.
PUT
/
v1
/
webhook
Set the webhook endpoint
curl --request PUT \
--url https://guidinghand.ai/v1/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/guidinghand",
"events": [],
"rotate_secret": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/guidinghand', events: [], rotate_secret: true})
};
fetch('https://guidinghand.ai/v1/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/webhook"
payload = {
"url": "https://example.com/guidinghand",
"events": [],
"rotate_secret": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"object": "webhook",
"url": "<string>",
"events": [
"session.connected"
],
"has_secret": true,
"secret": "<string>",
"event_types": [
"session.connected"
]
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
Body
application/json
A public https URL. Required the first time; null removes the endpoint.
Example:
"https://example.com/guidinghand"
Only these events; an empty list for all. Unknown types are a 400.
Available options:
session.connected, session.disconnected, task.started, task.waiting_for_user, task.question_answered, task.waiting_for_approval, task.approval_decided, task.completed, task.failed, task.stopped Response
OK
Available options:
session.connected, session.disconnected, task.started, task.waiting_for_user, task.question_answered, task.waiting_for_approval, task.approval_decided, task.completed, task.failed, task.stopped Only when it was just made.
Available options:
session.connected, session.disconnected, task.started, task.waiting_for_user, task.question_answered, task.waiting_for_approval, task.approval_decided, task.completed, task.failed, task.stopped