Skip to content

API Endpoints Reference

This page documents in detail all available endpoints in the ParseMyFile API.

Base URL

All endpoints are accessible via the base URL:

https://api.parsemyfile.com

Authentication

All endpoints (except /health) require a valid API key in the X-API-KEY header.

Endpoints

POST /api/v1/generate

Processes a file and generates JSON according to the provided YAML configuration.

Description

This endpoint accepts a file (PDF, DOCX, XLSX or image) and a YAML configuration file, then extracts the specified data and returns it in JSON format.

Required Headers

HeaderTypeRequiredDescription
X-API-KEYstringYesAPI access key

Request Parameters

ParameterTypeRequiredDescription
fileFile (binary)YesFile to process (PDF or image)
yaml_fileFile (binary)YesYAML file describing fields to extract

Supported File Types

Input formats:

  • PDF
  • JPG, JPEG
  • PNG
  • DOCX
  • XLSX
  • TEXT

Limits:

  • Maximum size: 1-100 MB

Request Example

bash
curl -X POST "https://api.parsemyfile.com/api/v1/generate" \
  -H "X-API-KEY: your_api_key_here" \
  -H "Content-type: multipart/form-data"
  -F "file=@document.pdf" \
  -F "yaml_file=@configuration.yaml"

Responses

200 - Success
json
{
  "execution_time": "1.5",
  "status": "success",
  "data": {
    "client": {
      "name": "John Doe",
      "email": "john.doe@example.com",
      "phone": "0123456789",
      "address": "123 Peace Street, 75001 Paris"
    }
  }
}
For error details see the Error Handling section

GET /health

Checks the API health status.

Description

This endpoint allows you to verify that the API is working correctly and is accessible.

Required Headers

No headers required.

Parameters

No parameters required.

Request Example

bash
curl -X GET "https://api.parsemyfile.com/health"

Responses

200 - API Healthy
json
{
  "status": "healthy",
  "timestamp": "2024-01-15T10:30:00Z",
  "version": "1.0.0",
}

HTTP Status Codes

CodeDescriptionWhen to use
200SuccessRequest processed successfully
400Bad RequestInvalid parameters or unsupported format
401UnauthorizedMissing or invalid API key
402Payment RequiredExpired subscription or insufficient credits
422Validation ErrorInvalid request data
500Internal ErrorServer-side error
503Service UnavailableAPI temporarily unavailable

Data Formats

Input Format

Files must be sent as multipart/form-data with the fields:

  • file: The file to process
  • yaml_file: The YAML configuration

Output Format

All responses are in JSON format with UTF-8 encoding.

Response Structure

Success Response

json
{
  "execution_time": 2.333,
  "status": "success|error",
  "data": {
   /* Information extracted from document */
  },
  
}

Error Response

json
{
  "details": { /* Additional details */ }
}

Security

Authentication

  • Use HTTPS for all requests
  • Keep your API key secret
  • Never commit your API key in source code
  • Use environment variables to store the key

Data Validation

  • The API automatically validates all input parameters
  • The API does not guarantee the accuracy of returned information

Privacy

  • Files are not stored
  • No data is stored
  • Logs do not contain sensitive information

ParseMyFile API Documentation