ResourcesFiles

Files

Upload, retrieve, and delete workspace files through the Talkturo API, managing file storage with signed URLs and account-scoped access control.

curl -X POST "https://app.talkturo.com/api/files" \
  -H "Cookie: sb-access-token=sb_session_example_7xk2m9p4" \
  -F "file=@/Users/jane/Documents/quarterly-report.pdf" \
  -F "accountId=acct_7b3d9f21" \
  -F "displayName=Quarterly report"
{
  "data": {
    "id": "file_4f8a2c91",
    "name": "Quarterly report",
    "size": 248193,
    "file_type": "application/pdf",
    "created_at": "2026-03-12T14:22:08.431Z",
    "account_id": "acct_7b3d9f21"
  }
}
curl "https://app.talkturo.com/api/files?fileId=file_4f8a2c91&accountId=acct_7b3d9f21" \
  -H "Cookie: sb-access-token=sb_session_example_7xk2m9p4"
{
  "url": "https://storage.example.supabase.co/object/sign/files/acct_7b3d9f21/file_4f8a2c91?token=eyJhbGciOiJIUzI1NiJ9"
}
curl -X DELETE "https://app.talkturo.com/api/files?fileId=file_4f8a2c91&accountId=acct_7b3d9f21" \
  -H "Cookie: sb-access-token=sb_session_example_7xk2m9p4"
{
  "success": true
}

Files

Upload, retrieve, and delete files associated with a Talkturo workspace through the /api/files endpoint.

All operations require an authenticated Talkturo web session. The authenticated user must own the account or belong to it through an account membership.

File uploads use multipart/form-data and support files up to 25 MB. Download requests return signed URLs that expire after 10 minutes.

Upload a file

POST /api/files uploads a file to a workspace and returns its stored metadata.

Request

Send the request as multipart/form-data.

credentials: "include" sends the authenticated browser session. Do not set the Content-Type header manually. The browser adds the multipart boundary required by the server.

Request fields

fileFile
Required

The file to upload. The maximum file size is 25 MB.

accountIdstring
Required

The ID of the workspace that owns the file.

displayNamestring

The name displayed for the file. If omitted, the API uses the original file name.

Response

idstring

The unique identifier for the stored file.

namestring

The display name assigned to the file.

sizenumber

The file size in bytes.

file_typestring

The file MIME type.

created_atstring

The file creation timestamp in ISO 8601 format.

account_idstring

The ID of the workspace that owns the file.

Retrieve a file URL

GET /api/files generates a signed Supabase Storage URL for a file. The URL remains valid for 10 minutes.

Request

Query parameters

query
fileIdstring
Required

The ID of the file to retrieve.

query
accountIdstring
Required

The ID of the workspace that owns the file.

Response

urlstring

A signed storage URL that can be used to download or display the file. The URL expires after 10 minutes.

Treat signed URLs as temporary credentials. Do not store them as permanent file references. Request a new URL when the current URL expires.

Delete a file

DELETE /api/files removes a file from both storage and the workspace file records.

Request

Query parameters

query
fileIdstring
Required

The ID of the file to delete.

query
accountIdstring
Required

The ID of the workspace that owns the file.

Response

successboolean

Indicates that the storage object and database row were deleted.

Deletion is permanent. The API removes both the stored file and its database record, and you cannot use a previously generated signed URL afterward.

Errors

The file endpoints return these errors when a request cannot be completed:

StatusConditionTypical response
400Required fields or query parameters are missingfile and accountId are required or fileId and accountId are required
400The uploaded file exceeds 25 MBFile is too large (max 25 MB).
403The authenticated user cannot access the workspaceUnauthorized
404The file does not exist or belongs to another workspaceFile not found
500Storage, signing, or database operation failedEndpoint-specific error message
Was this page helpful?