Upload and queue a document for async processing
const url = 'https://api.yggy.tech/api/v1/documents/upload';const form = new FormData();form.append('file', 'file');form.append('text', 'example');form.append('noteKind', 'capture');form.append('parentNoteId', 'example');form.append('forLinkId', 'example');form.append('title', 'example');form.append('source', 'example');form.append('originSystem', 'example');form.append('projectId', 'example');form.append('desiredTier', 'auto');form.append('inferenceMode', 'cloud');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.yggy.tech/api/v1/documents/upload \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@file \ --form text=example \ --form noteKind=capture \ --form parentNoteId=example \ --form forLinkId=example \ --form title=example \ --form source=example \ --form originSystem=example \ --form projectId=example \ --form desiredTier=auto \ --form inferenceMode=cloudUploads a document to storage and queues it for processing via a durable workflow. Returns immediately with a documentId that can be used to track processing status via SSE. Processing happens in the background and includes OCR, AI extraction, and graph insertion.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Request Body
Section titled “Request Body ”object
The document file to upload. Optional when text is set.
Plain text or markdown body. Used when no file is uploaded.
Note kind. When set, the upload is stored on the caller’s personal organization.
Yggy notes: attach the file to this note. The file becomes a document of its own that belongs to the note, and needs a file.
Yggy Notes: the link attachment of the same note this file was uploaded for (its audio, for a transcript). Needs parentNoteId.
Document title
Source identifier
Business system the data originates from
Project ID to bind the document to at upload time
Model tier for extraction. Defaults to auto.
Inference routing for extraction. Defaults to org settings.
Responses
Section titled “ Responses ”Document queued for processing
object
Stored: saved without analysis because the account has no credits
Example
{ "status": "queued"}Invalid request
object
Example
{ "success": false}Failed to queue document
object
Example
{ "success": false}