Skip to main content
POST
/
v1
/
pdf
/
edit
/
add
PDF Add
curl --request POST \
  --url https://api.pdf.co/v1/pdf/edit/add \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/sample.pdf",
  "annotationsString": "<string>",
  "annotations": [
    {
      "text": "sample prefilled text",
      "x": 10,
      "y": 30,
      "size": 12,
      "pages": "0-",
      "type": "TextField",
      "id": "textfield1"
    },
    {
      "x": 100,
      "y": 150,
      "size": 12,
      "pages": "0-",
      "type": "Checkbox",
      "id": "checkbox2"
    },
    {
      "x": 100,
      "y": 170,
      "size": 12,
      "pages": "0-",
      "link": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png",
      "type": "CheckboxChecked",
      "id": "checkbox3"
    }
  ],
  "images": [
    {
      "url": "pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png",
      "x": 200,
      "y": 250,
      "pages": "0",
      "link": "www.pdf.co"
    }
  ],
  "fields": [
    {
      "fieldName": "<string>",
      "text": "<string>",
      "pages": "0,2,5-10, !0, !5-!2",
      "size": 123,
      "fontName": "<string>",
      "fontBold": true,
      "fontItalic": true,
      "fontStrikeout": true,
      "fontUnderline": true
    }
  ],
  "name": "newDocument",
  "async": false,
  "inline": true,
  "expiration": 60,
  "imagesString": "<string>",
  "fieldsString": "<string>",
  "profiles": "<string>",
  "httpusername": "<string>",
  "httppassword": "<string>"
}
'
{
  "status": "success",
  "message": "Success",
  "url": "https://pdf-temp-files.s3.us-west-2.amazonaws.com/output.pdf",
  "jobId": "6YSZD3U872ZYYFEDMQCQSGEEO8YSF5WA",
  "credits": 2,
  "remainingCredits": 1480582,
  "duration": 33
}

Authorizations

x-api-key
string
header
required

Body

application/json
url
string<uri>
default:https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/sample.pdf
required

URL to the source file url attribute.

annotationsString
string<{x};{y};{pages};{text};{fontsize};{fontname};{fontcolor};{link};{transparent};{width};{height};{alignment}>
required

This parameter represents one or more text objects to add to a PDF. Each object is made of parameter separated by the ; symbol.

annotations
object[]

Annotation (textual) signatures to add.

images
object[]

Image signatures to add.

fields
object[]
name
string
default:newDocument

File name for generated output.

async
boolean
default:false

Set async to true for long processes to run in the background, API will then return a jobId which you can use with the Background Job Check endpoint. Also see Webhooks & Callbacks

inline
boolean
default:true

Set to true to return results inside the response. Otherwise, the endpoint will return a URL to the output file generated.

expiration
number
default:60

Sets the expiration time for the output link, in minutes. After this period, generated output file(s) are automatically deleted from PDF.co Temporary Files Storage. The maximum allowed duration depends on your subscription plan. For permanent storage of input files (e.g., reusable images, PDF templates, documents), use PDF.co Built‑In Files Storage.

imagesString
string<{x};{y};{pages};{urltoimageOrPdf};{linkToOpen};{width};{height}>

Adds one or more images or other PDF objects on top of the source PDF. Each object is made of parameter separated by the ; symbol.

fieldsString
string<{page};{fieldName};{value}>

Set values for fillable PDF field objects. Each object is made of parameter separated by the ; symbol.

profiles
string

Profiles are used configure extra options for specific API endpoints and may be unique to an API. For more information, see Profiles and the documentation of each endpoint for profiles specific to it.

httpusername
string

HTTP auth user name if required to access source URL.

httppassword
string

HTTP auth password if required to access source URL.

Response

Success.

status
string

Status of the API response.

Example:

"success"

message
string

Descriptive message for the response status.

Example:

"Success"

url
string<uri>

URL to the output file.

Example:

"https://pdf-temp-files.s3.us-west-2.amazonaws.com/output.pdf"

jobId
string

Unique identifier for the job.

Example:

"6YSZD3U872ZYYFEDMQCQSGEEO8YSF5WA"

credits
integer

Credits used for this operation.

Example:

2

remainingCredits
integer

Credits remaining after this operation.

Example:

1480582

duration
integer

Time taken to complete the request, in milliseconds.

Example:

33