Create a session
curl --request POST \
--url https://guidinghand.ai/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "billing",
"metadata": {
"customer_id": "cus_42"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: 'billing', metadata: {customer_id: 'cus_42'}})
};
fetch('https://guidinghand.ai/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/sessions"
payload = {
"agent_id": "billing",
"metadata": { "customer_id": "cus_42" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "session",
"session_id": "K7QM-24XP",
"code": "K7QM-24XP",
"agent_id": "<string>",
"invite_url": "https://guidinghand.ai/acme/billing/K7QM-24XP",
"status": "waiting",
"device": {
"os": "mac",
"name": "<string>",
"width": 123,
"height": 123,
"app_version": "<string>"
},
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"paired_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"task_count": 123,
"latest_task_id": "<string>",
"session_token": "<string>"
}{
"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"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}Sessions
Create a session
Makes a pairing code and its invite link. Send the invite_url to the person at the computer: it walks them through installing GuidingHand and connecting. Codes expire after 72 hours without use.
POST
/
v1
/
sessions
Create a session
curl --request POST \
--url https://guidinghand.ai/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "billing",
"metadata": {
"customer_id": "cus_42"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: 'billing', metadata: {customer_id: 'cus_42'}})
};
fetch('https://guidinghand.ai/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/sessions"
payload = {
"agent_id": "billing",
"metadata": { "customer_id": "cus_42" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "session",
"session_id": "K7QM-24XP",
"code": "K7QM-24XP",
"agent_id": "<string>",
"invite_url": "https://guidinghand.ai/acme/billing/K7QM-24XP",
"status": "waiting",
"device": {
"os": "mac",
"name": "<string>",
"width": 123,
"height": 123,
"app_version": "<string>"
},
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"paired_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"task_count": 123,
"latest_task_id": "<string>",
"session_token": "<string>"
}{
"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"
}
}{
"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
Response
OK
Example:
"K7QM-24XP"
Example:
"K7QM-24XP"
Example:
"https://guidinghand.ai/acme/billing/K7QM-24XP"
waiting: no computer has used the code yet. connected: its computer is online now.
Available options:
waiting, connected, disconnected, expired Show child attributes
Show child attributes
Your own ids and labels (e.g. a ticket or customer id), returned as given.
Show child attributes
Show child attributes
Example:
{ "customer_id": "cus_42" }
A token for this one session (the older task API). Shown once.