1. Overview
  2. Public API
  3. Parsio Public API

Parsio Public API

Related articles:

API Base

All the API endpoints described in this article are relative to the base URL:

https://api.parsio.io

Authentication

To access the API, you will need the API key that you will find in your account:

This API key should be included in the X-API-Key HTTP header.

Unauthenticated responses will return in a HTTP 401 Unauthorized code.

Here's a request example using cURL:

curl -X GET https://api.parsio.io/mailboxes/ -H "X-API-Key: <YOUR_API_KEY>"

Manage Mailboxes

List mailboxes

GET /mailboxes

Get a mailbox

GET /mailboxes/<mailbox_id>

Create a mailbox

POST /mailboxes/create

Parameters:

  • name (string): Mailbox name

Update a mailbox

POST /mailboxes/<mailbox_id>

Parameters:

  • name (string)
  • email_prefix (string)
  • process_attachments (boolean): store or ignore email attachments
  • collect_emails (boolean): collect or not email addresses automatically
  • alert_email_h (number): Email alerts frequency (in hours)

Delete a mailbox

DELETE /mailboxes/<mailbox_id>

List table fields in the mailbox

GET /mailboxes/<mailbox_id>/tableFields

Manage Documents

Create HTML and text documents

POST https://api.parsio.io/mailboxes/<mailbox_id>/doc

JSON parameters:

  • name (string): Document's name (or Subject for emails)
  • html (string): HTML content
  • text (string): Text content
  • from (string): 'From' email address (optional)
  • to (string): 'To' email address (optional)

If both provided, the HTML content has priority over TEXT content. At least one must be provided.

Related article: Parse HTML and text documents using API

Upload PDF and other files

POST /mailboxes/<mailbox_id>/upload

Upload and parse one file. Supported formats: PDF, HTML, CSV, TXT, DOCX, RTF or XML.

Max. file size: 2MB.

Parameters:

  • file (File object)

Related article: Parse PDF and files using API

List documents

GET /mailboxes/<mailbox_id>/docs

Parameters:

  • page (number)
  • from (string): 'from' date. Format: YYYY-MM-DD
  • to (string): 'to' date. Format: YYYY-MM-DD
  • q (string): search query
  • status (array of strings): Document statuses. Accepted values: parsed, fail, skipped, new, quota, parsing, exception.

Get a document

GET /docs/<document_id>

This endpoint allows to retrieve the parsed data as JSON but we highly recommend using webhooks for real-time data sending instead.

Parse a document

POST /docs/<document_id>/parse

Skip many documents

POST /mailboxes/<mailbox_id>/docs/skip

Parameters:

  • ids (array of strings): Document IDs to skip

Manage Templates

List templates

GET /mailboxes/:mb_id/templates

Parameters:

  • page (number)

Get a template

GET /templates/<template_id>

Enable templates

POST /templates/enable_many

Parameters:

  • ids (array of strings)

Disable templates

POST /templates/disable_many

Parameters:

  • ids (array of strings)

Delete templates

DELETE /templates

Parameters:

  • ids (array of strings)

Manage Webhooks

List webhooks

GET /webhooks/mb/<mailbox_id>

Get a webhook

GET /webhooks/<webhook_id>

Create a webhook

POST /webhooks/<mailbox_id>

Parameters:

  • url (string): webhook URL
  • event (string): trigger event. Accepted values: doc.parsed, doc.parsed.flat, doc.fail, doc.received, table.parsed
  • enabled (boolean)
  • table_id (string): Table ID, only for the 'table.parsed' event.

Update a webhook

POST /webhooks

Parameters:

  • _id (string): webhook ID
  • url (string): webhook URL
  • event (string): trigger event. Accepted values: doc.parsed, doc.parsed.flat, doc.fail, doc.received, table.parsed
  • enabled (boolean)
  • table_id (string): Table ID, only for the 'table.parsed' event.

Delete webhooks

DELETE /webhooks

Parameters:

  • ids (array of strings): Webhook IDs to delete

Manage Parsed Data

Get parsed data

GET /mailboxes/<mailbox_id>/parsed

Parameters:

  • page (number)
  • from (string): 'from' date. Format: YYYY-MM-DD
  • to (string): 'to' date. Format: YYYY-MM-DD

List collected emails

GET /mailboxes/<mailbox_id>/emails

 

Did we miss something? Let us know!

Was this article helpful?
© 2024 Parsio Knowledge Base