Attach a document to an agent
const url = 'https://api.somebodyai.co/api/v1/agents/507f1f77bcf86cd799439011/resources';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"documentId":"example","name":"example","showable":true,"display":{"mode":"talk","closeButton":true,"fill":true,"placement":"auto","title":"example","description":"example","access":"agent","download":true}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.somebodyai.co/api/v1/agents/507f1f77bcf86cd799439011/resources \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "documentId": "example", "name": "example", "showable": true, "display": { "mode": "talk", "closeButton": true, "fill": true, "placement": "auto", "title": "example", "description": "example", "access": "agent", "download": true } }'Show defaults on for images and videos, off otherwise.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”MongoDB ObjectId
MongoDB ObjectId
Request Body
Section titled “Request Body”object
object
Talk: agent keeps speaking and may close it; reference: stays until the user closes it; gate: agent pauses until the user presses Continue
Who can open it when showable. agent: only the agent shows it; user: in the user's materials folder from the start; afterShown: joins the folder once the agent has shown it
The user may download a copy. Never applies to web links.
Responses
Section titled “Responses”Already attached
object
object
Talk: agent keeps speaking and may close it; reference: stays until the user closes it; gate: agent pauses until the user presses Continue
Who can open it when showable. agent: only the agent shows it; user: in the user's materials folder from the start; afterShown: joins the folder once the agent has shown it
The user may download a copy. Never applies to web links.
Example
{ "kind": "pdf", "status": "processing", "display": { "mode": "talk", "placement": "auto", "access": "agent" }}Attached
object
object
Talk: agent keeps speaking and may close it; reference: stays until the user closes it; gate: agent pauses until the user presses Continue
Who can open it when showable. agent: only the agent shows it; user: in the user's materials folder from the start; afterShown: joins the folder once the agent has shown it
The user may download a copy. Never applies to web links.
Example
{ "kind": "pdf", "status": "processing", "display": { "mode": "talk", "placement": "auto", "access": "agent" }}Bad request - validation failed
object
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}Unauthorized - missing or invalid auth
object
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}Resource not found
object
Example
{ "error": "Resource not found", "details": [ "Field is required" ]}