For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
  • Contact Management
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
      • GETGet all files
      • POSTUpload a file
      • GETDownload a file
      • DELDelete a file
      • GETGet file details
  • Conversations
  • Ecommerce
  • Loyalty
LogoLogo
Help CenterAPI KeysStatusSign In
Sales CRMFiles

Upload a file

POST
https://api.brevo.com/v3/crm/files
POST
/v3/crm/files
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.files.uploadAFile(, {});
8}
9main();
1{
2 "id": "61a5ce58c5d4795761045991",
3 "name": "example.png",
4 "authorId": "61a5ce58c5d4795761045991",
5 "contactId": 1,
6 "dealId": "61a5ce58c5d4795761045991",
7 "companyId": "61a5ce58c5d4795761045991",
8 "size": 10,
9 "createdAt": "2017-05-01T17:05:03.000Z"
10}
Upload a file and associate it with a contact, company, or deal. The file must be sent as multipart form data with a maximum size of 10 MB. You can optionally link the file to a specific entity by providing the corresponding entity ID.
Was this page helpful?
Previous

Download a file

Next
Built with

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Request

This endpoint expects a multipart form containing a file.
companyIdstringOptional
contactIdlongOptional
dealIdstringOptional
filefileRequired
File data to create a file.

Response

Returns the created File with additional details
idstring
Unique file id
namestring
Name of uploaded file
authorIdstring
Account id of user which created the file
contactIdlong
Contact id of contact on which file is uploaded
dealIdstring
Deal id linked to a file
companyIdstring
Company id linked to a file
sizelong
Size of file in bytes
createdAtdatetime

File created date/time

Errors

400
Bad Request Error