POST /file error

Hi,

I'm trying to use the POST /file endpoint to upload files for the knowledge base from Coda. However, when I'm using the endpoint to send file data as a buffer, I get an error. Here's the Node.js code I'm trying to use (note that context.fetcher.fetch() is a Coda-specific fetch function):

const form = new FormData(); form.append("file", knowledgeBaseText); let response = await context.fetcher.fetch({ url: "https://api.vapi.ai/file", method: "POST", headers: { ...form.getHeaders() }, body: form.getBuffer(), });
However, when I use getBuffer, I get an error:

400 - {"message":"File is required","error":"Bad Request","statusCode":400}

Is it possible to have the POST /file endpoint accept the form buffer? I'm not able to send in the form as the body, and I'd like to have the buffer and the entire form work interchangeably.

Thanks in advance for the help,
Was this page helpful?