Skip to Content
kosemdocs
ReferenceAPIAgents

Get agent file

Gets one of an agent's files: its name, type and size, and what the agent's model reads of it.

GET
/v1/projects/{project}/agents/{agent}/files/{file}

Gets one of an agent's files: its name, type and size, and what the agent's model reads of it.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
agent*string

The agent's ID.

Match^ags_[0-7][0-9a-hjkmnp-tv-z]{25}$
file*string

The file's ID.

Match^fil_[0-7][0-9a-hjkmnp-tv-z]{25}$

Response Body

OK

application/json
  1. response
createTime*string

When it was uploaded.

Formatdate-time
creator*string

Who uploaded it, such as user:usr_….

filename*string

Its file name.

height?integer

An image's height, in pixels.

Formatint32
mediaType*string

Its media type, such as image/png or application/pdf.

modelReads*string

What the agent's model reads of the file in a message: CONTENT, the file itself, as an image or a document, which models that read neither get a placeholder for; or DESCRIPTION, its name, media type, size and ID alone, by which the agent's tools open it.

Value in"CONTENT""DESCRIPTION"
name*string

Resource name, projects/{project_id}/agents/{agent_id}/files/{file_id}, by which a message's file part attaches it.

sha256*string

The SHA-256 of its content, in hexadecimal.

sizeBytes*integer

Its size, in bytes.

Formatint64
width?integer

An image's width, in pixels.

Formatint32
Example Request
curl -X GET 'https://api.kosem.ai/v1/projects/string/agents/string/files/string'
Example Response
{
  "createTime": "2019-08-24T14:15:22Z",
  "creator": "string",
  "filename": "string",
  "height": 0,
  "mediaType": "string",
  "modelReads": "CONTENT",
  "name": "string",
  "sha256": "string",
  "sizeBytes": 0,
  "width": 0
}