Parsevault API
Extract structured data from any financial document using our AI-powered API
Overview
The Parsevault AI Document Intelligence API allows you to programmatically extract structured data from financial documents in PDF, JPG, PNG, or TIFF formats into structured formats like CSV, Excel, QuickBooks Online, Xero, or Word.
This enterprise-grade API is available to premium users and requires authentication using secure API tokens.
https://parsevault.com/api
Authentication
API Token Authentication
All API requests must include an API token for authentication. Tokens can be generated in your account dashboard under the API Tokens section.
How to Generate an API Token
- Log in to your account
- Navigate to the API Tokens section in your dashboard
- Click "Create New Token" and provide a name for your token
- Copy and securely store the generated token (it will only be shown once)
Using Your API Token
Include your API token in the Authorization header of your requests:
Authorization: Bearer YOUR_API_TOKEN
API Endpoints
Endpoint | Method | Description |
---|---|---|
/api/upload | POST | Upload bank statements for conversion |
/api/conversion-status/{jobId} | GET | Check the status of a conversion job |
/api/user | GET | Get information about the authenticated user |
Upload Endpoint
POST /api/upload
This endpoint allows you to upload bank statements for conversion. The conversion process is asynchronous, and you'll receive a job ID to check the status later.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
format | string | Yes | Output format: csv , excel , qb_online , xero , or word |
statement | file array | Yes | Bank statement files (PDF, JPG, PNG, or TIFF) |
separate_debit_credit | boolean | No | Whether to separate debit and credit columns (default: false) |
combine_files | boolean | No | Whether to combine multiple files into a single output (default: false) |
Status Endpoint
GET /api/conversion-status/{jobId}
This endpoint allows you to check the status of a conversion job. You should poll this endpoint until the job is completed.
Path Parameters
Parameter | Type | Description |
---|---|---|
jobId | string | The job ID returned from the upload endpoint |
User Endpoint
GET /api/user
This endpoint returns information about the authenticated user, including subscription status and available credits.
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of requests.
Status Code | Description |
---|---|
200 OK | The request was successful |
400 Bad Request | The request was invalid or missing required parameters |
401 Unauthorized | Authentication failed or token is invalid |
403 Forbidden | The authenticated user doesn't have permission to access the resource |
422 Unprocessable Entity | Validation errors occurred |
500 Internal Server Error | An error occurred on the server |
Rate Limits
To ensure fair usage of the API, rate limits are applied based on your subscription plan:
- Premium users: 100 requests per minute
- Maximum file size: 20MB per file
- Maximum files per request: 5 files
Code Examples
1// Upload a bank statement file
2const axios = require('axios');
3const FormData = require('form-data');
4const fs = require('fs');
5
6// Your API token from the dashboard
7const API_TOKEN = 'your_api_token_here';
8
9// Create a form data object
10const formData = new FormData();
11formData.append('format', 'csv');
12formData.append('statement', fs.createReadStream('bank_statement.pdf'));
13formData.append('separate_debit_credit', 'true');
14formData.append('combine_files', 'false');
15
16// Make the API request
17axios.post('https://parsevault.com/api/upload', formData, {
18 headers: {
19 'Authorization': `Bearer ${API_TOKEN}`,
20 ...formData.getHeaders()
21 }
22})
23.then(response => {
24 const jobId = response.data.job_id;
25 console.log(`Conversion job started with ID: ${jobId}`);
26
27 // Poll for job status
28 checkJobStatus(jobId);
29})
30.catch(error => {
31 console.error('Error uploading file:', error.response ? error.response.data : error.message);
32});
33
34// Function to check job status
35function checkJobStatus(jobId) {
36 axios.get(`https://parsevault.com/api/conversion-status/${jobId}`, {
37 headers: {
38 'Authorization': `Bearer ${API_TOKEN}`
39 }
40 })
41 .then(response => {
42 console.log('Job status:', response.data.status);
43
44 if (response.data.status === 'completed') {
45 console.log('Download URL:', response.data.download_url);
46 // Download the converted file
47 downloadFile(response.data.download_url);
48 } else if (response.data.status === 'processing') {
49 // Check again after 5 seconds
50 setTimeout(() => checkJobStatus(jobId), 5000);
51 }
52 })
53 .catch(error => {
54 console.error('Error checking job status:', error.response ? error.response.data : error.message);
55 });
56}
57
58// Function to download the converted file
59function downloadFile(url) {
60 const outputPath = 'converted_statement.csv';
61
62 axios({
63 method: 'get',
64 url: url,
65 responseType: 'stream',
66 headers: {
67 'Authorization': `Bearer ${API_TOKEN}`
68 }
69 })
70 .then(response => {
71 response.data.pipe(fs.createWriteStream(outputPath));
72 console.log(`File downloaded to ${outputPath}`);
73 })
74 .catch(error => {
75 console.error('Error downloading file:', error.message);
76 });
77}