OverviewProductsPlatformsAPI ReferenceResources
Meta Business Agent

Upload a knowledge file

POSThttps://zernio.com/api/v1/accounts/{accountId}/business-agent/files

Uploads a knowledge file. Not idempotent.

Accepted types: pdf, doc, docx, png, jpg, jpeg, plus csv and xlsx when Meta enabled extraction on the asset. Meta's limit is 100 MB.

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Path parameters

accountIdstringRequired

WhatsApp social account id (the number must be managed through the Cloud API).

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

Responses

Success· the request worked

Errors· the request failed

How it behaves

Two ways to send the file

  • JSON { url, fileName }: Zernio downloads the file (public https URL, no redirects, capped at 100 MB) and forwards it. Use this for anything above a few megabytes.
  • multipart form-data with a file part (and an optional fileName): bounded by the request body limit of about 4.5 MB. Larger uploads must use the url form.
POST/v1/accounts/{accountId}/business-agent/files
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.businessagent.uploadBusinessAgentFile({  path: {    accountId: 'account_abc123',  },  body: {    url: 'https://example.com',  },});console.log(data);
{  "id": "string",  "file_name": "string"}
OpenAPI specification
Was this page helpful?