> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pdf.co/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF Add

> Add text, images, forms, other PDFs, fill forms, links to external sites and external PDF files. You can update or modify PDF and scanned PDF files.



## OpenAPI

````yaml /openapi.json post /v1/pdf/edit/add
openapi: 3.0.1
info:
  title: PDF.co API
  description: ''
  version: '1.0'
servers:
  - url: https://api.pdf.co
security:
  - ApiKeyAuth: []
tags:
  - name: Extraction
  - name: Editing
  - name: PDF Conversion
  - name: Excel Conversion
  - name: PDF Merging & Splitting
  - name: Forms
  - name: Find & Search
  - name: Document, File & System
  - name: Pages
  - name: Barcodes
paths:
  /v1/pdf/edit/add:
    post:
      tags:
        - Editing
      summary: PDF Add
      description: >-
        Add text, images, forms, other PDFs, fill forms, links to external sites
        and external PDF files. You can update or modify PDF and scanned PDF
        files.
      operationId: post_v1_pdf_edit_add
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file:
                  $ref: '#/components/schemas/file'
                url:
                  allOf:
                    - $ref: '#/components/schemas/url'
                  default: >-
                    https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/sample.pdf
                annotations:
                  type: array
                  description: Annotation (textual) signatures to add.
                  items:
                    type: object
                    properties:
                      text:
                        type: string
                        description: Text to be added to the PDF file as an annotation.
                      type:
                        type: string
                        enum:
                          - text
                          - textField
                          - TextFieldMultiline
                          - checkbox
                        default: text
                        description: Type of annotation to be added.
                      id:
                        type: string
                        description: Unique identifier for the annotation.
                      x:
                        $ref: '#/components/schemas/x'
                      'y':
                        $ref: '#/components/schemas/y'
                      width:
                        $ref: '#/components/schemas/width'
                      height:
                        $ref: '#/components/schemas/height'
                      alignment:
                        type: string
                        default: left
                        enum:
                          - left
                          - center
                          - right
                        description: >-
                          Controls alignment of the annotation. The available
                          alignments are: `left`, `center`, `right`.
                      pages:
                        $ref: '#/components/schemas/pages0'
                      color:
                        type: string
                        default: '#000000'
                        description: >-
                          Controls color of the annotation. Color in RRGGBB or
                          AARRGGBB format where AA is the transparency
                          component. For example, 50% transparent green is
                          #8000FF00.
                      link:
                        type: string
                        format: uri
                        description: Controls link to the annotation.
                      size:
                        type: integer
                        default: 12
                        description: Controls size of the annotation.
                      transparent:
                        type: boolean
                        default: true
                        description: >-
                          Controls transparency of the annotation. Set to false
                          to force disable any transparency and draw a white
                          background under the text.
                      fontName:
                        type: string
                        default: Arial
                        description: >-
                          Controls Font name of the annotation. See [Available
                          fonts](/api-reference/pdf-add/#available-fonts) for
                          the list of available fonts.
                      fontBold:
                        type: boolean
                        description: >-
                          Controls boldness of the annotation. Set to true to
                          make the text bold.
                      fontStrikeout:
                        type: boolean
                        description: >-
                          Controls Strikethrough of the annotation. Set to true
                          to add a strikethrough line through the text.
                      fontUnderline:
                        type: boolean
                        description: >-
                          Controls Underline of the annotation. Set to true to
                          add a line under the text.
                    required:
                      - x
                      - 'y'
                  default:
                    - 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:
                  type: array
                  description: Image signatures to add.
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                        description: |-
                          Input can be one of the following:
                           - an HTTP URL to an image or PDF
                           - a file token from a prior upload
                           - a data URI with a base64-encoded image or PDF.
                      x:
                        $ref: '#/components/schemas/x'
                      'y':
                        $ref: '#/components/schemas/y'
                      width:
                        $ref: '#/components/schemas/width'
                      height:
                        $ref: '#/components/schemas/height'
                      pages:
                        $ref: '#/components/schemas/pages0'
                      link:
                        type: string
                        format: uri
                        description: Link to the image.
                      keepAspectRatio:
                        type: boolean
                        default: true
                        description: >-
                          Control whether the image should maintain its aspect
                          ratio. Set to false to use the specified width and
                          height, which will stretch the image to fit the page
                          width.
                    required:
                      - x
                      - 'y'
                  default:
                    - 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:
                  type: array
                  items:
                    type: object
                    properties:
                      fieldName:
                        type: string
                        description: >-
                          Name of the form field. To find form fields. You can
                          use [PDF Edit Add
                          Helper](https://app.pdf.co/pdf-edit-add-helper).
                      text:
                        type: string
                        description: >-
                          Value to set for this field. If you have a checkbox,
                          set X, true, 1, or another text which is different
                          from false to enable the checkbox. For radio buttons
                          and combo boxes, you need to set the index of the item
                          to select. To find form fields please use [PDF Edit
                          Add Helper](https://app.pdf.co/pdf-edit-add-helper).
                      pages:
                        $ref: '#/components/schemas/pages0'
                      size:
                        type: integer
                        description: >-
                          Override the font size of the text inside the given
                          input field. See [Available
                          fonts](/api-reference/pdf-add/#available-fonts).
                      fontName:
                        type: string
                        description: Name of the font to use to fill out the input field.
                      fontBold:
                        type: boolean
                        description: Override font bold style of the text input field.
                      fontItalic:
                        type: boolean
                        description: Override font italic style of the text input field.
                      fontStrikeout:
                        type: boolean
                        description: Override font strikeout style of the text input field.
                      fontUnderline:
                        type: boolean
                        description: Override font underline style of the text input field.
                    required:
                      - fieldName
                      - text
                name:
                  allOf:
                    - $ref: '#/components/schemas/name'
                  default: newDocument
                async:
                  allOf:
                    - $ref: '#/components/schemas/async'
                  default: false
                inline:
                  allOf:
                    - $ref: '#/components/schemas/inline'
                  default: true
                templatedata:
                  $ref: '#/components/schemas/templatedata'
                expiration:
                  $ref: '#/components/schemas/expiration'
                x:
                  type: number
                  readOnly: true
                'y':
                  type: number
                  readOnly: true
                width:
                  type: number
                  readOnly: true
                height:
                  type: number
                  readOnly: true
                pages:
                  type: string
                  readOnly: true
                password:
                  type: string
                  readOnly: true
                type:
                  type: string
                  readOnly: true
                urlimage:
                  type: string
                  description: URL of the signature image file.
                  readOnly: true
                text:
                  type: string
                  readOnly: true
                size:
                  type: string
                  description: Font size.
                  readOnly: true
                color:
                  type: string
                  readOnly: true
                transparent:
                  type: boolean
                  readOnly: true
                fontname:
                  type: string
                  readOnly: true
                timeout:
                  $ref: '#/components/schemas/timeout'
                annotationsString:
                  type: string
                  format: >-
                    {x};{y};{pages};{text};{fontsize};{fontname};{fontcolor};{link};{transparent};{width};{height};{alignment}
                  description: >-
                    This parameter represents one or more text objects to add to
                    a PDF. Each object is made of parameter separated by the `;`
                    symbol.
                imagesString:
                  type: string
                  format: >-
                    {x};{y};{pages};{urltoimageOrPdf};{linkToOpen};{width};{height}
                  description: >-
                    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:
                  type: string
                  format: '{page};{fieldName};{value}'
                  description: >-
                    Set values for fillable PDF field objects. Each object is
                    made of parameter separated by the `;` symbol.
                profiles:
                  $ref: '#/components/schemas/profiles'
                httpusername:
                  $ref: '#/components/schemas/httpusername'
                httppassword:
                  $ref: '#/components/schemas/httppassword'
              additionalProperties: false
              required:
                - url
                - annotationsString
        required: false
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/NotEnoughCredits'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '408':
          $ref: '#/components/responses/Timeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '441':
          $ref: '#/components/responses/InvalidPassword'
        '442':
          $ref: '#/components/responses/DamagedDocument'
        '443':
          $ref: '#/components/responses/PermissionsError'
        '444':
          $ref: '#/components/responses/ProfilesParsingError'
        '445':
          $ref: '#/components/responses/TimeoutError'
        '446':
          $ref: '#/components/responses/MissingFiles'
        '447':
          $ref: '#/components/responses/InvalidTemplate'
        '448':
          $ref: '#/components/responses/InvalidUrlOrHtml'
        '449':
          $ref: '#/components/responses/InvalidIndexRange'
        '450':
          $ref: '#/components/responses/InvalidPageRange'
        '452':
          $ref: '#/components/responses/InvalidUrl'
        '454':
          $ref: '#/components/responses/InvalidParameters'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    file:
      type: string
      format: path to a local file
      description: The path to the local file to be uploaded.
      readOnly: true
    url:
      type: string
      format: uri
      description: >-
        URL to the source file [`url`
        attribute](/api-reference/url-input-and-request-limits).
    x:
      type: number
      minimum: 0
      description: >-
        X coordinate (zero point is in the top left corner). You can use [PDF
        Edit Add Helper](https://app.pdf.co/pdf-edit-add-helper) to measure
        coordinates. The unit is `pt`.
    'y':
      type: number
      minimum: 0
      description: >-
        Y coordinate (zero point is in the top left corner). You can use [PDF
        Edit Add Helper](https://app.pdf.co/pdf-edit-add-helper) to measure
        coordinates. The unit is `pt`.
    width:
      type: number
      minimum: 0
      description: >-
        Width of the text box. You can use [PDF Edit Add
        Helper](https://app.pdf.co/pdf-edit-add-helper) to measure pdf
        coordinates. The unit is `pt`.
    height:
      type: number
      minimum: 0
      description: >-
        Height of the text box. You can use [PDF Edit Add
        Helper](https://app.pdf.co/pdf-edit-add-helper) to measure pdf
        coordinates. The unit is `pt`.
    pages0:
      type: string
      description: >-
        Page indices/ranges (0-based). Items are comma-separated. Each item is
        one of: N (e.g., 0), N-M (e.g., 3-7), N- (open-ended, e.g., 10-), or !N
        (reverse index; !0 is last page, !1 is second-to-last). Whitespace is
        allowed. If not specified, the default configuration processes all
        pages.
      pattern: >-
        ^\s*(?:!?\d+\s*-\s*!?\d+|!?\d+\s*-\s*|!?\d+)\s*(?:,\s*(?:!?\d+\s*-\s*!?\d+|!?\d+\s*-\s*|!?\d+)\s*)*$
      example: 0,2,5-10, !0, !5-!2
    name:
      type: string
      description: File name for generated output.
    async:
      type: boolean
      default: false
      description: >-
        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](/api-reference/job-check). Also see [Webhooks &
        Callbacks](/api-reference/webhooks)
    inline:
      default: false
      type: boolean
      description: >-
        Set to true to return results inside the response. Otherwise, the
        endpoint will return a URL to the output file generated.
    templatedata:
      type: string
      description: >-
        please set to string converted from JSON with data for Mustache template
        or leave empty if no template is used
      readOnly: true
    expiration:
      type: number
      default: 60
      description: >-
        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](/api-reference/file-upload/overview). 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`.
    timeout:
      type: number
      description: Timeout for output links in seconds
      readOnly: true
    profiles:
      type: string
      description: >-
        Profiles are used configure extra options for specific API endpoints and
        may be unique to an API. For more information, see
        [Profiles](/api-reference/profiles) and the documentation of each
        endpoint for profiles specific to it.
    httpusername:
      type: string
      description: HTTP auth user name if required to access source URL.
    httppassword:
      type: string
      description: HTTP auth password if required to access source URL.
  responses:
    Success:
      description: Success.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: success
                description: Status of the API response.
              message:
                type: string
                example: Success
                description: Descriptive message for the response status.
              url:
                type: string
                format: uri
                example: https://pdf-temp-files.s3.us-west-2.amazonaws.com/output.pdf
                description: URL to the output file.
              jobId:
                type: string
                example: 6YSZD3U872ZYYFEDMQCQSGEEO8YSF5WA
                description: Unique identifier for the job.
              credits:
                type: integer
                example: 2
                description: Credits used for this operation.
              remainingCredits:
                type: integer
                example: 1480582
                description: Credits remaining after this operation.
              duration:
                type: integer
                example: 33
                description: Time taken to complete the request, in milliseconds.
    BadRequest:
      description: >-
        Bad request. Typically due to bad input parameters or unreachable input
        URLs (e.g., access restrictions like login or password).
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 400
              message:
                type: string
                example: >-
                  Bad request. Typically due to bad input parameters or
                  unreachable input URLs (e.g., access restrictions like login
                  or password).
    Unauthorized:
      description: >-
        Unauthorized. Authentication is required and has failed or has not yet
        been provided.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 401
              message:
                type: string
                example: >-
                  Unauthorized. Authentication is required and has failed or has
                  not yet been provided.
    NotEnoughCredits:
      description: Not enough credits.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 402
              message:
                type: string
                example: Not enough credits.
    Forbidden:
      description: Access forbidden for input URL.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 403
              message:
                type: string
                example: Access forbidden for input URL.
    NotFound:
      description: The requested resource could not be found.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 404
              message:
                type: string
                example: The requested resource could not be found.
    Timeout:
      description: The server timed out waiting for the request.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 408
              message:
                type: string
                example: The server timed out waiting for the request.
    TooManyRequests:
      description: Too many requests in a given time period.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 429
              message:
                type: string
                example: Too many requests in a given time period.
    InvalidPassword:
      description: Invalid Password. Password protected document.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 441
              message:
                type: string
                example: Invalid Password. Password protected document.
    DamagedDocument:
      description: Input document is damaged or of incorrect type.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 442
              message:
                type: string
                example: Input document is damaged or of incorrect type.
    PermissionsError:
      description: >-
        Permissions. The operation is prohibited by document security settings.
        You can turn off this check by setting the `profiles` param to
        `{CheckPermissions: false}`. Important: only use this if you are the
        owner or have legal permission.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 443
              message:
                type: string
                example: >-
                  Permissions. The operation is prohibited by document security
                  settings.
    ProfilesParsingError:
      description: >-
        Profiles parsing error. Please ensure that the configuration is
        supported. See `/profiles` samples.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 444
              message:
                type: string
                example: >-
                  Profiles parsing error. Please ensure that the configuration
                  is supported.
    TimeoutError:
      description: >-
        Timeout error. For large documents, use asynchronous mode (`async=true`)
        and check status via `/job/check`. For many-page files, use the `pages`
        parameter.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 445
              message:
                type: string
                example: >-
                  Timeout error. For large documents, use asynchronous mode
                  (async=true) and check status via /job/check.
    MissingFiles:
      description: Some files required for conversion are missing.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 446
              message:
                type: string
                example: Some files required for conversion are missing.
    InvalidTemplate:
      description: Invalid template.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 447
              message:
                type: string
                example: Invalid template.
    InvalidUrlOrHtml:
      description: Invalid URL or HTML. Ensure the provided URL is valid and accessible.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 448
              message:
                type: string
                example: >-
                  Invalid URL or HTML. Ensure the provided URL is valid and
                  accessible.
    InvalidIndexRange:
      description: >-
        Invalid index range. Page index is out of range. Use `/pdf/info` to get
        page count. First page is `0`.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 449
              message:
                type: string
                example: Invalid index range. Page index is out of range.
    InvalidPageRange:
      description: Invalid page range specified.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 450
              message:
                type: string
                example: Invalid page range specified.
    InvalidUrl:
      description: Invalid URL.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 452
              message:
                type: string
                example: Invalid URL.
    InvalidParameters:
      description: Invalid parameters.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 454
              message:
                type: string
                example: Invalid parameters.
    InternalServerError:
      description: Something went wrong. Please try again or contact support.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: boolean
                example: true
              status:
                type: integer
                example: 500
              message:
                type: string
                example: Something went wrong. Please try again or contact support.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````