Integrations
Check tool call
A PreToolUse hook for Claude Code.
Always answers in the hook’s format. If we cannot decide, the answer is “ask”, so Claude Code falls back to asking the person.
POST
/
v1
/
hooks
/
claude-code
Check tool call
curl --request POST \
--url https://api.sqwish.ai/v1/hooks/claude-code \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hook_event_name": "<string>",
"tool_name": "<string>",
"tool_input": "<unknown>",
"cwd": "<string>",
"permission_mode": "<string>",
"agent_type": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/hooks/claude-code"
payload = {
"hook_event_name": "<string>",
"tool_name": "<string>",
"tool_input": "<unknown>",
"cwd": "<string>",
"permission_mode": "<string>",
"agent_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hook_event_name: '<string>',
tool_name: '<string>',
tool_input: '<unknown>',
cwd: '<string>',
permission_mode: '<string>',
agent_type: '<string>'
})
};
fetch('https://api.sqwish.ai/v1/hooks/claude-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"permissionDecisionReason": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Headers
Reuse the same key and body after a lost response. A successful replay does not execute or charge again. Changed request bodies conflict; expired replay bodies are not executed again under the old key. An organisation with zero data retention keeps no answer, so its key is not honoured: a retry runs again and is charged again.
Required string length:
1 - 255Pattern:
^[!-~]+$Body
application/json
Check tool call
curl --request POST \
--url https://api.sqwish.ai/v1/hooks/claude-code \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hook_event_name": "<string>",
"tool_name": "<string>",
"tool_input": "<unknown>",
"cwd": "<string>",
"permission_mode": "<string>",
"agent_type": "<string>"
}
'import requests
url = "https://api.sqwish.ai/v1/hooks/claude-code"
payload = {
"hook_event_name": "<string>",
"tool_name": "<string>",
"tool_input": "<unknown>",
"cwd": "<string>",
"permission_mode": "<string>",
"agent_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hook_event_name: '<string>',
tool_name: '<string>',
tool_input: '<unknown>',
cwd: '<string>',
permission_mode: '<string>',
agent_type: '<string>'
})
};
fetch('https://api.sqwish.ai/v1/hooks/claude-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"permissionDecisionReason": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}