PDF.co Web API (Application Programming Interface)

Get Your Free API Key

GET - https://api.pdf.co/v1/templates
Document templates list for current user

Supported Formats

json

Errors

Code Description
401 unauthorized

Examples

GET /api/v1/templates
200
[
  {
    "id": "c57f79aa",
    "title": "IT Services Agreement - for our group",
    "description": "IT Services Agreement - template for our group",
    "mode": "unlisted",
    "created_at": "2017-12-02T15:35:59.565Z",
    "updated_at": "2017-12-02T15:36:52.643Z",
    "url": "http://pdf.co/t/information-tec-c57f79aa",
    "url_public": "http://pdf.co/t/information-tec-c57f79aa?secret_token=e12d74d076694e6b97c1"
  },
  {
    "id": "cd70e9e0",
    "title": "Information Technology Professional Services Agreement",
    "description": "Information Technology Professional Services Agreement template",
    "mode": "private",
    "created_at": "2017-12-02T15:29:09.362Z",
    "updated_at": "2017-12-02T15:34:34.934Z",
    "url": "http://pdf.co/t/information-tec-cd70e9e0",
    "url_public": null
  },
  {
    "id": "17a998ec",
    "title": "Non-Disclosure Agreement Template",
    "description": "Non-Disclosure Agreement template",
    "mode": "unlisted_notify",
    "created_at": "2017-11-24T13:05:58.697Z",
    "updated_at": "2017-12-02T15:33:28.720Z",
    "url": "http://pdf.co/t/contract-nda-17a998ec",
    "url_public": "http://pdf.co/t/contract-nda-17a998ec?secret_token=6c93ce3c39dfefecc82e"
  }
]

GET - https://api.pdf.co/v1/templates/:id
Document template information

Supported Formats

json

Errors

Code Description
401 unauthorized
404 record not found

Examples

GET /api/v1/templates/cd70e9e0
200
{
  "id": "cd70e9e0",
  "title": "Information Technology Professional Services Agreement",
  "mode": "private",
  "fields": [
    {
      "role": "Client",
      "height": 63.33262935586062,
      "width": 130.5427666314678,
      "x": 46.853220696937704,
      "y": 725.4171066525871,
      "page": 1,
      "type": "signature",
      "name": "s1_s1",
      "transparent": true,
      "party_name": null,
      "party_email": null
    },
    {
      "role": "Contractor",
      "height": 63.33262935586062,
      "width": 130.5427666314678,
      "x": 416.5089757127772,
      "y": 717.9852164730729,
      "page": 1,
      "type": "signature",
      "name": "s2_s1",
      "transparent": true,
      "party_name": null,
      "party_email": null
    },
    {
      "role": "Client",
      "height": 21.972544878563887,
      "width": 344.4519535374868,
      "x": 75.28827877507919,
      "y": 179.3347412882788,
      "page": 0,
      "type": "text",
      "name": "s1_t1",
      "transparent": true,
      "party_name": null,
      "party_email": null
    },
    {
      "role": "Contractor",
      "height": 10.986272439281944,
      "width": 355.4382259767687,
      "x": 77.22703273495249,
      "y": 202.92291446673707,
      "page": 0,
      "type": "text",
      "name": "s2_t1",
      "transparent": true,
      "party_name": null,
      "party_email": null
    },
    {
      "role": "Client",
      "height": 10.986272439281944,
      "width": 102.75395987328406,
      "x": 342.8363252375924,
      "y": 402.2914466737065,
      "page": 0,
      "type": "date",
      "name": "s1_d1",
      "transparent": true,
      "party_name": null,
      "party_email": null
    },
    {
      "role": "Client",
      "height": 10.986272439281944,
      "width": 113.74023231256601,
      "x": 68.17951425554382,
      "y": 414.24709609292506,
      "page": 0,
      "type": "date",
      "name": "s1_d2",
      "transparent": true,
      "party_name": null,
      "party_email": null
    }
  ],
  "slug": "information-tec-cd70e9e0",
  "created_at": "2017-12-02T15:29:09.362Z",
  "updated_at": "2017-12-02T15:34:34.934Z",
  "url": "http://pdf.co/t/information-tec-cd70e9e0",
  "roles": [
    "Client",
    "Contractor"
  ],
  "url_public": null,
  "sign_by_owner": false,
  "sign_by_owner_as": ""
}

Params

Param name Description
id
required

Document template id

  • Must be a String

POST - https://api.pdf.co/v1/templates/:id/use
Create and send document from document template

Supported Formats

json

Errors

Code Description
401 unauthorized
404 record not found

Examples

POST /api/v1/templates/726b835a/use
{
  "roles": [
    {
      "role": "Client",
      "name": "Super Company, Inc.",
      "email": "contracts@example.com"
    },
    {
      "role": "Contractor",
      "name": "Alyssa French",
      "email": "alyssa@example.com"
    }
  ],
  "fields": [
    {
      "s1_t1": "Brett Wheeler (CEO)"
    }
  ]
}
200
{
  "document": {
    "id": "bd2a126ae563e95827045a5faf040595cb09791db49400b125",
    "title": "Information_Technology_Professional_Services_Agreement.pdf",
    "created_at": "2017-12-02T15:44:26.463Z",
    "updated_at": "2017-12-02T15:44:26.537Z",
    "executed_document_url": null,
    "executed_document_hash": null,
    "fields": [
      {
        "role": "Client",
        "height": 63.33262935586062,
        "width": 130.5427666314678,
        "x": 46.853220696937704,
        "y": 725.4171066525871,
        "page": 1,
        "type": "signature",
        "name": "s1_s1",
        "transparent": true,
        "user_id": null
      },
      {
        "role": "Contractor",
        "height": 63.33262935586062,
        "width": 130.5427666314678,
        "x": 416.5089757127772,
        "y": 717.9852164730729,
        "page": 1,
        "type": "signature",
        "name": "s2_s1",
        "transparent": true,
        "user_id": null
      },
      {
        "role": "Client",
        "height": 21.972544878563887,
        "width": 344.4519535374868,
        "x": 75.28827877507919,
        "y": 179.3347412882788,
        "page": 0,
        "type": "text",
        "name": "s1_t1",
        "transparent": true,
        "prefilled": "Brett Wheeler (CEO)",
        "user_id": null
      },
      {
        "role": "Contractor",
        "height": 10.986272439281944,
        "width": 355.4382259767687,
        "x": 77.22703273495249,
        "y": 202.92291446673707,
        "page": 0,
        "type": "text",
        "name": "s2_t1",
        "transparent": true,
        "user_id": null
      },
      {
        "role": "Client",
        "height": 10.986272439281944,
        "width": 102.75395987328406,
        "x": 342.8363252375924,
        "y": 402.2914466737065,
        "page": 0,
        "type": "date",
        "name": "s1_d1",
        "transparent": true,
        "user_id": null
      },
      {
        "role": "Client",
        "height": 10.986272439281944,
        "width": 113.74023231256601,
        "x": 68.17951425554382,
        "y": 414.24709609292506,
        "page": 0,
        "type": "date",
        "name": "s1_d2",
        "transparent": true,
        "user_id": null
      }
    ],
    "include_certificate": true,
    "created_from": "api",
    "executed_at": null,
    "created_from_id": null,
    "sender": {
      "id": "6b4de21ebd4db5cd",
      "name": "Brett Wheeler",
      "email": "contracts@example.com"
    },
    "recipients": [
      {
        "name": "Super Company, Inc.",
        "email": "contracts@example.com",
        "invitation_url": "http://pdf.co/invite/2b12ad972c5238d6f9705d80f03131e38aa4572adcc4473cca",
        "status": "pending",
        "id": null
      },
      {
        "name": "Alyssa French",
        "email": "alyssa@example.com",
        "invitation_url": "http://pdf.co/invite/71b90355552d29bc332f0bf2e24c90c32f54a6c1f9605dcfe2",
        "status": "pending",
        "id": null
      }
    ],
    "status": "pending"
  }
}

Params

Param name Description
id
required

Document template id

  • Must be a String

title
optional

New document title

  • Must be a String

roles
required

Roles data

  • Must be an Array of nested elements

roles[role]
required

Role name

  • Must be a String

roles[name]
required

Signer name

  • Must be a String

roles[email]
required

Signer email

  • Must be a String