No matching endpoints
API Reference
The Apdf API has two parts. Pick the one you need:
Send PDFs as personal links, see how each recipient reads them, collect their signatures and trigger automations on their activity.
The base URL for all API endpoints is:
https://apdf.io/api
Authentication
The Apdf API uses API tokens to authenticate requests. You can view and manage your API tokens in your account.
The API token should be included in the request as a bearer token value. To check a token and see which account it acts as, retrieve your account.
curl https://apdf.io/api \
-H "Authorization: Bearer TOKEN"
Headers
Make sure you have the following content type headers are set on every request:
Accept: application/json
Content-Type: application/json
Pagination
All list endpoints return paginated results wrapped in a data array, accompanied by meta and links objects with navigation details.
Use the page and per_page query parameters to control which page is returned and how many items it contains.
{
"data": [
...
],
"meta": {
"total": 75,
"per_page": 25,
"from": 1,
"to": 25,
"current_page": 1,
"last_page": 3,
"path": "https://apdf.io/api/docs",
"links": [
{
"url": null,
"label": "« Previous",
"page": null,
"active": false
},
{
"url": "https://apdf.io/api/docs?page=1",
"label": "1",
"page": 1,
"active": true
},
{
"url": "https://apdf.io/api/docs?page=2",
"label": "2",
"page": 2,
"active": false
},
{
"url": "https://apdf.io/api/docs?page=3",
"label": "3",
"page": 3,
"active": false
},
{
"url": "https://apdf.io/api/docs?page=2",
"label": "Next »",
"page": 2,
"active": false
}
]
},
"links": {
"first": "https://apdf.io/api/docs?page=1",
"last": "https://apdf.io/api/docs?page=3",
"prev": null,
"next": "https://apdf.io/api/docs?page=2"
}
}
Limitations
To ensure smooth and reliable API operation for all users, a few usage limitations are in place:
- Each API user is limited to 10 requests per second, up to 300 requests per minute
- Generated PDF files are stored for 60 min. before being automatically deleted
- Uploaded PDF files must not exceed 100 MB in size
Retrieve your account
Get the user and workspace of the API token
Request
curl -X GET https://apdf.io/api/me \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/me', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/me', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/me',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/me',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/me")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/me")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"user": {
"email": "jane@acme.com",
"name": ""
},
"workspace": {
"id": "762d0-ef7db-87d6d",
"handle": "acme",
"name": null,
"plan": {
"name": "Pro",
"tracked_documents": 100,
"trial_ends_at": null
}
}
}
}
PDF Engagement API
Send PDFs as personal links, see how each recipient reads them, collect their signatures and trigger automations on their activity.
List all documents
Get a list of your documents
Parameters
| Parameter | Required | Description |
|---|---|---|
| status | no | Filter by archive state. One of active (default), archived, or all |
Request
curl -X GET https://apdf.io/api/docs \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": [
{
"doc_id": "68052-a7bc5-62b0b",
"viewer_url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b",
"file_url": "https://apdf-files.s3.eu-central-1.amazonaws.com/docs/202604/35c779f069e68fefec5eb.pdf",
"name": "Doe_Company_Personalized_Offer_2026",
"file_size": 165310,
"file_pages": 12,
"is_public": false,
"created_at": "2026-04-20T20:43:28.000000Z",
"archived_at": null
}
],
"links": {...},
"meta": {...}
}
Create a document
Create a new trackable document from the given PDF
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| name | yes | Name for the document |
Request
curl -X POST https://apdf.io/api/docs \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d name="DOCUMENT_NAME"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('name', 'DOCUMENT_NAME');
fetch('https://apdf.io/api/docs', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'name' => 'DOCUMENT_NAME'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs',
{
'file' => 'FILE_URL',
'name' => 'DOCUMENT_NAME'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'name': 'DOCUMENT_NAME'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"name": "DOCUMENT_NAME"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("name", "DOCUMENT_NAME")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"doc_id": "8b25b-86755-9f9af",
"viewer_url": "https://docs.apdf.io/acme/8b25b-86755-9f9af",
"file_url": "https://apdf-files.s3.eu-central-1.amazonaws.com/docs/202604/83a3cf4c69e7864ca4c44.pdf",
"name": "Proposal_2026_04_AcmeCompany",
"file_size": 1247378,
"file_pages": 9,
"is_public": false,
"created_at": "2026-04-21T14:14:37.000000Z",
"archived_at": null
}
}
Retrieve a document
Get a single document by its ID
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"doc_id": "68052-a7bc5-62b0b",
"viewer_url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b",
"file_url": "https://apdf-files.s3.eu-central-1.amazonaws.com/docs/202604/35c779f069e68fefec5eb.pdf",
"name": "Doe_Company_Personalized_Offer_2026",
"file_size": 165310,
"file_pages": 12,
"is_public": false,
"created_at": "2026-04-20T20:43:28.000000Z",
"archived_at": null
}
}
Archive a document
Archive a document
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/archive \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/archive', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/archive', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/archive',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/archive',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/archive")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/archive")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"doc_id": "68052-a7bc5-62b0b",
"viewer_url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b",
"file_url": "https://apdf-files.s3.eu-central-1.amazonaws.com/docs/202604/35c779f069e68fefec5eb.pdf",
"name": "Doe_Company_Personalized_Offer_2026",
"file_size": 165310,
"file_pages": 12,
"is_public": false,
"created_at": "2026-04-20T20:43:28.000000Z",
"archived_at": "2026-05-21T09:14:02.000000Z"
}
}
Unarchive a document
Restore a previously archived document
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/unarchive \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/unarchive', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/unarchive', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/unarchive',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/unarchive',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/unarchive")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/unarchive")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"doc_id": "68052-a7bc5-62b0b",
"viewer_url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b",
"file_url": "https://apdf-files.s3.eu-central-1.amazonaws.com/docs/202604/35c779f069e68fefec5eb.pdf",
"name": "Doe_Company_Personalized_Offer_2026",
"file_size": 165310,
"file_pages": 12,
"is_public": false,
"created_at": "2026-04-20T20:43:28.000000Z",
"archived_at": null
}
}
Make a document public
Make a document viewable without a recipient link
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/public \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/public', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/public', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/public',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/public',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/public")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/public")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"doc_id": "68052-a7bc5-62b0b",
"viewer_url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b",
"file_url": "https://apdf-files.s3.eu-central-1.amazonaws.com/docs/202604/35c779f069e68fefec5eb.pdf",
"name": "Doe_Company_Personalized_Offer_2026",
"file_size": 165310,
"file_pages": 12,
"is_public": true,
"created_at": "2026-04-20T20:43:28.000000Z",
"archived_at": null
}
}
Make a document private
Make a document viewable only through a recipient link
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/private \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/private', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/private', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/private',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/private',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/private")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/private")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"doc_id": "68052-a7bc5-62b0b",
"viewer_url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b",
"file_url": "https://apdf-files.s3.eu-central-1.amazonaws.com/docs/202604/35c779f069e68fefec5eb.pdf",
"name": "Doe_Company_Personalized_Offer_2026",
"file_size": 165310,
"file_pages": 12,
"is_public": false,
"created_at": "2026-04-20T20:43:28.000000Z",
"archived_at": null
}
}
Delete a document
Delete a document and its underlying PDF file
Request
curl -X DELETE https://apdf.io/api/docs/68052-a7bc5-62b0b \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'DELETE',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->delete(
'https://apdf.io/api/docs/68052-a7bc5-62b0b', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.delete(
'https://apdf.io/api/docs/68052-a7bc5-62b0b',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.delete(
'https://apdf.io/api/docs/68052-a7bc5-62b0b',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Delete("https://apdf.io/api/docs/68052-a7bc5-62b0b")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b")
.addHeader("Authorization", "Bearer TOKEN")
.delete(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON[]
List all recipient links
Get a list of all recipient links for a document
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b/links \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/links', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b/links")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/links")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": [
{
"token": "fi6WgjyH",
"name": "John Doe",
"email": "john.doe@example.com",
"url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b?v=fi6WgjyH",
"is_active": true,
"last_viewed_at": "2026-04-21T09:12:44.000000Z",
"created_at": "2026-04-20T20:43:28.000000Z"
}
],
"links": {...},
"meta": {...}
}
Create a recipient link
Create a new recipient link for a document
Parameters
| Parameter | Required | Description |
|---|---|---|
| name | yes | Name of the recipient |
| no | Email of the recipient |
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/links \
-H "Authorization: Bearer TOKEN" \
-d name="RECIPIENT_NAME" \
-d email="RECIPIENT_EMAIL"
const data = new FormData();
data.append('name', 'RECIPIENT_NAME');
data.append('email', 'RECIPIENT_EMAIL');
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/links', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'name' => 'RECIPIENT_NAME',
'email' => 'RECIPIENT_EMAIL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links',
{
'name' => 'RECIPIENT_NAME',
'email' => 'RECIPIENT_EMAIL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'name': 'RECIPIENT_NAME',
'email': 'RECIPIENT_EMAIL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"name": "RECIPIENT_NAME",
"email": "RECIPIENT_EMAIL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/links")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("name", "RECIPIENT_NAME")
.add("email", "RECIPIENT_EMAIL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/links")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"token": "fi6WgjyH",
"name": "John Doe",
"email": "john.doe@example.com",
"url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b?v=fi6WgjyH",
"is_active": true,
"last_viewed_at": null,
"created_at": "2026-04-21T14:14:37.000000Z"
}
}
Delete a recipient link
Delete a recipient link of a document
Request
curl -X DELETE https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'DELETE',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->delete(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.delete(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.delete(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Delete("https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH")
.addHeader("Authorization", "Bearer TOKEN")
.delete(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON[]
Activate a recipient link
Activate (enable) a recipient link of a document
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/activate \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/activate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/activate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/activate',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/activate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/activate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/activate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"token": "fi6WgjyH",
"name": "John Doe",
"email": "john.doe@example.com",
"url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b?v=fi6WgjyH",
"is_active": true,
"last_viewed_at": null,
"created_at": "2026-04-21T14:14:37.000000Z"
}
}
Deactivate a recipient link
Deactivate (disable) a recipient link of a document
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/deactivate \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/deactivate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/deactivate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/deactivate',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/deactivate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/deactivate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/links/fi6WgjyH/deactivate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"token": "fi6WgjyH",
"name": "John Doe",
"email": "john.doe@example.com",
"url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b?v=fi6WgjyH",
"is_active": false,
"last_viewed_at": null,
"created_at": "2026-04-21T14:14:37.000000Z"
}
}
Sessions with KPIs
Get aggregate KPIs across all sessions of a document
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"sessions": 4,
"unique_viewers": 3,
"avg_duration_ms": 207469,
"completion_rate": 100,
"pages_per_session": 5,
"prints": 2,
"downloads": 3,
"form_submissions": 1,
"annotations": 14
}
}
List all sessions
Get a paginated list of viewer sessions
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": [
{
"session_id": "0lLKvtyoC1nl3WD0",
"viewer_id": "OLHe7I5rXTBz",
"recipient": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"device_type": "desktop",
"browser": "Firefox",
"os": "Ubuntu",
"referer": null,
"utm_source": null,
"created_at": "2026-04-21 20:23:07.394",
"pages_viewed": 6,
"total_duration_ms": 83926,
"completion_pct": 85,
"prints": 1,
"downloads": 0
}
],
"links": {...},
"meta": {...}
}
Retrieve a session
Get the full detail of a single viewer session
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions/0lLKvtyoC1nl3WD0 \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions/0lLKvtyoC1nl3WD0', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions/0lLKvtyoC1nl3WD0', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions/0lLKvtyoC1nl3WD0',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions/0lLKvtyoC1nl3WD0',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions/0lLKvtyoC1nl3WD0")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/analytics/sessions/0lLKvtyoC1nl3WD0")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"session": {
"session_id": "0lLKvtyoC1nl3WD0",
"viewer_id": "OLHe7I5rXTBz",
"recipient": {
"name": "John Doe",
"email": "john.doe@example.com"
},
...
},
"metrics": {
"total_duration_ms": 89364,
"pages_viewed": 3,
"total_pages": 3,
"completion_pct": 100,
"downloads": 0,
"prints": 1
},
"pages": [
{
"page": 1,
"views": 3,
"duration_ms": 85730,
"viewed": true
},
{
"page": 2,
"views": 2,
"duration_ms": 797,
"viewed": true
},
{
"page": 3,
"views": 1,
"duration_ms": 2837,
"viewed": true
}
],
"events": [
{
"event": "document:loaded",
"page": null,
"duration_ms": null,
"total_pages": 3,
"payload": {
"numPages": 3
},
"created_at": "2026-04-21 20:56:24.177"
},
{
"event": "page:enter",
"page": 1,
"duration_ms": null,
"total_pages": 3,
"payload": {
"page": 1,
"total": 3
},
"created_at": "2026-04-21 20:56:24.702"
},
{
"event": "annotation:update",
"page": 1,
"duration_ms": null,
"total_pages": null,
"payload": {
"annotation_id": "annot_1776805002364_5uxvr3fcx",
"type": "highlight",
"comment": "Thanks for the offer, let's talk",
"author": "John Doe"
},
"created_at": "2026-04-21 20:57:12.118"
},
{
"event": "document:print",
"page": null,
"duration_ms": null,
"total_pages": null,
"payload": null,
"created_at": "2026-04-21 20:57:44.220"
},
{
"event": "page:leave",
"page": 3,
"duration_ms": 2837,
"total_pages": null,
"payload": {
"page": 3,
"duration": 2837
},
"created_at": "2026-04-21 20:57:52.581"
}
]
}
}
List all annotations
Get all annotations on a document
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": [
{
"annotation_id": "annot_1776805044335_stzuj7fyu",
"page": 1,
"type": "underline",
"creator_id": "OLHe7I5rXTBz",
"recipient": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"annotated_text": "Proposed timeline: 3 months",
"comment_author": "John Doe",
"comment_text": "This needs adjustments",
"replies": [],
"created_at": "2026-04-21T20:57:24.000000Z"
},
{
"annotation_id": "annot_1776805002364_5uxvr3fcx",
"page": 1,
"type": "highlight",
"creator_id": "OLHe7I5rXTBz",
"recipient": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"annotated_text": "Your personalized Offer",
"comment_author": "John Doe",
"comment_text": "Thanks for the offer, let's talk",
"replies": [
{
"author": "Jane Smith",
"text": "Happy to! How about Thursday at 10:00?",
"created_at": "2026-04-22T09:14:03.000000Z"
}
],
"created_at": "2026-04-21T20:56:42.000000Z"
}
],
"links": {...},
"meta": {...}
}
Add a comment
Add a comment to an annotation: the opening comment if it has none yet, otherwise a reply. Comments added through the API don't trigger automations.
Parameters
| Parameter | Required | Description |
|---|---|---|
| author | yes | Name shown as the comment author |
| text | yes | The comment text |
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations/annot_1776805002364_5uxvr3fcx/comments \
-H "Authorization: Bearer TOKEN" \
-d author="AUTHOR_NAME" \
-d text="COMMENT_TEXT"
const data = new FormData();
data.append('author', 'AUTHOR_NAME');
data.append('text', 'COMMENT_TEXT');
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations/annot_1776805002364_5uxvr3fcx/comments', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations/annot_1776805002364_5uxvr3fcx/comments', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'author' => 'AUTHOR_NAME',
'text' => 'COMMENT_TEXT'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations/annot_1776805002364_5uxvr3fcx/comments',
{
'author' => 'AUTHOR_NAME',
'text' => 'COMMENT_TEXT'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations/annot_1776805002364_5uxvr3fcx/comments',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'author': 'AUTHOR_NAME',
'text': 'COMMENT_TEXT'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"author": "AUTHOR_NAME",
"text": "COMMENT_TEXT"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations/annot_1776805002364_5uxvr3fcx/comments")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("author", "AUTHOR_NAME")
.add("text", "COMMENT_TEXT")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/annotations/annot_1776805002364_5uxvr3fcx/comments")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"annotation_id": "annot_1776805002364_5uxvr3fcx",
"page": 1,
"type": "highlight",
"creator_id": "OLHe7I5rXTBz",
"recipient": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"annotated_text": "Your personalized Offer",
"comment_author": "John Doe",
"comment_text": "Thanks for the offer, let's talk",
"replies": [
{
"author": "Jane Smith",
"text": "Happy to! How about Thursday at 10:00?",
"created_at": "2026-04-22T09:14:03.000000Z"
}
],
"created_at": "2026-04-21T20:56:42.000000Z"
}
}
List all form submissions
Get all form submissions of a document
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b/form-submissions \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/form-submissions', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/form-submissions', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/form-submissions',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/form-submissions',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b/form-submissions")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/form-submissions")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": [
{
"doc_id": "b75f9-6c031-a24c6",
"creator_id": "OLHe7I5rXTBz",
"recipient": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"fields": [
{
"id": "126R",
"name": "name",
"page": 1,
"type": "text",
"value": "John Doe"
},
{
"id": "127R",
"name": "email",
"page": 1,
"type": "text",
"value": "john.doe@example.com"
},
{
"id": "128R",
"name": "gender",
"page": 1,
"type": "radio",
"value": true,
"checked": true,
"exportValue": "Male"
},
{
"id": "131R",
"name": "confirmation",
"page": 2,
"type": "checkbox",
"value": true,
"checked": true,
"exportValue": "Confirm"
}
],
"created_at": "2026-04-21T21:12:45.000000Z",
"updated_at": "2026-04-21T21:12:45.000000Z"
}
],
"links": {...},
"meta": {...}
}
Create a signature request
Ask people to sign a document. Each signer signs one part of it, and the signed PDF is made once everyone signed
Parameters
| Parameter | Required | Description |
|---|---|---|
| signers | yes | Array of the signers, one per part of the document (up to 10) |
| signers[][role] | yes | The part the signer signs, like Client. Fields refer to it |
| signers[][name] | no | Name of a recipient, who signs with their own link and a code sent to their email |
| signers[][email] | no | Email of the recipient |
| signers[][link] | no | Token of an existing recipient link of the document, instead of name and email |
| signers[][member] | no | Email of a member of your workspace, who signs their own part after logging in |
| signers[][company] | no | Set company to 1 to let your company approve this part automatically once everyone else signed. Needs the company name in your account and a part without text fields |
| fields | no | Array of the fields to place. Without it, the fields placed in owner mode are used, or a single signer gets the empty signature boxes of the PDF |
| fields[][role] | yes | The part the field belongs to |
| fields[][type] | yes | Valid values: signature, initials, name, text, date. Dates are filled in with the signing date |
| fields[][anchor] | no | A text in the PDF, like [client_signature]. The field is placed at every occurrence |
| fields[][pdf_field] | no | Name of an empty signature box of the PDF to place the field on |
| fields[][page] | no | Page of the field (1-based), together with x and y in points from the top left corner |
| fields[][width] | no | Width in points, defaults to the size of the type. Same for height |
| fields[][offset_x] | no | Moves a field placed at an anchor text, in points. Same for offset_y |
| message | no | Personal message for the signers in the invitation email |
| metadata | no | Your own key/value data, like a deal ID, returned with the request and its webhooks |
| send_email | no | Set send_email to 1 to email the recipients their signing link. Members are always emailed |
How it works
- Recipients sign in the viewer and confirm with a code sent to their email, members sign after logging in. Nobody can sign for someone else through the API
- Once everyone signed, the values are stamped into the PDF, an audit trail page is added and the PDF is sealed with a timestamp. The
signature:completedevent fires andfile_urllinks to the signed PDF - A document has one pending request at a time, and its signers and fields can't change. Cancel it and create a new one instead
- Every request counts towards the signature requests of your plan per month
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request \
-H "Authorization: Bearer TOKEN" \
-d signers[0][role]="Client" \
-d signers[0][name]="John Doe" \
-d signers[0][email]="john.doe@example.com" \
-d signers[1][role]="Agency" \
-d signers[1][company]="1" \
-d fields[0][role]="Client" \
-d fields[0][type]="signature" \
-d fields[0][anchor]="[client_signature]" \
-d fields[1][role]="Client" \
-d fields[1][type]="date" \
-d fields[1][anchor]="[client_date]" \
-d fields[2][role]="Agency" \
-d fields[2][type]="signature" \
-d fields[2][anchor]="[agency_signature]" \
-d send_email="1"
const data = new FormData();
data.append('signers[0][role]', 'Client');
data.append('signers[0][name]', 'John Doe');
data.append('signers[0][email]', 'john.doe@example.com');
data.append('signers[1][role]', 'Agency');
data.append('signers[1][company]', '1');
data.append('fields[0][role]', 'Client');
data.append('fields[0][type]', 'signature');
data.append('fields[0][anchor]', '[client_signature]');
data.append('fields[1][role]', 'Client');
data.append('fields[1][type]', 'date');
data.append('fields[1][anchor]', '[client_date]');
data.append('fields[2][role]', 'Agency');
data.append('fields[2][type]', 'signature');
data.append('fields[2][anchor]', '[agency_signature]');
data.append('send_email', '1');
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'signers[0][role]' => 'Client',
'signers[0][name]' => 'John Doe',
'signers[0][email]' => 'john.doe@example.com',
'signers[1][role]' => 'Agency',
'signers[1][company]' => '1',
'fields[0][role]' => 'Client',
'fields[0][type]' => 'signature',
'fields[0][anchor]' => '[client_signature]',
'fields[1][role]' => 'Client',
'fields[1][type]' => 'date',
'fields[1][anchor]' => '[client_date]',
'fields[2][role]' => 'Agency',
'fields[2][type]' => 'signature',
'fields[2][anchor]' => '[agency_signature]',
'send_email' => '1'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request',
{
'signers[0][role]' => 'Client',
'signers[0][name]' => 'John Doe',
'signers[0][email]' => 'john.doe@example.com',
'signers[1][role]' => 'Agency',
'signers[1][company]' => '1',
'fields[0][role]' => 'Client',
'fields[0][type]' => 'signature',
'fields[0][anchor]' => '[client_signature]',
'fields[1][role]' => 'Client',
'fields[1][type]' => 'date',
'fields[1][anchor]' => '[client_date]',
'fields[2][role]' => 'Agency',
'fields[2][type]' => 'signature',
'fields[2][anchor]' => '[agency_signature]',
'send_email' => '1'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'signers[0][role]': 'Client',
'signers[0][name]': 'John Doe',
'signers[0][email]': 'john.doe@example.com',
'signers[1][role]': 'Agency',
'signers[1][company]': '1',
'fields[0][role]': 'Client',
'fields[0][type]': 'signature',
'fields[0][anchor]': '[client_signature]',
'fields[1][role]': 'Client',
'fields[1][type]': 'date',
'fields[1][anchor]': '[client_date]',
'fields[2][role]': 'Agency',
'fields[2][type]': 'signature',
'fields[2][anchor]': '[agency_signature]',
'send_email': '1'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"signers[0][role]": "Client",
"signers[0][name]": "John Doe",
"signers[0][email]": "john.doe@example.com",
"signers[1][role]": "Agency",
"signers[1][company]": "1",
"fields[0][role]": "Client",
"fields[0][type]": "signature",
"fields[0][anchor]": "[client_signature]",
"fields[1][role]": "Client",
"fields[1][type]": "date",
"fields[1][anchor]": "[client_date]",
"fields[2][role]": "Agency",
"fields[2][type]": "signature",
"fields[2][anchor]": "[agency_signature]",
"send_email": "1"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("signers[0][role]", "Client")
.add("signers[0][name]", "John Doe")
.add("signers[0][email]", "john.doe@example.com")
.add("signers[1][role]", "Agency")
.add("signers[1][company]", "1")
.add("fields[0][role]", "Client")
.add("fields[0][type]", "signature")
.add("fields[0][anchor]", "[client_signature]")
.add("fields[1][role]", "Client")
.add("fields[1][type]", "date")
.add("fields[1][anchor]", "[client_date]")
.add("fields[2][role]", "Agency")
.add("fields[2][type]", "signature")
.add("fields[2][anchor]", "[agency_signature]")
.add("send_email", "1")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"request_id": "39fe0-14d24-714bd",
"status": "pending",
"message": null,
"metadata": {
"deal_id": "D-42"
},
"send_email": true,
"signers": [
{
"type": "recipient",
"role": "Client",
"name": "John Doe",
"email": "john.doe@example.com",
"status": "pending",
"link": "fi6WgjyH",
"url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b?v=fi6WgjyH",
"signed_at": null,
"declined_at": null,
"decline_reason": null
},
{
"type": "company",
"role": "Agency",
"name": "Acme Agency",
"email": "jane.smith@acme.com",
"status": "pending",
"link": null,
"url": null,
"signed_at": null,
"declined_at": null,
"decline_reason": null
}
],
"fields": [
{
"field_id": "0f4d2c61-8a3e-4f7b-9c55-2d1e7b8a9f10",
"role": "Client",
"type": "signature",
"page": 3,
"x": 72,
"y": 640.5,
"width": 160,
"height": 40
},
{
"field_id": "6b9e1a2f-3c4d-4e5f-8a7b-1c2d3e4f5a6b",
"role": "Client",
"type": "date",
"page": 3,
"x": 72,
"y": 692.5,
"width": 100,
"height": 24
},
{
"field_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"role": "Agency",
"type": "signature",
"page": 3,
"x": 340,
"y": 640.5,
"width": 160,
"height": 40
}
],
"file_url": null,
"signed_file_hash": null,
"created_at": "2026-10-28T09:42:22.000000Z",
"completed_at": null,
"cancelled_at": null
}
}
Retrieve a signature request
Get the most recent signature request of a document, with the status of each signer and, once completed, the link to the signed PDF (valid for 7 days)
Request
curl -X GET https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"request_id": "39fe0-14d24-714bd",
"status": "completed",
"message": null,
"metadata": {
"deal_id": "D-42"
},
"send_email": true,
"signers": [
{
"type": "recipient",
"role": "Client",
"name": "John Doe",
"email": "john.doe@example.com",
"status": "signed",
"link": "fi6WgjyH",
"url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b?v=fi6WgjyH",
"signed_at": "2026-10-28T09:44:06.000000Z",
"declined_at": null,
"decline_reason": null
},
{
"type": "company",
"role": "Agency",
"name": "Acme Agency",
"email": "jane.smith@acme.com",
"status": "signed",
"link": null,
"url": null,
"signed_at": "2026-10-28T09:44:06.000000Z",
"declined_at": null,
"decline_reason": null
}
],
"fields": [
{
"field_id": "0f4d2c61-8a3e-4f7b-9c55-2d1e7b8a9f10",
"role": "Client",
"type": "signature",
"page": 3,
"x": 72,
"y": 640.5,
"width": 160,
"height": 40
},
{
"field_id": "6b9e1a2f-3c4d-4e5f-8a7b-1c2d3e4f5a6b",
"role": "Client",
"type": "date",
"page": 3,
"x": 72,
"y": 692.5,
"width": 100,
"height": 24
},
{
"field_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"role": "Agency",
"type": "signature",
"page": 3,
"x": 340,
"y": 640.5,
"width": 160,
"height": 40
}
],
"file_url": "https://docs.apdf.io/signed/39fe0-14d24-714bd?expires=1762335945&signature=5d1c0e8f3b9a47e2c6d8f1a0b3e5c7d9f2a4b6c8e0d1f3a5b7c9e1d3f5a7b9c1",
"signed_file_hash": "ec78248c3188c16e7a4000d5dd3c78e9f3110d6b316be1eef0098e228c2bcbee",
"created_at": "2026-10-28T09:42:22.000000Z",
"completed_at": "2026-10-28T09:44:08.000000Z",
"cancelled_at": null
}
}
Cancel a signature request
Withdraw the pending signature request of a document, so nobody can sign it anymore
Request
curl -X POST https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request/cancel \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request/cancel', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request/cancel', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request/cancel',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request/cancel',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request/cancel")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/docs/68052-a7bc5-62b0b/signature-request/cancel")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"request_id": "39fe0-14d24-714bd",
"status": "cancelled",
"message": null,
"metadata": {
"deal_id": "D-42"
},
"send_email": true,
"signers": [
{
"type": "recipient",
"role": "Client",
"name": "John Doe",
"email": "john.doe@example.com",
"status": "pending",
"link": "fi6WgjyH",
"url": "https://docs.apdf.io/acme/68052-a7bc5-62b0b?v=fi6WgjyH",
"signed_at": null,
"declined_at": null,
"decline_reason": null
},
{
"type": "company",
"role": "Agency",
"name": "Acme Agency",
"email": "jane.smith@acme.com",
"status": "pending",
"link": null,
"url": null,
"signed_at": null,
"declined_at": null,
"decline_reason": null
}
],
"fields": [
{
"field_id": "0f4d2c61-8a3e-4f7b-9c55-2d1e7b8a9f10",
"role": "Client",
"type": "signature",
"page": 3,
"x": 72,
"y": 640.5,
"width": 160,
"height": 40
},
{
"field_id": "6b9e1a2f-3c4d-4e5f-8a7b-1c2d3e4f5a6b",
"role": "Client",
"type": "date",
"page": 3,
"x": 72,
"y": 692.5,
"width": 100,
"height": 24
},
{
"field_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"role": "Agency",
"type": "signature",
"page": 3,
"x": 340,
"y": 640.5,
"width": 160,
"height": 40
}
],
"file_url": null,
"signed_file_hash": null,
"created_at": "2026-10-28T09:42:22.000000Z",
"completed_at": null,
"cancelled_at": "2026-10-28T10:15:31.000000Z"
}
}
List all automations
Get a list of your automations
Request
curl -X GET https://apdf.io/api/automations \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/automations', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/automations', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/automations',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/automations',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/automations")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": [
{
"id": "d4a0d-ab87b-88b6b",
"name": "Ping CRM on document open",
"is_active": true,
"scope": "all",
"doc_ids": [],
"trigger": {
"events": [
"document:loaded"
],
"conditions": []
},
"actions": [
{
"type": "webhook",
"config": {
"url": "https://crm.acme.com/webhook/document-opened",
"headers": []
}
}
],
"created_at": "2026-04-22T15:08:51.000000Z"
}
],
"links": {...},
"meta": {...}
}
Create an automation
Create a when/filter/then rule that posts reader events to your endpoint
Parameters
| Parameter | Required | Description |
|---|---|---|
| name | yes | Name of the automation |
| scope | no | Which documents to watch. One of all (default) or specific |
| doc_ids | no | Array of document IDs to watch. Required when scope is specific, ignored otherwise |
| events | yes | Array of reader events that trigger the automation, matched with OR. Pass * as the only entry for every event. Valid values: document:loaded, document:download, document:print, page:enter, page:read, page:leave, text:copied, link:clicked, form:submit, annotation:create, annotation:update, annotation:delete, signature:signed, signature:declined, signature:completed |
| conditions | no | Array of filters that must all pass for the webhook to fire. Not available for * |
| conditions[][type] | yes | Valid values: page_number, time_on_page (seconds), total_reading_time (seconds), pages_viewed, completion_rate (percent). Only accepted when one of the given events supplies it |
| conditions[][value] | yes | Minimum the condition compares against, in the unit of its type |
| webhook_url | yes | URL that receives the POST request when the automation fires |
| webhook_headers | no | Object of additional headers for the webhook request, e.g. webhook_headers[Authorization] |
Request
curl -X POST https://apdf.io/api/automations \
-H "Authorization: Bearer TOKEN" \
-d name="Notify sales on pricing read" \
-d scope="specific" \
-d doc_ids[0]="48927-c7621-ec3c0" \
-d events[0]="page:read" \
-d conditions[0][type]="page_number" \
-d conditions[0][value]="7" \
-d conditions[1][type]="time_on_page" \
-d conditions[1][value]="30" \
-d webhook_url="https://crm.acme.com/webhook/pricing-read" \
-d webhook_headers[Authorization]="Bearer YOUR_SECRET"
const data = new FormData();
data.append('name', 'Notify sales on pricing read');
data.append('scope', 'specific');
data.append('doc_ids[0]', '48927-c7621-ec3c0');
data.append('events[0]', 'page:read');
data.append('conditions[0][type]', 'page_number');
data.append('conditions[0][value]', '7');
data.append('conditions[1][type]', 'time_on_page');
data.append('conditions[1][value]', '30');
data.append('webhook_url', 'https://crm.acme.com/webhook/pricing-read');
data.append('webhook_headers[Authorization]', 'Bearer YOUR_SECRET');
fetch('https://apdf.io/api/automations', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/automations', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'name' => 'Notify sales on pricing read',
'scope' => 'specific',
'doc_ids[0]' => '48927-c7621-ec3c0',
'events[0]' => 'page:read',
'conditions[0][type]' => 'page_number',
'conditions[0][value]' => '7',
'conditions[1][type]' => 'time_on_page',
'conditions[1][value]' => '30',
'webhook_url' => 'https://crm.acme.com/webhook/pricing-read',
'webhook_headers[Authorization]' => 'Bearer YOUR_SECRET'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/automations',
{
'name' => 'Notify sales on pricing read',
'scope' => 'specific',
'doc_ids[0]' => '48927-c7621-ec3c0',
'events[0]' => 'page:read',
'conditions[0][type]' => 'page_number',
'conditions[0][value]' => '7',
'conditions[1][type]' => 'time_on_page',
'conditions[1][value]' => '30',
'webhook_url' => 'https://crm.acme.com/webhook/pricing-read',
'webhook_headers[Authorization]' => 'Bearer YOUR_SECRET'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/automations',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'name': 'Notify sales on pricing read',
'scope': 'specific',
'doc_ids[0]': '48927-c7621-ec3c0',
'events[0]': 'page:read',
'conditions[0][type]': 'page_number',
'conditions[0][value]': '7',
'conditions[1][type]': 'time_on_page',
'conditions[1][value]': '30',
'webhook_url': 'https://crm.acme.com/webhook/pricing-read',
'webhook_headers[Authorization]': 'Bearer YOUR_SECRET'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"name": "Notify sales on pricing read",
"scope": "specific",
"doc_ids[0]": "48927-c7621-ec3c0",
"events[0]": "page:read",
"conditions[0][type]": "page_number",
"conditions[0][value]": "7",
"conditions[1][type]": "time_on_page",
"conditions[1][value]": "30",
"webhook_url": "https://crm.acme.com/webhook/pricing-read",
"webhook_headers[Authorization]": "Bearer YOUR_SECRET"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/automations")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("name", "Notify sales on pricing read")
.add("scope", "specific")
.add("doc_ids[0]", "48927-c7621-ec3c0")
.add("events[0]", "page:read")
.add("conditions[0][type]", "page_number")
.add("conditions[0][value]", "7")
.add("conditions[1][type]", "time_on_page")
.add("conditions[1][value]", "30")
.add("webhook_url", "https://crm.acme.com/webhook/pricing-read")
.add("webhook_headers[Authorization]", "Bearer YOUR_SECRET")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"id": "d4a0d-ab87b-88b6b",
"name": "Notify sales on pricing read",
"is_active": true,
"scope": "specific",
"doc_ids": [
"48927-c7621-ec3c0"
],
"trigger": {
"events": [
"page:read"
],
"conditions": [
{
"source": "event",
"operator": "==",
"value": 7,
"field": "page"
},
{
"source": "event",
"operator": ">=",
"value": 30000,
"field": "duration_ms"
}
]
},
"actions": [
{
"type": "webhook",
"config": {
"url": "https://crm.acme.com/webhook/pricing-read",
"headers": {
"Authorization": "Bearer YOUR_SECRET"
}
}
}
],
"created_at": "2026-04-22T15:08:51.000000Z"
}
}
Retrieve an automation
Get a single automation by its ID
Request
curl -X GET https://apdf.io/api/automations/d4a0d-ab87b-88b6b \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/automations/d4a0d-ab87b-88b6b', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/automations/d4a0d-ab87b-88b6b")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations/d4a0d-ab87b-88b6b")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"id": "d4a0d-ab87b-88b6b",
"name": "Notify sales on pricing read",
"is_active": true,
"scope": "specific",
"doc_ids": [
"48927-c7621-ec3c0"
],
"trigger": {
"events": [
"page:read"
],
"conditions": [
{
"field": "page",
"value": 7,
"source": "event",
"operator": "=="
},
{
"field": "duration_ms",
"value": 30000,
"source": "event",
"operator": ">="
}
]
},
"actions": [
{
"type": "webhook",
"config": {
"url": "https://crm.acme.com/webhook/pricing-read",
"headers": {
"Authorization": "Bearer YOUR_SECRET"
}
}
}
],
"created_at": "2026-04-22T15:08:51.000000Z"
}
}
Activate an automation
Activate (enable) an automation so it fires again
Request
curl -X POST https://apdf.io/api/automations/d4a0d-ab87b-88b6b/activate \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/automations/d4a0d-ab87b-88b6b/activate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/activate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/activate',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/activate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/automations/d4a0d-ab87b-88b6b/activate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations/d4a0d-ab87b-88b6b/activate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"id": "d4a0d-ab87b-88b6b",
"name": "Notify sales on pricing read",
"is_active": true,
"scope": "specific",
"doc_ids": [
"48927-c7621-ec3c0"
],
"trigger": {
"events": [
"page:read"
],
"conditions": [
{
"field": "page",
"value": 7,
"source": "event",
"operator": "=="
},
{
"field": "duration_ms",
"value": 30000,
"source": "event",
"operator": ">="
}
]
},
"actions": [
{
"type": "webhook",
"config": {
"url": "https://crm.acme.com/webhook/pricing-read",
"headers": {
"Authorization": "Bearer YOUR_SECRET"
}
}
}
],
"created_at": "2026-04-22T15:08:51.000000Z"
}
}
Deactivate an automation
Deactivate (pause) an automation so it stops firing
Request
curl -X POST https://apdf.io/api/automations/d4a0d-ab87b-88b6b/deactivate \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/automations/d4a0d-ab87b-88b6b/deactivate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/deactivate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/deactivate',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/deactivate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/automations/d4a0d-ab87b-88b6b/deactivate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations/d4a0d-ab87b-88b6b/deactivate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"id": "d4a0d-ab87b-88b6b",
"name": "Notify sales on pricing read",
"is_active": false,
"scope": "specific",
"doc_ids": [
"48927-c7621-ec3c0"
],
"trigger": {
"events": [
"page:read"
],
"conditions": [
{
"field": "page",
"value": 7,
"source": "event",
"operator": "=="
},
{
"field": "duration_ms",
"value": 30000,
"source": "event",
"operator": ">="
}
]
},
"actions": [
{
"type": "webhook",
"config": {
"url": "https://crm.acme.com/webhook/pricing-read",
"headers": {
"Authorization": "Bearer YOUR_SECRET"
}
}
}
],
"created_at": "2026-04-22T15:08:51.000000Z"
}
}
Duplicate an automation
Copy an automation, including its trigger, conditions and documents
Request
curl -X POST https://apdf.io/api/automations/d4a0d-ab87b-88b6b/duplicate \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/automations/d4a0d-ab87b-88b6b/duplicate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/duplicate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/duplicate',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b/duplicate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/automations/d4a0d-ab87b-88b6b/duplicate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations/d4a0d-ab87b-88b6b/duplicate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": {
"id": "9b1c7-4fe02-6a83d",
"name": "Notify sales on pricing read (Copy)",
"is_active": true,
"scope": "specific",
"doc_ids": [
"48927-c7621-ec3c0"
],
"trigger": {
"events": [
"page:read"
],
"conditions": [
{
"field": "page",
"value": 7,
"source": "event",
"operator": "=="
},
{
"field": "duration_ms",
"value": 30000,
"source": "event",
"operator": ">="
}
]
},
"actions": [
{
"type": "webhook",
"config": {
"url": "https://crm.acme.com/webhook/pricing-read",
"headers": {
"Authorization": "Bearer YOUR_SECRET"
}
}
}
],
"created_at": "2026-04-22T15:08:51.000000Z"
}
}
Delete an automation
Delete an automation and its execution history
Request
curl -X DELETE https://apdf.io/api/automations/d4a0d-ab87b-88b6b \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/automations/d4a0d-ab87b-88b6b', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'DELETE',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->delete(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.delete(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.delete(
'https://apdf.io/api/automations/d4a0d-ab87b-88b6b',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Delete("https://apdf.io/api/automations/d4a0d-ab87b-88b6b")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations/d4a0d-ab87b-88b6b")
.addHeader("Authorization", "Bearer TOKEN")
.delete(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON[]
List all executions
Get a list of your automation executions
Request
curl -X GET https://apdf.io/api/automations/executions \
-H "Authorization: Bearer TOKEN" \
const data = new FormData();
fetch('https://apdf.io/api/automations/executions', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'GET',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get(
'https://apdf.io/api/automations/executions', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.get(
'https://apdf.io/api/automations/executions',
{
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.get(
'https://apdf.io/api/automations/executions',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Get("https://apdf.io/api/automations/executions")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/automations/executions")
.addHeader("Authorization", "Bearer TOKEN")
.get(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"data": [
{
"automation": {
"id": "d4a0d-ab87b-88b6b",
"name": "Ping CRM on document open"
},
"status": "successful",
"matched_event": "document:loaded",
"doc_id": "48927-c7621-ec3c0",
"session_id": "ZvZiSTCWcKcnYhgp",
"viewer_id": "0oKpyCgVWJtx",
"payload": {
"event": {
"data": null,
"recipient": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"viewer_id": "0oKpyCgVWJtx",
"session_id": "ZvZiSTCWcKcnYhgp"
},
"session": {
"pages_viewed": 0,
"completion_rate": 0,
"total_duration_ms": 0
},
"trigger": {
"matched_event": "document:loaded",
"conditions_evaluated": false
},
"document": {
"name": "Proposal_2026_04_AcmeCompany",
"doc_id": "48927-c7621-ec3c0",
"file_pages": 9,
"viewer_url": "https://docs.apdf.io/acme/48927-c7621-ec3c0"
},
"timestamp": "2026-04-22T15:28:13+00:00",
"automation": {
"id": "d4a0d-ab87b-88b6b",
"name": "Ping CRM on document open"
}
},
"response": {
"body": "{\"ok\":true}",
"status": 200
},
"error": null,
"duration_ms": 247,
"created_at": "2026-04-22T15:28:14.000000Z"
}
],
"links": {...},
"meta": {...}
}
PDF Processing API
Create, merge, split, compress, OCR and secure PDFs, read and fill their forms, turn invoices into e-invoices, or extract their text and metadata.
Create PDF
Create a PDF from HTML
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| html | yes | HTML to be converted to a PDF document |
| scale | no | Scale factor of the document. Valid values: 0.1 - 2 |
| format | no | Format of the document. Valid values: letter, legal, tabloid, ledger, a0, a1, a2, a3, a4, a5, a6. Defaults to letter when neither format nor width and height are given |
| unit | no | Unit of the document. Valid values: px, in, cm, mm |
| width | no | Width of the document in mm or in the given unit |
| height | no | Height of the document in mm or in the given unit |
| orientation | no | Orientation of the document. Valid values: portrait, landscape |
| margin_top | no | Top margin of the document in mm or in the given unit |
| margin_right | no | Right margin of the document in mm or in the given unit |
| margin_bottom | no | Bottom margin of the document in mm or in the given unit |
| margin_left | no | Left margin of the document in mm or in the given unit |
| header | no | Header HTML to be used for the header on all pages |
| footer | no | Footer HTML to be used for the footer on all pages |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/file/create \
-H "Authorization: Bearer TOKEN" \
-d html="<html><body><h1>Hello World!</h1></body></html>"
const data = new FormData();
data.append('html', '<html><body><h1>Hello World!</h1></body></html>');
fetch('https://apdf.io/api/pdf/file/create', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/file/create', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'html' => '<html><body><h1>Hello World!</h1></body></html>'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/file/create',
{
'html' => '<html><body><h1>Hello World!</h1></body></html>'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/file/create',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'html': '<html><body><h1>Hello World!</h1></body></html>'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"html": "<html><body><h1>Hello World!</h1></body></html>"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/file/create")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("html", "<html><body><h1>Hello World!</h1></body></html>")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/file/create")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ2YJKAXYTHGHEXZEQ03R0XJ"
}
Job Result
JSON{
"id": "01KQ2YJKAXYTHGHEXZEQ03R0XJ",
"created": "2024-12-02T21:30:52.133821Z",
"status": "successful",
"result": {
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/6f1674e2703953aa.pdf",
"expiration": "2024-12-02T22:30:54.450552Z",
"pages": 1,
"size": 11838
}
}
Split PDF
Split a PDF into multiple PDF files
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| pages | yes | Pages at which the PDF will be split, examples: 1,2-3,4-z = 3 PDFs with page 1, page 2 and 3, and page 4 to the end n3 = every 3 pages a new PDF file 1-r2,z = 2 PDFs with page 1 to the penultimate page, and the last page |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/file/split \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d pages="1-3,4,5-z"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('pages', '1-3,4,5-z');
fetch('https://apdf.io/api/pdf/file/split', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/file/split', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'pages' => '1-3,4,5-z'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/file/split',
{
'file' => 'FILE_URL',
'pages' => '1-3,4,5-z'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/file/split',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'pages': '1-3,4,5-z'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"pages": "1-3,4,5-z"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/file/split")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("pages", "1-3,4,5-z")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/file/split")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON[
{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/191674e262f952ca-1-3.pdf",
"expiration": "2024-12-02T22:27:11.610806Z",
"pages": 3,
"size": 390102
},
{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/191674e262f952ca-4.pdf",
"expiration": "2024-12-02T22:27:11.610806Z",
"pages": 1,
"size": 241161
},
{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/191674e262f952ca-5-z.pdf",
"expiration": "2024-12-02T22:27:11.610806Z",
"pages": 6,
"size": 570713
}
]
Merge PDF
Merge multiple PDF files into one file
Parameters
| Parameter | Required | Description |
|---|---|---|
| files[] | yes | Array of the PDF files to merge and their options |
| files[i][file] | yes | URL of the PDF file |
| files[i][pages] | no | Pages to be used for merging, examples: 1,6,4 = pages 1, 6, and 4 in that order 3-7 = pages 3 through 7 in increasing order 2,6-z = page 2 and 6 to the end r3-r1 = the last three pages |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/file/merge \
-H "Authorization: Bearer TOKEN" \
-d files[0][file]="FILE_1_URL" \
-d files[0][pages]="1,5-z" \
-d files[1][file]="FILE_2_URL"
const data = new FormData();
data.append('files[0][file]', 'FILE_1_URL');
data.append('files[0][pages]', '1,5-z');
data.append('files[1][file]', 'FILE_2_URL');
fetch('https://apdf.io/api/pdf/file/merge', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/file/merge', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'files[0][file]' => 'FILE_1_URL',
'files[0][pages]' => '1,5-z',
'files[1][file]' => 'FILE_2_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/file/merge',
{
'files[0][file]' => 'FILE_1_URL',
'files[0][pages]' => '1,5-z',
'files[1][file]' => 'FILE_2_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/file/merge',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'files[0][file]': 'FILE_1_URL',
'files[0][pages]': '1,5-z',
'files[1][file]': 'FILE_2_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"files[0][file]": "FILE_1_URL",
"files[0][pages]": "1,5-z",
"files[1][file]": "FILE_2_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/file/merge")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("files[0][file]", "FILE_1_URL")
.add("files[0][pages]", "1,5-z")
.add("files[1][file]", "FILE_2_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/file/merge")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/a736755a3dab32b8.pdf",
"expiration": "2024-12-08T14:49:16.997135Z",
"pages": 12,
"size": 165310
}
Compress PDF
Compress a PDF file
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/file/compress \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/file/compress', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/file/compress', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/file/compress',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/file/compress',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/file/compress")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/file/compress")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ3A2B5CDEF6GHJK7MN8PQRS"
}
Job Result
JSON{
"id": "01KQ3A2B5CDEF6GHJK7MN8PQRS",
"created": "2024-12-02T21:30:52.133821Z",
"status": "successful",
"result": {
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785.pdf",
"expiration": "2024-11-30T11:13:09.716337Z",
"size_original": 26214400,
"size_compressed": 3145728
}
}
PDF to Image
Convert a PDF file to images
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| image_type | yes | Image type to be generated. Valid values: png, jpeg, jpegcmyk, tiff |
| color_mode | no | Color mode of the image. Valid values: color, gray, mono |
| dpi | no | DPI of the image. Must be between 1 and 300 |
| pages | no | Pages to be converted (by default only the first page), examples: 1,4,6 = pages 1, 4, and 6 2,6-z = page 2 and 6 to the end r3-r1 = the last three pages |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/file/to-image \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d image_type="jpeg"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('image_type', 'jpeg');
fetch('https://apdf.io/api/pdf/file/to-image', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/file/to-image', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'image_type' => 'jpeg'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/file/to-image',
{
'file' => 'FILE_URL',
'image_type' => 'jpeg'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/file/to-image',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'image_type': 'jpeg'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"image_type": "jpeg"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/file/to-image")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("image_type", "jpeg")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/file/to-image")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ3B7D9EFGH2JKLM3NP4QRTV"
}
Job Result
JSON{
"id": "01KQ3B7D9EFGH2JKLM3NP4QRTV",
"created": "2024-12-02T21:30:52.133821Z",
"status": "successful",
"result": [
{
"page": 1,
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785-1.jpg",
"expiration": "2024-11-30T11:13:09.716337Z"
}
]
}
Office to PDF
Convert an Office document (Word, Excel, PowerPoint, OpenDocument or RTF) to a PDF file
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the document. Supported formats: docx, doc, xlsx, xls, pptx, ppt, odt, ods, odp, rtf |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/file/convert \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/file/convert', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/file/convert', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/file/convert',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/file/convert',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/file/convert")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/file/convert")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ7F2M9BXR4TNC6WD8HJ3PZQ"
}
Job Result
JSON{
"id": "01KQ7F2M9BXR4TNC6WD8HJ3PZQ",
"created": "2024-12-02T21:30:52.133821Z",
"status": "successful",
"result": {
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/9c3e51b7a40d2f68.pdf",
"expiration": "2024-12-02T22:30:54.450552Z",
"pages": 8,
"size": 269371
}
}
Extract Pages
Extract page(s) into a new PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| pages | yes | Pages to be extracted, examples: 1,6,4 = pages 1, 6, and 4 in that order 3-7 = pages 3 through 7 in increasing order 2,6-z = page 2 and 6 to the end r3-r1 = the last three pages |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/page/extract \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d pages="1-3,6,9-z"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('pages', '1-3,6,9-z');
fetch('https://apdf.io/api/pdf/page/extract', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/extract', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'pages' => '1-3,6,9-z'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/extract',
{
'file' => 'FILE_URL',
'pages' => '1-3,6,9-z'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/extract',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'pages': '1-3,6,9-z'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"pages": "1-3,6,9-z"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/extract")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("pages", "1-3,6,9-z")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/extract")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/6ac674c9c031e515.pdf",
"expiration": "2024-12-01T18:25:25.137351Z",
"pages": 8,
"size": 2304916
}
Delete Pages
Delete page(s) from a PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| pages | yes | Pages to be deleted, examples: 1,4,6 = pages 1, 4, and 6 2,6-z = page 2 and 6 to the end r3-r1 = the last three pages |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/page/delete \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d pages="1-3,z"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('pages', '1-3,z');
fetch('https://apdf.io/api/pdf/page/delete', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/delete', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'pages' => '1-3,z'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/delete',
{
'file' => 'FILE_URL',
'pages' => '1-3,z'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/delete',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'pages': '1-3,z'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"pages": "1-3,z"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/delete")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("pages", "1-3,z")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/delete")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/6ac674c9c031e515.pdf",
"expiration": "2024-12-01T18:25:25.137351Z",
"pages": 8,
"size": 2304916
}
Rotate Pages
Rotate page(s) in a PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| rotations[] | yes | Array of the rotations to perform |
| rotations[i][angle] | yes | Angle to rotate. Valid values: + or - followed by 0, 90, 180, 270 |
| rotations[i][pages] | no | Pages to be rotated (or keep empty for all pages), examples: 1,5 = pages 1 and 5 3-7,z = pages 3 through 7 and the last page r3-r1 = the last three pages |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/page/rotate \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d rotations[0][angle]="-90" \
-d rotations[0][pages]="1-3" \
-d rotations[1][angle]="+180" \
-d rotations[1][pages]="z"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('rotations[0][angle]', '-90');
data.append('rotations[0][pages]', '1-3');
data.append('rotations[1][angle]', '+180');
data.append('rotations[1][pages]', 'z');
fetch('https://apdf.io/api/pdf/page/rotate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/rotate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'rotations[0][angle]' => '-90',
'rotations[0][pages]' => '1-3',
'rotations[1][angle]' => '+180',
'rotations[1][pages]' => 'z'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/rotate',
{
'file' => 'FILE_URL',
'rotations[0][angle]' => '-90',
'rotations[0][pages]' => '1-3',
'rotations[1][angle]' => '+180',
'rotations[1][pages]' => 'z'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/rotate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'rotations[0][angle]': '-90',
'rotations[0][pages]': '1-3',
'rotations[1][angle]': '+180',
'rotations[1][pages]': 'z'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"rotations[0][angle]": "-90",
"rotations[0][pages]": "1-3",
"rotations[1][angle]": "+180",
"rotations[1][pages]": "z"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/rotate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("rotations[0][angle]", "-90")
.add("rotations[0][pages]", "1-3")
.add("rotations[1][angle]", "+180")
.add("rotations[1][pages]", "z")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/rotate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785.pdf",
"expiration": "2024-12-15T13:16:12.757041Z"
}
Overlay Pages
Overlay page(s) into a PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| overlay | yes | URL of the Overlay PDF file |
| from | no | Pages (from the overlay pdf) to be used for overlay |
| to | no | Pages (from the file pdf) that should have the overlay |
| repeat | no | Pages (from the overlay pdf) that will be repeated |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/page/overlay \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d overlay="OVERLAY_FILE_URL" \
-d from="1,3" \
-d to="2-z" \
-d repeat="1"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('overlay', 'OVERLAY_FILE_URL');
data.append('from', '1,3');
data.append('to', '2-z');
data.append('repeat', '1');
fetch('https://apdf.io/api/pdf/page/overlay', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/overlay', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'overlay' => 'OVERLAY_FILE_URL',
'from' => '1,3',
'to' => '2-z',
'repeat' => '1'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/overlay',
{
'file' => 'FILE_URL',
'overlay' => 'OVERLAY_FILE_URL',
'from' => '1,3',
'to' => '2-z',
'repeat' => '1'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/overlay',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'overlay': 'OVERLAY_FILE_URL',
'from': '1,3',
'to': '2-z',
'repeat': '1'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"overlay": "OVERLAY_FILE_URL",
"from": "1,3",
"to": "2-z",
"repeat": "1"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/overlay")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("overlay", "OVERLAY_FILE_URL")
.add("from", "1,3")
.add("to", "2-z")
.add("repeat", "1")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/overlay")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785.pdf",
"expiration": "2024-12-15T13:16:12.757041Z"
}
Underlay Pages
Underlay page(s) into a PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| underlay | yes | URL of the Underlay PDF file |
| from | no | Pages (from the underlay pdf) to be used for underlay |
| to | no | Pages (from the file pdf) that should have the underlay |
| repeat | no | Pages (from the underlay pdf) that will be repeated |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/page/underlay \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d underlay="UNDERLAY_FILE_URL" \
-d from="3" \
-d to="2-z" \
-d repeat="1"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('underlay', 'UNDERLAY_FILE_URL');
data.append('from', '3');
data.append('to', '2-z');
data.append('repeat', '1');
fetch('https://apdf.io/api/pdf/page/underlay', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/underlay', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'underlay' => 'UNDERLAY_FILE_URL',
'from' => '3',
'to' => '2-z',
'repeat' => '1'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/underlay',
{
'file' => 'FILE_URL',
'underlay' => 'UNDERLAY_FILE_URL',
'from' => '3',
'to' => '2-z',
'repeat' => '1'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/underlay',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'underlay': 'UNDERLAY_FILE_URL',
'from': '3',
'to': '2-z',
'repeat': '1'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"underlay": "UNDERLAY_FILE_URL",
"from": "3",
"to": "2-z",
"repeat": "1"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/underlay")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("underlay", "UNDERLAY_FILE_URL")
.add("from", "3")
.add("to", "2-z")
.add("repeat", "1")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/underlay")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785.pdf",
"expiration": "2024-12-15T13:16:12.757041Z"
}
Search Content
Search in the PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| text | yes | Text to search for |
| case | no | Set case to 1 for a case-sensitive search |
| regex | no | Set regex to 1 to interpret the search text as a regular expression |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/content/search \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d text="SEARCH_TEXT"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('text', 'SEARCH_TEXT');
fetch('https://apdf.io/api/pdf/content/search', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/content/search', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'text' => 'SEARCH_TEXT'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/content/search',
{
'file' => 'FILE_URL',
'text' => 'SEARCH_TEXT'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/content/search',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'text': 'SEARCH_TEXT'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"text": "SEARCH_TEXT"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/content/search")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("text", "SEARCH_TEXT")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/content/search")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"search_text": "portable document format",
"results_total": 3,
"results_pages": 2,
"results": [
{
"page": "6",
"matched_line": "7. \"ISO 32000-1:2008 – Document management – Portable document format – Part 1: PDF",
"exact_word": "Portable document format"
},
{
"page": "17",
"matched_line": "37. Adobe Systems Inc. (July 1, 2008). \"Document Management – Portable Document Format –",
"exact_word": "Portable Document Format"
},
{
"page": "17",
"matched_line": "64. \"Processing Dangerous Paths – On Security and Privacy of the Portable Document Format\"",
"exact_word": "Portable Document Format"
}
]
}
Extract Content
Extract the content of the PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/content/read \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/content/read', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/content/read', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/content/read',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/content/read',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/content/read")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/content/read")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"pages_total": 3,
"characters_total": 8642,
"pages": [
{
"page": 1,
"characters": 2398,
"content": "PDF\\nPortable Document Format (PDF), standardized as\\nISO 32000 ..."
},
{
"page": 2,
"characters": 2900,
"content": "PDF was a proprietary format controlled by Adobe until it was released ..."
},
{
"page": 3,
"characters": 3344,
"content": "PostScript was originally designed for a drastically different use case ..."
}
]
}
Read Form
Get the form fields of a PDF file with their values and what each field means
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file. Forms that exist only as XFA (without regular form fields) are not supported |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
How it works
- A field is identified by its
name, which /pdf/form/fill takes. Itsvalueis a text for text fields,trueorfalsefor a single checkbox, the selected option (ornull) for radios, checkbox groups and choices, and a list for multi-select listboxes.optionslists what a field accepts labelis the field's description stored in the PDF, if there is one.contextadds the printed text around the field (and around each option), read from the page layout, so take it as a hint- Positions are in points from the top left corner of the page as displayed,
pagesgives the size of every page
Request
curl -X POST https://apdf.io/api/pdf/form/read \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/form/read', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/form/read', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/form/read',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/form/read',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/form/read")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/form/read")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"fields": [
{
"name": "full_name",
"type": "text",
"label": "Full name of the applicant",
"value": "",
"page": 1,
"required": true,
"read_only": false,
"context": {
"description": null,
"position": {
"x": 160,
"y": 112,
"width": 240,
"height": 18
},
"visible": true,
"text": {
"left": "Full name",
"right": null,
"above": null,
"below": "As shown in your passport",
"row": null,
"column": null,
"inside": null
}
}
},
{
"name": "contact",
"type": "radio",
"label": "Preferred way of contact",
"value": null,
"page": 1,
"required": false,
"read_only": false,
"options": [
"Email",
"Phone"
],
"context": {
"description": null,
"position": {
"x": 160,
"y": 148,
"width": 12,
"height": 12
},
"visible": true,
"text": {
"left": "Contact me by",
"right": "Email",
"above": null,
"below": null,
"row": null,
"column": null,
"inside": null
},
"options": [
{
"value": "Email",
"position": {
"x": 160,
"y": 148,
"width": 12,
"height": 12
},
"text": {
"left": "Contact me by",
"right": "Email",
"above": null,
"below": null,
"row": null,
"column": null,
"inside": null
}
},
{
"value": "Phone",
"position": {
"x": 230,
"y": 148,
"width": 12,
"height": 12
},
"text": {
"left": null,
"right": "Phone",
"above": null,
"below": null,
"row": "Contact me by",
"column": null,
"inside": null
}
}
]
}
},
{
"name": "newsletter",
"type": "checkbox",
"label": null,
"value": false,
"page": 1,
"required": false,
"read_only": false,
"options": [
"Yes"
],
"context": {
"description": null,
"position": {
"x": 160,
"y": 176,
"width": 12,
"height": 12
},
"visible": true,
"text": {
"left": null,
"right": "Send me the newsletter",
"above": null,
"below": null,
"row": null,
"column": null,
"inside": null
}
}
}
],
"pages": [
{
"page": 1,
"width": 612,
"height": 792,
"has_text": true
}
]
}
Fill Form
Fill the form fields of a PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file. Forms that exist only as XFA (without regular form fields) are not supported |
| fields | yes | Array of the fields to fill, named as /pdf/form/read returns them. Fields not in the array keep their value |
| fields[][name] | yes | Name of the field |
| fields[][value] | yes | A text for text fields (empty clears it), true or false for a single checkbox, an option for radios, checkbox groups and comboboxes (any text if editable), one or an array of options for listboxes. Read-only, button and signature fields cannot be filled |
| flatten | no | Set flatten to 1 to merge the filled fields into the page content, so they cannot be changed anymore |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
How it works
- Calculated fields, like totals, are updated after filling: the standard calculations of PDF forms and simple scripted arithmetic.
calculations.unsupportedlists the calculated fields with a custom script, which keep their value - Values are shown in the field's display format, if it has a standard one (like 1.234,50 or 14.10.2026). Numbers keep the value as given, dates are stored as shown and can be given as
YYYY-MM-DD
Request
curl -X POST https://apdf.io/api/pdf/form/fill \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d fields[0][name]="full_name" \
-d fields[0][value]="Jane Doe" \
-d fields[1][name]="contact" \
-d fields[1][value]="Email" \
-d fields[2][name]="newsletter" \
-d fields[2][value]="true"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('fields[0][name]', 'full_name');
data.append('fields[0][value]', 'Jane Doe');
data.append('fields[1][name]', 'contact');
data.append('fields[1][value]', 'Email');
data.append('fields[2][name]', 'newsletter');
data.append('fields[2][value]', 'true');
fetch('https://apdf.io/api/pdf/form/fill', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/form/fill', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'fields[0][name]' => 'full_name',
'fields[0][value]' => 'Jane Doe',
'fields[1][name]' => 'contact',
'fields[1][value]' => 'Email',
'fields[2][name]' => 'newsletter',
'fields[2][value]' => 'true'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/form/fill',
{
'file' => 'FILE_URL',
'fields[0][name]' => 'full_name',
'fields[0][value]' => 'Jane Doe',
'fields[1][name]' => 'contact',
'fields[1][value]' => 'Email',
'fields[2][name]' => 'newsletter',
'fields[2][value]' => 'true'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/form/fill',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'fields[0][name]': 'full_name',
'fields[0][value]': 'Jane Doe',
'fields[1][name]': 'contact',
'fields[1][value]': 'Email',
'fields[2][name]': 'newsletter',
'fields[2][value]': 'true'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"fields[0][name]": "full_name",
"fields[0][value]": "Jane Doe",
"fields[1][name]": "contact",
"fields[1][value]": "Email",
"fields[2][name]": "newsletter",
"fields[2][value]": "true"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/form/fill")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("fields[0][name]", "full_name")
.add("fields[0][value]", "Jane Doe")
.add("fields[1][name]", "contact")
.add("fields[1][value]", "Email")
.add("fields[2][name]", "newsletter")
.add("fields[2][value]", "true")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/form/fill")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785.pdf",
"expiration": "2024-11-30T11:13:09.716337Z",
"calculations": {
"updated": [],
"unsupported": []
}
}
Visualize Form
Get images of the form pages with a numbered box on every field
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| pages | no | Pages to be rendered (by default every page with a field to fill), examples: 1,4,6 = pages 1, 4, and 6 2,6-z = page 2 and 6 to the end r3-r1 = the last three pages |
| dpi | no | Resolution of the images. Must be between 50 and 200, default 100 |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
How it works
- Each image shows the page with a numbered box on every field to fill, numbered in reading order.
fieldstells which field each number is: itsname(andoptionfor checkboxes and radios) is what /pdf/form/fill takes - Read-only fields and buttons are not marked. Signature fields are marked, but /pdf/form/fill cannot fill them. Hidden fields, which some forms show only on demand, get a dashed box and
hidden: true
Request
curl -X POST https://apdf.io/api/pdf/form/visualize \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d pages="1"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('pages', '1');
fetch('https://apdf.io/api/pdf/form/visualize', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/form/visualize', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'pages' => '1'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/form/visualize',
{
'file' => 'FILE_URL',
'pages' => '1'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/form/visualize',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'pages': '1'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"pages": "1"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/form/visualize")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("pages", "1")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/form/visualize")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"pages": [
{
"page": 1,
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785-1.png",
"expiration": "2024-11-30T11:13:09.716337Z",
"fields": [
{
"number": 1,
"name": "full_name",
"type": "text"
},
{
"number": 2,
"name": "contact",
"type": "radio",
"option": "Email"
},
{
"number": 3,
"name": "contact",
"type": "radio",
"option": "Phone"
},
{
"number": 4,
"name": "newsletter",
"type": "checkbox",
"option": "Yes"
}
]
}
]
}
Create E-Invoice
Turn a PDF invoice into a ZUGFeRD / Factur-X e-invoice (PDF/A-3 with the invoice XML embedded)
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF invoice, the readable copy of the e-invoice |
| invoice | yes | The invoice data, from which the invoice XML is built. Required unless xml is given |
| invoice[number] | yes | Invoice number |
| invoice[type] | no | Type of the document. Valid values: invoice (default), credit_note, corrected_invoice, prepayment_invoice, partial_invoice, self_billed_invoice |
| invoice[issue_date] | yes | Issue date as YYYY-MM-DD |
| invoice[due_date] | no | Payment due date as YYYY-MM-DD |
| invoice[currency] | yes | ISO 4217 currency code, like EUR |
| invoice[buyer_reference] | no | Reference of the buyer, the Leitweg-ID for German public authorities (required for XRECHNUNG) |
| invoice[order_reference] | no | Purchase order number of the buyer |
| invoice[contract_reference] | no | Number of the contract the invoice is based on |
| invoice[project_reference] | no | Project the invoice belongs to |
| invoice[accounting_reference] | no | Account in the buyer's accounting the invoice is booked on, like a cost center |
| invoice[billing_period][start] | no | Start of the billing period as YYYY-MM-DD |
| invoice[billing_period][end] | no | End of the billing period as YYYY-MM-DD, required with the start |
| invoice[notes] | no | Array of free texts |
| invoice[preceding_invoices] | no | Array of the invoices a credit note or corrected invoice refers to, each with number (required) and issue_date as YYYY-MM-DD |
| invoice[seller][name] | yes | Name of the seller |
| invoice[seller][vat_id] | no | VAT ID of the seller |
| invoice[seller][tax_number] | no | Tax number of the seller |
| invoice[seller][registration_number] | no | Company registration number of the seller, like the commercial register entry |
| invoice[seller][electronic_address] | no | Electronic address of the seller with id and scheme (EAS code), EM (email) by default, like 0204 for a Leitweg-ID or 0088 for a GLN (required for XRECHNUNG) |
| invoice[seller][address] | yes | Address with line1, line2, city, postcode and country (ISO 3166 code, required) |
| invoice[seller][contact] | no | Contact person with name, phone and email (required for XRECHNUNG) |
| invoice[buyer][name] | yes | Name of the buyer |
| invoice[buyer][vat_id] | no | VAT ID of the buyer |
| invoice[buyer][electronic_address] | no | Electronic address of the buyer, like the seller's (required for XRECHNUNG) |
| invoice[buyer][address] | yes | Address, like the seller's |
| invoice[delivery] | no | Delivery with date as YYYY-MM-DD, and the name and address of the place delivered to, when it isn't the buyer's |
| invoice[payment][method] | no | How the invoice is paid. Valid values: credit_transfer (default when iban is given), direct_debit, card, online |
| invoice[payment][iban] | no | IBAN to transfer to, with bic and account_name. Required for credit_transfer |
| invoice[payment][debtor_iban] | no | IBAN that is debited, with the creditor_id of the seller and the mandate_reference. All three required for direct_debit |
| invoice[payment][card_last_digits] | no | Last 4 to 6 digits of the card, with the card_holder. Required for card |
| invoice[payment][details] | no | Text on how the invoice is paid, like the payment provider for online |
| invoice[payment][reference] | no | Reference to give with the payment |
| invoice[payment][terms] | no | Payment terms as text |
| invoice[lines] | yes | Array of the invoice lines |
| invoice[lines][][name] | yes | Name of the item |
| invoice[lines][][description] | no | Description of the item |
| invoice[lines][][item_number] | no | Article number of the seller |
| invoice[lines][][quantity] | yes | Quantity |
| invoice[lines][][unit] | no | Unit code (UN/ECE Rec 20), H87 (piece) by default, like HUR for hours or KGM for kilograms |
| invoice[lines][][unit_price] | yes | Net price per unit |
| invoice[lines][][vat_rate] | yes | VAT rate in percent, like 19. Not given for outside_scope |
| invoice[lines][][vat_category] | no | VAT category. Valid values: standard (default), zero_rated, exempt, reverse_charge, intra_community, export, outside_scope |
| invoice[lines][][discounts] | no | Array of discounts on the line, each with a reason (required) and either an amount or a percent of the line's quantity times unit price |
| invoice[lines][][charges] | no | Array of charges on the line, with the same fields as a line discount |
| invoice[discounts] | no | Array of discounts on the whole invoice, like a loyalty or early payment discount |
| invoice[discounts][][reason] | yes | Reason for the discount |
| invoice[discounts][][amount] | yes | Net amount of the discount. Required unless percent is given |
| invoice[discounts][][percent] | no | Discount in percent of the lines with the same VAT category and rate, instead of an amount |
| invoice[discounts][][vat_rate] | yes | VAT rate of the discounted items, not given for outside_scope |
| invoice[discounts][][vat_category] | no | VAT category of the discounted items, standard by default |
| invoice[charges] | no | Array of charges on the whole invoice, like shipping or packaging, with the same fields as a discount |
| invoice[vat_exemption_reasons] | no | Reason for VAT exemption per VAT category, like invoice[vat_exemption_reasons][reverse_charge]. Required for each of the categories exempt, reverse_charge, intra_community, export and outside_scope the invoice uses |
| invoice[paid_amount] | no | Amount already paid, deducted from the amount due |
| level | no | Profile of the e-invoice. Valid values: BASIC, EN 16931 (default), EXTENDED, XRECHNUNG |
| xml | no | A ready Cross Industry Invoice XML (ZUGFeRD, Factur-X or XRechnung) to embed instead of invoice. Its level is read from the XML |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
How it works
- The line amounts, the VAT breakdown per category and rate, and the totals are calculated from the lines, discounts and charges. Percentages are turned into amounts rounded to cents
- The XML is embedded as
factur-x.xml(xrechnung.xmlfor XRECHNUNG) and the PDF is declared PDF/A-3. Pages, links and form fields of the PDF stay as they are - The result is validated like /pdf/einvoice/validate does. An invoice that breaks a rule of its level, or a PDF that can't be PDF/A (like one with fonts that aren't embedded), fails with
422and lists every rule inviolations
Request
curl -X POST https://apdf.io/api/pdf/einvoice/create \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d invoice[number]="RE-2026-0042" \
-d invoice[issue_date]="2026-11-11" \
-d invoice[due_date]="2026-11-25" \
-d invoice[currency]="EUR" \
-d invoice[seller][name]="Acme GmbH" \
-d invoice[seller][vat_id]="DE123456789" \
-d invoice[seller][address][line1]="Hauptstraße 1" \
-d invoice[seller][address][city]="Berlin" \
-d invoice[seller][address][postcode]="10115" \
-d invoice[seller][address][country]="DE" \
-d invoice[buyer][name]="Contoso AG" \
-d invoice[buyer][address][line1]="Am Markt 5" \
-d invoice[buyer][address][city]="Hamburg" \
-d invoice[buyer][address][postcode]="20095" \
-d invoice[buyer][address][country]="DE" \
-d invoice[payment][iban]="DE02120300000000202051" \
-d invoice[lines][0][name]="Consulting" \
-d invoice[lines][0][quantity]="8" \
-d invoice[lines][0][unit]="HUR" \
-d invoice[lines][0][unit_price]="120" \
-d invoice[lines][0][vat_rate]="19" \
-d invoice[charges][0][amount]="4.95" \
-d invoice[charges][0][reason]="Shipping" \
-d invoice[charges][0][vat_rate]="19"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('invoice[number]', 'RE-2026-0042');
data.append('invoice[issue_date]', '2026-11-11');
data.append('invoice[due_date]', '2026-11-25');
data.append('invoice[currency]', 'EUR');
data.append('invoice[seller][name]', 'Acme GmbH');
data.append('invoice[seller][vat_id]', 'DE123456789');
data.append('invoice[seller][address][line1]', 'Hauptstraße 1');
data.append('invoice[seller][address][city]', 'Berlin');
data.append('invoice[seller][address][postcode]', '10115');
data.append('invoice[seller][address][country]', 'DE');
data.append('invoice[buyer][name]', 'Contoso AG');
data.append('invoice[buyer][address][line1]', 'Am Markt 5');
data.append('invoice[buyer][address][city]', 'Hamburg');
data.append('invoice[buyer][address][postcode]', '20095');
data.append('invoice[buyer][address][country]', 'DE');
data.append('invoice[payment][iban]', 'DE02120300000000202051');
data.append('invoice[lines][0][name]', 'Consulting');
data.append('invoice[lines][0][quantity]', '8');
data.append('invoice[lines][0][unit]', 'HUR');
data.append('invoice[lines][0][unit_price]', '120');
data.append('invoice[lines][0][vat_rate]', '19');
data.append('invoice[charges][0][amount]', '4.95');
data.append('invoice[charges][0][reason]', 'Shipping');
data.append('invoice[charges][0][vat_rate]', '19');
fetch('https://apdf.io/api/pdf/einvoice/create', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/einvoice/create', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'invoice[number]' => 'RE-2026-0042',
'invoice[issue_date]' => '2026-11-11',
'invoice[due_date]' => '2026-11-25',
'invoice[currency]' => 'EUR',
'invoice[seller][name]' => 'Acme GmbH',
'invoice[seller][vat_id]' => 'DE123456789',
'invoice[seller][address][line1]' => 'Hauptstraße 1',
'invoice[seller][address][city]' => 'Berlin',
'invoice[seller][address][postcode]' => '10115',
'invoice[seller][address][country]' => 'DE',
'invoice[buyer][name]' => 'Contoso AG',
'invoice[buyer][address][line1]' => 'Am Markt 5',
'invoice[buyer][address][city]' => 'Hamburg',
'invoice[buyer][address][postcode]' => '20095',
'invoice[buyer][address][country]' => 'DE',
'invoice[payment][iban]' => 'DE02120300000000202051',
'invoice[lines][0][name]' => 'Consulting',
'invoice[lines][0][quantity]' => '8',
'invoice[lines][0][unit]' => 'HUR',
'invoice[lines][0][unit_price]' => '120',
'invoice[lines][0][vat_rate]' => '19',
'invoice[charges][0][amount]' => '4.95',
'invoice[charges][0][reason]' => 'Shipping',
'invoice[charges][0][vat_rate]' => '19'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/einvoice/create',
{
'file' => 'FILE_URL',
'invoice[number]' => 'RE-2026-0042',
'invoice[issue_date]' => '2026-11-11',
'invoice[due_date]' => '2026-11-25',
'invoice[currency]' => 'EUR',
'invoice[seller][name]' => 'Acme GmbH',
'invoice[seller][vat_id]' => 'DE123456789',
'invoice[seller][address][line1]' => 'Hauptstraße 1',
'invoice[seller][address][city]' => 'Berlin',
'invoice[seller][address][postcode]' => '10115',
'invoice[seller][address][country]' => 'DE',
'invoice[buyer][name]' => 'Contoso AG',
'invoice[buyer][address][line1]' => 'Am Markt 5',
'invoice[buyer][address][city]' => 'Hamburg',
'invoice[buyer][address][postcode]' => '20095',
'invoice[buyer][address][country]' => 'DE',
'invoice[payment][iban]' => 'DE02120300000000202051',
'invoice[lines][0][name]' => 'Consulting',
'invoice[lines][0][quantity]' => '8',
'invoice[lines][0][unit]' => 'HUR',
'invoice[lines][0][unit_price]' => '120',
'invoice[lines][0][vat_rate]' => '19',
'invoice[charges][0][amount]' => '4.95',
'invoice[charges][0][reason]' => 'Shipping',
'invoice[charges][0][vat_rate]' => '19'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/einvoice/create',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'invoice[number]': 'RE-2026-0042',
'invoice[issue_date]': '2026-11-11',
'invoice[due_date]': '2026-11-25',
'invoice[currency]': 'EUR',
'invoice[seller][name]': 'Acme GmbH',
'invoice[seller][vat_id]': 'DE123456789',
'invoice[seller][address][line1]': 'Hauptstraße 1',
'invoice[seller][address][city]': 'Berlin',
'invoice[seller][address][postcode]': '10115',
'invoice[seller][address][country]': 'DE',
'invoice[buyer][name]': 'Contoso AG',
'invoice[buyer][address][line1]': 'Am Markt 5',
'invoice[buyer][address][city]': 'Hamburg',
'invoice[buyer][address][postcode]': '20095',
'invoice[buyer][address][country]': 'DE',
'invoice[payment][iban]': 'DE02120300000000202051',
'invoice[lines][0][name]': 'Consulting',
'invoice[lines][0][quantity]': '8',
'invoice[lines][0][unit]': 'HUR',
'invoice[lines][0][unit_price]': '120',
'invoice[lines][0][vat_rate]': '19',
'invoice[charges][0][amount]': '4.95',
'invoice[charges][0][reason]': 'Shipping',
'invoice[charges][0][vat_rate]': '19'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"invoice[number]": "RE-2026-0042",
"invoice[issue_date]": "2026-11-11",
"invoice[due_date]": "2026-11-25",
"invoice[currency]": "EUR",
"invoice[seller][name]": "Acme GmbH",
"invoice[seller][vat_id]": "DE123456789",
"invoice[seller][address][line1]": "Hauptstraße 1",
"invoice[seller][address][city]": "Berlin",
"invoice[seller][address][postcode]": "10115",
"invoice[seller][address][country]": "DE",
"invoice[buyer][name]": "Contoso AG",
"invoice[buyer][address][line1]": "Am Markt 5",
"invoice[buyer][address][city]": "Hamburg",
"invoice[buyer][address][postcode]": "20095",
"invoice[buyer][address][country]": "DE",
"invoice[payment][iban]": "DE02120300000000202051",
"invoice[lines][0][name]": "Consulting",
"invoice[lines][0][quantity]": "8",
"invoice[lines][0][unit]": "HUR",
"invoice[lines][0][unit_price]": "120",
"invoice[lines][0][vat_rate]": "19",
"invoice[charges][0][amount]": "4.95",
"invoice[charges][0][reason]": "Shipping",
"invoice[charges][0][vat_rate]": "19"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/einvoice/create")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("invoice[number]", "RE-2026-0042")
.add("invoice[issue_date]", "2026-11-11")
.add("invoice[due_date]", "2026-11-25")
.add("invoice[currency]", "EUR")
.add("invoice[seller][name]", "Acme GmbH")
.add("invoice[seller][vat_id]", "DE123456789")
.add("invoice[seller][address][line1]", "Hauptstraße 1")
.add("invoice[seller][address][city]", "Berlin")
.add("invoice[seller][address][postcode]", "10115")
.add("invoice[seller][address][country]", "DE")
.add("invoice[buyer][name]", "Contoso AG")
.add("invoice[buyer][address][line1]", "Am Markt 5")
.add("invoice[buyer][address][city]", "Hamburg")
.add("invoice[buyer][address][postcode]", "20095")
.add("invoice[buyer][address][country]", "DE")
.add("invoice[payment][iban]", "DE02120300000000202051")
.add("invoice[lines][0][name]", "Consulting")
.add("invoice[lines][0][quantity]", "8")
.add("invoice[lines][0][unit]", "HUR")
.add("invoice[lines][0][unit_price]", "120")
.add("invoice[lines][0][vat_rate]", "19")
.add("invoice[charges][0][amount]", "4.95")
.add("invoice[charges][0][reason]", "Shipping")
.add("invoice[charges][0][vat_rate]", "19")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/einvoice/create")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ7F2M9BXR4TNC6WD8HJ3PZQ"
}
Job Result
JSON{
"id": "01KQ7F2M9BXR4TNC6WD8HJ3PZQ",
"created": "2026-11-11T09:30:52.133821Z",
"status": "successful",
"result": {
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/9c3e51b7a40d2f68.pdf",
"expiration": "2026-11-11T10:30:54.450552Z",
"level": "EN 16931"
}
}
Read E-Invoice
Get the invoice data and the XML of a ZUGFeRD, Factur-X or XRechnung invoice, as PDF or XML
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the e-invoice: a PDF, or an invoice XML in the CII syntax |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
How it works
invoicehas the same fields /pdf/einvoice/create takes, plus each line'samount, thevat_breakdownand thetotals(withdiscount_totalandcharge_total) as the invoice states themtype,vat_categoryandpayment.methoduse the names /pdf/einvoice/create takes, or the code of the standard for values without a namelevelis one ofMINIMUM,BASIC WL,BASIC,EN 16931,EXTENDEDorXRECHNUNG, andxmlis the invoice XML as it is- An XML file is read the same way as a PDF. An XRechnung in the UBL syntax can be validated but not read
- The data is read without checking it, use /pdf/einvoice/validate for that
Request
curl -X POST https://apdf.io/api/pdf/einvoice/read \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/einvoice/read', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/einvoice/read', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/einvoice/read',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/einvoice/read',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/einvoice/read")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/einvoice/read")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"level": "EN 16931",
"invoice": {
"number": "RE-2026-0042",
"type": "invoice",
"issue_date": "2026-11-11",
"due_date": "2026-11-25",
"currency": "EUR",
"buyer_reference": null,
"order_reference": null,
"contract_reference": null,
"project_reference": null,
"accounting_reference": null,
"billing_period": null,
"notes": [],
"preceding_invoices": [],
"seller": {
"name": "Acme GmbH",
"vat_id": "DE123456789",
"tax_number": null,
"registration_number": null,
"electronic_address": null,
"address": {
"line1": "Hauptstraße 1",
"line2": null,
"city": "Berlin",
"postcode": "10115",
"country": "DE"
},
"contact": null
},
"buyer": {
"name": "Contoso AG",
"vat_id": null,
"electronic_address": null,
"address": {
"line1": "Am Markt 5",
"line2": null,
"city": "Hamburg",
"postcode": "20095",
"country": "DE"
}
},
"delivery": null,
"payment": {
"method": "credit_transfer",
"iban": "DE02120300000000202051",
"bic": null,
"account_name": null,
"debtor_iban": null,
"creditor_id": null,
"mandate_reference": null,
"card_last_digits": null,
"card_holder": null,
"details": null,
"reference": null,
"terms": null
},
"lines": [
{
"name": "Consulting",
"description": null,
"item_number": null,
"quantity": 8,
"unit": "HUR",
"unit_price": 120,
"vat_category": "standard",
"vat_rate": 19,
"discounts": [],
"charges": [],
"amount": 960
}
],
"discounts": [],
"charges": [
{
"amount": 4.95,
"percent": null,
"reason": "Shipping",
"vat_category": "standard",
"vat_rate": 19
}
],
"vat_breakdown": [
{
"category": "standard",
"rate": 19,
"net_amount": 964.95,
"vat_amount": 183.34,
"exemption_reason": null
}
],
"totals": {
"line_total": 960,
"discount_total": 0,
"charge_total": 4.95,
"net_total": 964.95,
"vat_total": 183.34,
"gross_total": 1148.29,
"paid_amount": 0,
"amount_due": 1148.29
}
},
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rsm:CrossIndustryInvoice ...>...</rsm:CrossIndustryInvoice>"
}
Validate E-Invoice
Check a ZUGFeRD, Factur-X or XRechnung invoice, as PDF or XML, against PDF/A-3 and the rules of its invoice XML
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the e-invoice: a PDF, or an invoice XML such as an XRechnung |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
How it works
- An XML file is checked the same way without the PDF part, in the CII and the UBL syntax
- The PDF is checked against PDF/A-3, the invoice XML against the schema and business rules of EN 16931, Factur-X / ZUGFeRD and, for XRECHNUNG, XRechnung
validistruewhen there are noerrors.warningsdon't make an e-invoice invalidcheckslists what was tested, thepdfand the invoicexml, each with the number of rules checked and failed- Each finding names its
source(pdf,xmlorfile), theruleit breaks, likeBR-CO-16, and amessage
Request
curl -X POST https://apdf.io/api/pdf/einvoice/validate \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/einvoice/validate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/einvoice/validate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/einvoice/validate',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/einvoice/validate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/einvoice/validate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/einvoice/validate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ7F2M9BXR4TNC6WD8HJ3PZQ"
}
Job Result
JSON{
"id": "01KQ7F2M9BXR4TNC6WD8HJ3PZQ",
"created": "2026-11-11T09:30:52.133821Z",
"status": "successful",
"result": {
"valid": false,
"level": "EN 16931",
"checks": [
{
"source": "pdf",
"valid": true,
"rules_checked": 2113,
"rules_failed": 0
},
{
"source": "xml",
"valid": false,
"rules_checked": 122,
"rules_failed": 1
}
],
"errors": [
{
"source": "xml",
"rule": "BR-CO-16",
"message": "Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) +Rounding amount (BT-114)."
}
],
"warnings": []
}
}
OCR Convert
Convert a scanned PDF to a PDF with selectable text (through OCR)
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/ocr/convert \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/ocr/convert', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/ocr/convert', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/ocr/convert',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/ocr/convert',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/ocr/convert")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/ocr/convert")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ3C8E1FGHJ4KMLN5PR6STVW"
}
Job Result
JSON{
"id": "01KQ3C8E1FGHJ4KMLN5PR6STVW",
"created": "2024-12-02T21:30:52.133821Z",
"status": "successful",
"result": {
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/6f1674e2703953aa.pdf",
"expiration": "2024-12-02T22:30:54.450552Z",
"pages": 1,
"size": 11838
}
}
OCR Search
Search for text inside a scanned PDF (through OCR)
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| text | yes | Text to search for |
| case | no | Set case to 1 for a case-sensitive search |
| regex | no | Set regex to 1 to interpret the search text as a regular expression |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/ocr/search \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d text="SEARCH_TEXT"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('text', 'SEARCH_TEXT');
fetch('https://apdf.io/api/pdf/ocr/search', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/ocr/search', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'text' => 'SEARCH_TEXT'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/ocr/search',
{
'file' => 'FILE_URL',
'text' => 'SEARCH_TEXT'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/ocr/search',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'text': 'SEARCH_TEXT'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"text": "SEARCH_TEXT"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/ocr/search")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("text", "SEARCH_TEXT")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/ocr/search")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ3EAG3JKMN6PQR7STV8WXYZ"
}
Job Result
JSON{
"id": "01KQ3EAG3JKMN6PQR7STV8WXYZ",
"created": "2024-12-02T21:30:52.133821Z",
"status": "successful",
"result": {
"search_text": "portable document format",
"results_total": 3,
"results_pages": 2,
"results": [
{
"page": "6",
"matched_line": "7. \"ISO 32000-1:2008 – Document management – Portable document format – Part 1: PDF",
"exact_word": "Portable document format"
},
{
"page": "17",
"matched_line": "37. Adobe Systems Inc. (July 1, 2008). \"Document Management – Portable Document Format –",
"exact_word": "Portable Document Format"
},
{
"page": "17",
"matched_line": "64. \"Processing Dangerous Paths – On Security and Privacy of the Portable Document Format\"",
"exact_word": "Portable Document Format"
}
]
}
}
OCR Extract
Extract the content from a scanned PDF (through OCR)
Async-only endpoint
This endpoint always runs in the background. The response returns a job_id
instead of the result.
Poll Check Job Status or pass
a webhook_url to receive the
result when the job completes.
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/ocr/read \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/ocr/read', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/ocr/read', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/ocr/read',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/ocr/read',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/ocr/read")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/ocr/read")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Initial Response
JSON{
"job_id": "01KQ3D9F2HJKL5MNP6QRT7UVWX"
}
Job Result
JSON{
"id": "01KQ3D9F2HJKL5MNP6QRT7UVWX",
"created": "2024-12-02T21:30:52.133821Z",
"status": "successful",
"result": {
"pages_total": 3,
"characters_total": 8642,
"pages": [
{
"page": 1,
"characters": 2398,
"content": "PDF\\nPortable Document Format (PDF), standardized as\\nISO 32000 ..."
},
{
"page": 2,
"characters": 2900,
"content": "PDF was a proprietary format controlled by Adobe until it was released ..."
},
{
"page": 3,
"characters": 3344,
"content": "PostScript was originally designed for a drastically different use case ..."
}
]
}
}
Set Password
Add password protection to the PDF
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| owner_password | yes | The owner password used for encryption and for setting/removing restrictions |
| user_password | no | The user password required to open and view the PDF |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/security/add \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d owner_password="OWNER_PASSWORD" \
-d user_password="USER_PASSWORD"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('owner_password', 'OWNER_PASSWORD');
data.append('user_password', 'USER_PASSWORD');
fetch('https://apdf.io/api/pdf/security/add', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/security/add', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'owner_password' => 'OWNER_PASSWORD',
'user_password' => 'USER_PASSWORD'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/security/add',
{
'file' => 'FILE_URL',
'owner_password' => 'OWNER_PASSWORD',
'user_password' => 'USER_PASSWORD'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/security/add',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'owner_password': 'OWNER_PASSWORD',
'user_password': 'USER_PASSWORD'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"owner_password": "OWNER_PASSWORD",
"user_password": "USER_PASSWORD"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/security/add")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("owner_password", "OWNER_PASSWORD")
.add("user_password", "USER_PASSWORD")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/security/add")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785.pdf",
"expiration": "2024-12-15T13:16:12.757041Z"
}
Remove Password
Remove password protection from the PDF
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| password | no | The owner or user password |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/security/remove \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d password="PASSWORD"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('password', 'PASSWORD');
fetch('https://apdf.io/api/pdf/security/remove', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/security/remove', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'password' => 'PASSWORD'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/security/remove',
{
'file' => 'FILE_URL',
'password' => 'PASSWORD'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/security/remove',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'password': 'PASSWORD'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"password": "PASSWORD"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/security/remove")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("password", "PASSWORD")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/security/remove")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/b72674993b1ae785.pdf",
"expiration": "2024-12-15T13:16:12.757041Z"
}
Read Metadata
Get metadata from a PDF file
Parameters
| Parameter | Required | Description |
|---|---|---|
| file | yes | URL of the PDF file |
| async | no | Set async to 1 for executing this call in the background. API will return a job ID for requesting the /job/status/check endpoint |
| webhook_url | no | Result of the async job will be sent as a POST request to this URL |
Request
curl -X POST https://apdf.io/api/pdf/metadata/read \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');
fetch('https://apdf.io/api/pdf/metadata/read', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/metadata/read', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/metadata/read',
{
'file' => 'FILE_URL'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/metadata/read',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/metadata/read")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/metadata/read")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
JSON{
"title": "Example",
"creator": "apdf.io",
"producer": "Apdf/API",
"created": "Tue Jul 1 07:24:47 2024 CEST",
"modified": "Tue Jul 1 07:24:47 2024 CEST",
"pages": 4,
"encrypted": false,
"page_size": "595.92 x 841.92 pts (A4)",
"file_size": 221441,
"pdf_version": "1.4"
}
Check Job Status
Check the job status of an asynchronous API call
Parameters
| Parameter | Required | Description |
|---|---|---|
| id | yes | ID of the asynchronous job |
Request
curl -X POST https://apdf.io/api/job/status/check \
-H "Authorization: Bearer TOKEN" \
-d id="JOB_ID"
const data = new FormData();
data.append('id', 'JOB_ID');
fetch('https://apdf.io/api/job/status/check', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/job/status/check', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'id' => 'JOB_ID'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/job/status/check',
{
'id' => 'JOB_ID'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/job/status/check',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'id': 'JOB_ID'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"id": "JOB_ID"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/job/status/check")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("id", "JOB_ID")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/job/status/check")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Response
RUNNING{
"id": "01JEB5W3960DD5363GCSPNSQVX",
"created": "2024-12-01T10:29:26.000000Z",
"status": "running",
"result": null
}
{
"id": "01JEB5W3960DD5363GCSPNSQVX",
"created": "2024-12-02T22:30:54.450552Z",
"status": "successful",
"result": {
"file": "https://apdf-files.s3.eu-central-1.amazonaws.com/6f1674e2703953aa.pdf",
"expiration": "2024-12-02T23:33:41.450552Z",
"pages": 1,
"size": 11838
}
}