@personaai/sdkv0.9.0

files — @personaai/sdk

Generated field tables for files — do not edit

Generated from sdk/typescript/dist/typedoc.json — do not edit. Regenerate with node platform/scripts/typedoc-resources.mjs.

files

Auth: Requires Authorization: Bearer <keyId>.<secret> (server-side). For per-user calls add x-persona-external-user-id. See .

Files are user uploads (multipart file part) scoped to an optional agentId/threadId.

Example

TypeScript

ts
const file = await userClient.files.upload({ filename: 'notes.pdf', content: buf, agentId: agent._id });const list = await userClient.files.list({ page: 1, limit: 20 });

cURL

bash
curl https://api.persona.hasanraiyan.me/api/v1/developer/files \  -H "Authorization: Bearer $PERSONA_CREDENTIAL" -H "x-persona-external-user-id: user_123" \  -F file=@notes.pdf -F agentId=ag_123

Response

json
{  "success": true,  "data": { "items": [{ "id": "file_123", "originalName": "notes.pdf" }], "pagination": { "total": 1 } }}

PersonaFile

Clean formatted shape (id, not _id) — unlike Thread/Skill/Agent/Knowledge.

Source: types/file.ts:2

Interface

FieldTypeDescription
idstring— _ types/file.ts:3_
originalNamestring— _ types/file.ts:4_
mimeTypestring— _ types/file.ts:5_
sizenumberBytes. — _ types/file.ts:7_
agentIdstring | null— _ types/file.ts:8_
threadIdstring | null— _ types/file.ts:9_
createdAtstring— _ types/file.ts:10_

UploadFilePayload

Source: types/file.ts:13

Interface

FieldTypeDescription
filenamestring— _ types/file.ts:14_
contentUint8Array<ArrayBufferLike> | BlobNode Buffer/Uint8Array, or an already-constructed Blob. — _ types/file.ts:16_
contentType?stringe.g. 'application/pdf'. Required when content isn't already a Blob with its own type. — _ types/file.ts:18_
agentId?stringAssociates this file with an Agent, e.g. for later reference in that Agent's tool calls. — _ types/file.ts:20_
threadId?stringAssociates this file with a specific Thread/conversation. — _ types/file.ts:22_

ListFilesParams

Source: types/file.ts:25

Interface

FieldTypeDescription
page?number— _ types/file.ts:27_
limit?number— _ types/file.ts:29_