Sample request
cURL
curl --request POST 'https://api.pdf.co/v1/job/check' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"jobid":"YOUR_JOB_ID"}'
const https = require("node:https");
const request = https.request("https://api.pdf.co/v1/job/check", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
}, (response) => {
console.log("HTTP", response.statusCode);
response.pipe(process.stdout);
});
request.on("error", console.error);
request.end(JSON.stringify({ jobid: "YOUR_JOB_ID" }));
import requests # pip install requests
response = requests.post(
"https://api.pdf.co/v1/job/check",
headers={"x-api-key": "YOUR_API_KEY"},
json={"jobid": "YOUR_JOB_ID"},
)
print(response.status_code, response.text)
import com.google.gson.JsonObject;
import java.io.IOException;
import okhttp3.*;
public class Main {
public static void main(String[] args) throws IOException {
OkHttpClient webClient = new OkHttpClient();
JsonObject jsonBody = new JsonObject();
jsonBody.addProperty("jobid", "YOUR_JOB_ID");
RequestBody body = RequestBody.create(
MediaType.parse("application/json"), jsonBody.toString());
Request request = new Request.Builder()
.url("https://api.pdf.co/v1/job/check")
.addHeader("x-api-key", "YOUR_API_KEY")
.post(body)
.build();
try (Response response = webClient.newCall(request).execute()) {
System.out.println(response.code());
System.out.println(response.body().string());
}
}
}
<?php
$curl = curl_init("https://api.pdf.co/v1/job/check");
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["x-api-key: YOUR_API_KEY", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["jobid" => "YOUR_JOB_ID"]),
CURLOPT_RETURNTRANSFER => true
]);
$result = curl_exec($curl);
if ($result === false) {
echo curl_error($curl);
} else {
echo curl_getinfo($curl, CURLINFO_HTTP_CODE), PHP_EOL, $result;
}
curl_close($curl);
{
"status": "working",
"message": "Working",
"jobId": "YOUR_JOB_ID",
"duration": 0,
"credits": 2,
"remainingCredits": 60227
}
{
"status": "error",
"errorCode": 400,
"error": true,
"message": "Malformed JSON or bad request parameters"
}
{
"status": "error",
"errorCode": 401,
"error": true,
"message": "Please provide your API key as \"x-api-key\" header parameter for GET or POST request or as username (\"curl -u <apikey>\") or as url parameter (not recommended). Get your API key at https://app.pdf.co/account"
}
{
"status": "error",
"errorCode": 402,
"error": true,
"message": "Not enough credits, subscription expired or metered use is not allowed. Please review credits on your account at https://app.pdf.co/subscriptions"
}
{
"status": "error",
"errorCode": 403,
"error": true,
"message": "This API endpoint is not available on your subscription plan."
}
{
"errorCode": 404,
"error": true,
"message": "Job not found",
"remainingCredits": 60227,
"credits": 0
}
{
"error": true,
"message": "Too many requests. Your current limit is 60 requests per minute. Please try again later"
}
{
"status": "error",
"errorCode": 500,
"error": true,
"message": "internal error"
}
cURL
curl --request POST 'https://api.pdf.co/v1/job/check' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"jobid":"YOUR_JOB_ID"}'
const https = require("node:https");
const request = https.request("https://api.pdf.co/v1/job/check", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
}, (response) => {
console.log("HTTP", response.statusCode);
response.pipe(process.stdout);
});
request.on("error", console.error);
request.end(JSON.stringify({ jobid: "YOUR_JOB_ID" }));
import requests # pip install requests
response = requests.post(
"https://api.pdf.co/v1/job/check",
headers={"x-api-key": "YOUR_API_KEY"},
json={"jobid": "YOUR_JOB_ID"},
)
print(response.status_code, response.text)
import com.google.gson.JsonObject;
import java.io.IOException;
import okhttp3.*;
public class Main {
public static void main(String[] args) throws IOException {
OkHttpClient webClient = new OkHttpClient();
JsonObject jsonBody = new JsonObject();
jsonBody.addProperty("jobid", "YOUR_JOB_ID");
RequestBody body = RequestBody.create(
MediaType.parse("application/json"), jsonBody.toString());
Request request = new Request.Builder()
.url("https://api.pdf.co/v1/job/check")
.addHeader("x-api-key", "YOUR_API_KEY")
.post(body)
.build();
try (Response response = webClient.newCall(request).execute()) {
System.out.println(response.code());
System.out.println(response.body().string());
}
}
}
<?php
$curl = curl_init("https://api.pdf.co/v1/job/check");
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["x-api-key: YOUR_API_KEY", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["jobid" => "YOUR_JOB_ID"]),
CURLOPT_RETURNTRANSFER => true
]);
$result = curl_exec($curl);
if ($result === false) {
echo curl_error($curl);
} else {
echo curl_getinfo($curl, CURLINFO_HTTP_CODE), PHP_EOL, $result;
}
curl_close($curl);
{
"status": "working",
"message": "Working",
"jobId": "YOUR_JOB_ID",
"duration": 0,
"credits": 2,
"remainingCredits": 60227
}
{
"status": "error",
"errorCode": 400,
"error": true,
"message": "Malformed JSON or bad request parameters"
}
{
"status": "error",
"errorCode": 401,
"error": true,
"message": "Please provide your API key as \"x-api-key\" header parameter for GET or POST request or as username (\"curl -u <apikey>\") or as url parameter (not recommended). Get your API key at https://app.pdf.co/account"
}
{
"status": "error",
"errorCode": 402,
"error": true,
"message": "Not enough credits, subscription expired or metered use is not allowed. Please review credits on your account at https://app.pdf.co/subscriptions"
}
{
"status": "error",
"errorCode": 403,
"error": true,
"message": "This API endpoint is not available on your subscription plan."
}
{
"errorCode": 404,
"error": true,
"message": "Job not found",
"remainingCredits": 60227,
"credits": 0
}
{
"error": true,
"message": "Too many requests. Your current limit is 60 requests per minute. Please try again later"
}
{
"status": "error",
"errorCode": 500,
"error": true,
"message": "internal error"
}
Document, File & System
Background & Job Check
Checks the status of a background job that was previously created with PDF.co API. Use this API to check the status of your asynchronous API calls.
Sample request
cURL
curl --request POST 'https://api.pdf.co/v1/job/check' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"jobid":"YOUR_JOB_ID"}'
const https = require("node:https");
const request = https.request("https://api.pdf.co/v1/job/check", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
}, (response) => {
console.log("HTTP", response.statusCode);
response.pipe(process.stdout);
});
request.on("error", console.error);
request.end(JSON.stringify({ jobid: "YOUR_JOB_ID" }));
import requests # pip install requests
response = requests.post(
"https://api.pdf.co/v1/job/check",
headers={"x-api-key": "YOUR_API_KEY"},
json={"jobid": "YOUR_JOB_ID"},
)
print(response.status_code, response.text)
import com.google.gson.JsonObject;
import java.io.IOException;
import okhttp3.*;
public class Main {
public static void main(String[] args) throws IOException {
OkHttpClient webClient = new OkHttpClient();
JsonObject jsonBody = new JsonObject();
jsonBody.addProperty("jobid", "YOUR_JOB_ID");
RequestBody body = RequestBody.create(
MediaType.parse("application/json"), jsonBody.toString());
Request request = new Request.Builder()
.url("https://api.pdf.co/v1/job/check")
.addHeader("x-api-key", "YOUR_API_KEY")
.post(body)
.build();
try (Response response = webClient.newCall(request).execute()) {
System.out.println(response.code());
System.out.println(response.body().string());
}
}
}
<?php
$curl = curl_init("https://api.pdf.co/v1/job/check");
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["x-api-key: YOUR_API_KEY", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["jobid" => "YOUR_JOB_ID"]),
CURLOPT_RETURNTRANSFER => true
]);
$result = curl_exec($curl);
if ($result === false) {
echo curl_error($curl);
} else {
echo curl_getinfo($curl, CURLINFO_HTTP_CODE), PHP_EOL, $result;
}
curl_close($curl);
{
"status": "working",
"message": "Working",
"jobId": "YOUR_JOB_ID",
"duration": 0,
"credits": 2,
"remainingCredits": 60227
}
{
"status": "error",
"errorCode": 400,
"error": true,
"message": "Malformed JSON or bad request parameters"
}
{
"status": "error",
"errorCode": 401,
"error": true,
"message": "Please provide your API key as \"x-api-key\" header parameter for GET or POST request or as username (\"curl -u <apikey>\") or as url parameter (not recommended). Get your API key at https://app.pdf.co/account"
}
{
"status": "error",
"errorCode": 402,
"error": true,
"message": "Not enough credits, subscription expired or metered use is not allowed. Please review credits on your account at https://app.pdf.co/subscriptions"
}
{
"status": "error",
"errorCode": 403,
"error": true,
"message": "This API endpoint is not available on your subscription plan."
}
{
"errorCode": 404,
"error": true,
"message": "Job not found",
"remainingCredits": 60227,
"credits": 0
}
{
"error": true,
"message": "Too many requests. Your current limit is 60 requests per minute. Please try again later"
}
{
"status": "error",
"errorCode": 500,
"error": true,
"message": "internal error"
}
cURL
curl --request POST 'https://api.pdf.co/v1/job/check' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"jobid":"YOUR_JOB_ID"}'
const https = require("node:https");
const request = https.request("https://api.pdf.co/v1/job/check", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
}, (response) => {
console.log("HTTP", response.statusCode);
response.pipe(process.stdout);
});
request.on("error", console.error);
request.end(JSON.stringify({ jobid: "YOUR_JOB_ID" }));
import requests # pip install requests
response = requests.post(
"https://api.pdf.co/v1/job/check",
headers={"x-api-key": "YOUR_API_KEY"},
json={"jobid": "YOUR_JOB_ID"},
)
print(response.status_code, response.text)
import com.google.gson.JsonObject;
import java.io.IOException;
import okhttp3.*;
public class Main {
public static void main(String[] args) throws IOException {
OkHttpClient webClient = new OkHttpClient();
JsonObject jsonBody = new JsonObject();
jsonBody.addProperty("jobid", "YOUR_JOB_ID");
RequestBody body = RequestBody.create(
MediaType.parse("application/json"), jsonBody.toString());
Request request = new Request.Builder()
.url("https://api.pdf.co/v1/job/check")
.addHeader("x-api-key", "YOUR_API_KEY")
.post(body)
.build();
try (Response response = webClient.newCall(request).execute()) {
System.out.println(response.code());
System.out.println(response.body().string());
}
}
}
<?php
$curl = curl_init("https://api.pdf.co/v1/job/check");
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["x-api-key: YOUR_API_KEY", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["jobid" => "YOUR_JOB_ID"]),
CURLOPT_RETURNTRANSFER => true
]);
$result = curl_exec($curl);
if ($result === false) {
echo curl_error($curl);
} else {
echo curl_getinfo($curl, CURLINFO_HTTP_CODE), PHP_EOL, $result;
}
curl_close($curl);
{
"status": "working",
"message": "Working",
"jobId": "YOUR_JOB_ID",
"duration": 0,
"credits": 2,
"remainingCredits": 60227
}
{
"status": "error",
"errorCode": 400,
"error": true,
"message": "Malformed JSON or bad request parameters"
}
{
"status": "error",
"errorCode": 401,
"error": true,
"message": "Please provide your API key as \"x-api-key\" header parameter for GET or POST request or as username (\"curl -u <apikey>\") or as url parameter (not recommended). Get your API key at https://app.pdf.co/account"
}
{
"status": "error",
"errorCode": 402,
"error": true,
"message": "Not enough credits, subscription expired or metered use is not allowed. Please review credits on your account at https://app.pdf.co/subscriptions"
}
{
"status": "error",
"errorCode": 403,
"error": true,
"message": "This API endpoint is not available on your subscription plan."
}
{
"errorCode": 404,
"error": true,
"message": "Job not found",
"remainingCredits": 60227,
"credits": 0
}
{
"error": true,
"message": "Too many requests. Your current limit is 60 requests per minute. Please try again later"
}
{
"status": "error",
"errorCode": 500,
"error": true,
"message": "internal error"
}
Try it live: Background & Job Check → API Tester lets you send a real request from your browser.
POST /v1/job/check
Quick start
Use the
jobId returned by another endpoint with async: true, or by an asynchronous-only endpoint. Job Check applies only to asynchronous calls.jobid field.
{ "jobid": "YOUR_JOB_ID" }
jobId as lowercase jobid and use the same PDF.co account API key in the x-api-key header.
Request body
Attributes are case-sensitive and should be inside JSON for POST request. for example:
{ "jobid": "YOUR_JOB_ID" } No query parameters accepted.ID returned by another endpoint called with
async set to true, or by an asynchronous-only endpoint.Responses
Available Status Values
The HTTP status code and job status describe different outcomes. HTTP
200 means the check succeeded. The response body’s status field reports whether the job is working, success, failed, or aborted.Jobs are private to the account that created them. This endpoint checks jobs belonging to the account identified by your API key. If a known job ID returns HTTP
404, first check that you are using the same API key that created it. See Job not found.| Status | What to do next |
|---|---|
working | Check again after a short delay using the same job ID. |
success | Use the result returned by the job. |
failed | Inspect message for the reason the job failed. |
aborted | Stop polling. The job was aborted. |
Completed job example
The illustrative200 example shows a job in progress. This response shows the same job after it produced a file. Both examples show legacy billing, which charges 2 credits per check for these job states. The output format depends on the original request.
{
"status": "success",
"message": "Success",
"url": "https://example.com/results/output.json",
"jobId": "YOUR_JOB_ID",
"jobDuration": 412,
"duration": 0,
"credits": 2,
"remainingCredits": 60225
}
In cURL output, JSON may represent an ampersand in a URL as
\u0026. A JSON parser decodes it to & when you read the URL.429 example is illustrative and depends on your account. For HTTP errors, status: "error" describes the request error.
Response fields
The fields returned depend on the job, its state, and the result available when you check it.Current job state. See Available Status Values.
Credits charged for this status check. With legacy billing, checking a
working or success job costs 2 credits. With newer billing, these checks cost 0 credits. Checking a failed job costs 0 credits. Use the returned credits value to see the charge for each check.Job not found (HTTP 404)
See Response Codes for more information about HTTP errors.
jobid, the API returns HTTP 404 with a message beginning Missing parameter jobid. Add the ID from the original request and send the corrected body.
If you supply a jobid and receive Job not found, verify the ID and API key before checking again. The ID may be incorrect, belong to another account, or refer to a job that is no longer available.
Was this page helpful?