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.comAuthentication 
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 
| Header | Type | Required | Description | 
|---|---|---|---|
X-API-KEY | string | Yes | API access key | 
Request Parameters 
| Parameter | Type | Required | Description | 
|---|---|---|---|
file | File (binary) | Yes | File to process (PDF or image) | 
yaml_file | File (binary) | Yes | YAML file describing fields to extract | 
Supported File Types 
Input formats:
- 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 
| Code | Description | When to use | 
|---|---|---|
| 200 | Success | Request processed successfully | 
| 400 | Bad Request | Invalid parameters or unsupported format | 
| 401 | Unauthorized | Missing or invalid API key | 
| 402 | Payment Required | Expired subscription or insufficient credits | 
| 422 | Validation Error | Invalid request data | 
| 500 | Internal Error | Server-side error | 
| 503 | Service Unavailable | API temporarily unavailable | 
Data Formats 
Input Format 
Files must be sent as multipart/form-data with the fields:
file: The file to processyaml_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