curl --request PUT \
--url https://guidinghand.ai/v1/agents/{agent_id}/files/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "# Returns\nWithin 30 days, with the receipt."
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '# Returns\nWithin 30 days, with the receipt.'})
};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/files/{path}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/agents/{agent_id}/files/{path}"
payload = { "content": "# Returns
Within 30 days, with the receipt." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"object": "agent_file",
"agent_id": "billing",
"path": "/notes/customers.md",
"bytes": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": {
"type": "user",
"email": "jane@acme.com"
},
"content": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}Write a file
Creates the file, or replaces it, with this text. Text only: up to 1 MB a file, and 1,000 files and 25 MB an agent (past those, 413 and 409). Folders are part of the path and need no making; . and .. aren’t allowed. The agent sees the change in its next tool call. Needs the admin role or an API key.
curl --request PUT \
--url https://guidinghand.ai/v1/agents/{agent_id}/files/{path} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "# Returns\nWithin 30 days, with the receipt."
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '# Returns\nWithin 30 days, with the receipt.'})
};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/files/{path}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/agents/{agent_id}/files/{path}"
payload = { "content": "# Returns
Within 30 days, with the receipt." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"object": "agent_file",
"agent_id": "billing",
"path": "/notes/customers.md",
"bytes": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": {
"type": "user",
"email": "jane@acme.com"
},
"content": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
Path Parameters
The agent’s id, e.g. billing or default.
The file’s path, like notes/customers.md (with its slashes as they are, or encoded as %2F).
Body
The whole text of the file.
"# Returns\nWithin 30 days, with the receipt."
Response
OK
"billing"
Always starts with /.
"/notes/customers.md"
Its size in UTF-8.
Who last wrote the file: a person, an API key, or the agent itself during a task (task_id).
- Person
- API key
- Agent
Show child attributes
Show child attributes
The file’s text. Only when you get or write one file.