Introduction
Welcome to the NAHITA API documentation. You can use our REST API to access NAHITA's robust document processing engine directly from your applications.
Base URL: http://127.0.0.1:5000/v1 (Localhost)
Authentication
NAHITA uses API keys to allow access to the API. You must include your API key in the Authorization header of every request.
Authorization Header Format
Authorization: Bearer nk_live_YOUR_API_KEY
Security Warning: Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
POST
/pdf/merge
Combines multiple PDF files into a single document. The order of the files in the request determines the order in the output PDF.
Request Body (Multipart/Form-Data)
| Parameter | Type | Description |
|---|---|---|
| files | Binary | The PDF files to merge. Must provide at least 2 files. |
Example Request (Python)
import requests
url = "http://127.0.0.1:5000/v1/pdf/merge"
payload = {}
files = [
('files', open('part1.pdf','rb')),
('files', open('part2.pdf','rb')),
('files', open('part3.pdf','rb'))
]
headers = {
'Authorization': 'Bearer nk_live_728a9s8d7f6g5h4j3k2l'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
# Save the result
if response.status_code == 200:
with open('merged_result.pdf', 'wb') as f:
f.write(response.content)
print("Success! PDF saved.")
else:
print(response.text)