curl --request POST \
--url https://guidinghand.ai/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"data": "<string>",
"content_type": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>', data: '<string>', content_type: '<string>'})
};
fetch('https://guidinghand.ai/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/uploads"
payload = {
"filename": "<string>",
"data": "<string>",
"content_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "upload",
"id": "<string>",
"filename": "<string>",
"content_type": "<string>",
"kind": "image",
"bytes": 123,
"source": "person",
"conversation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Upload a file
A file to attach to a message (attachments on POST /v1/agents//responses). Send JSON with the file in base64, or the file itself as the body (with its Content-Type, and ?filename=). Up to 10 MB; images up to 5 MB, and they must be PNG, JPEG, GIF or WebP. What a file is comes from its bytes and name.
curl --request POST \
--url https://guidinghand.ai/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"data": "<string>",
"content_type": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>', data: '<string>', content_type: '<string>'})
};
fetch('https://guidinghand.ai/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/uploads"
payload = {
"filename": "<string>",
"data": "<string>",
"content_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "upload",
"id": "<string>",
"filename": "<string>",
"content_type": "<string>",
"kind": "image",
"bytes": 123,
"source": "person",
"conversation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
Query Parameters
The file’s name, when the body is the file itself.
Body
Response
The upload.
A file for a conversation (POST /v1/uploads). Attach it to a message with attachments; then it belongs to that conversation and is kept as long as it is. One no message sent is deleted after a day.
upl_…
From the file’s bytes and name (a CSV is text/csv whatever the browser said).
How the model gets it: image (PNG, JPEG, GIF or WebP) and pdf it sees; text it reads (long files are cut); other only its code sandbox opens (Run code).
image, pdf, text, other person: uploaded with the API or in the console. agent: made by the agent’s code.
person, agent The conversation it was sent in; null until then.
When it’s deleted if no message sends it; null once sent.