Skip to main content
Craftmypdf logo
  • Category: documents
  • Auth: API_KEY
  • Composio-managed OAuth available? N/A
  • Tools: 12
  • Triggers: 0
  • Slug: CRAFTMYPDF
  • Version: 20261101_00

Tools

Slug: CRAFTMYPDF_ADD_TEXT_TO_PDFTool to add text annotations to a PDF including page numbers, watermarks, and custom text at specified positions. Supports dynamic variables like {{pageNumber}} and {{totalPages}} for automatic page numbering. Use when you need to add watermarks, headers, footers, or any text overlay to existing PDF documents.

Input Parameters

string
required
The URL of the PDF file to annotate. Must be a publicly accessible URL.
integer
Expiration time in minutes for the generated PDF link. Range: 1-10080 minutes (7 days). Defaults to 5 minutes if not specified.
string
Desired filename for the output PDF. Defaults to ‘output.pdf’ if not specified.
array
required
Array of text annotation settings. Each item defines text to add with its position, styling, and target pages. Multiple settings can be applied to add different text elements to various pages.
integer
Whether to upload the generated PDF to CraftMyPDF’s CDN. Set to 1 (upload to CDN) or 0 (skip upload). If you have configured Post Actions to upload to your own S3, set to 0. Defaults to 1.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_ADD_WATERMARKTool to add a text watermark to a PDF with customizable font, size, color, opacity, and rotation. Use when you need to overlay watermark text (e.g., CONFIDENTIAL, DRAFT) on PDF documents. For more advanced text placement and formatting options, consider using the add-text-to-pdf endpoint instead.

Input Parameters

string
required
URL of the source PDF document to add watermark to. Must be a publicly accessible URL.
string
required
The watermark text to overlay on the PDF. This text will appear on all pages.
number
Opacity/transparency of the watermark, ranging from 0 (fully transparent) to 1 (fully opaque). Default is 0.5.
integer
Rotation angle of the watermark text in degrees. Positive values rotate clockwise. Default is 45 degrees.
integer
Font size of the watermark text in points. Default is 40 if not specified.
string
Hex color code for the watermark text (must start with # followed by 6 hex digits). Default is ‘#c7c7c7’ (light gray).
integer
Expiration time in minutes for the generated PDF link. Must be between 1 minute and 10080 minutes (7 days). Default is 5 minutes.
string ("Courier" | "Courier-Bold" | "Courier-Oblique" | "Courier-BoldOblique" | "Helvetica" | "Helvetica-Bold" | "Helvetica-Oblique" | "Helvetica-BoldOblique" | "Times-Roman" | "Times-Bold" | "Times-Italic" | "Times-BoldItalic" | "Symbol" | "ZapfDingbats")
Available font families for watermark text.
string
Name for the output PDF file. Default is ‘output.pdf’ if not specified.
integer
Whether to upload the generated PDF to CDN storage. Set to 1 (default) to upload to CDN, or 0 if you have configured Post Actions to upload to your own S3 bucket.
string
AWS S3 bucket name to override for Post Action (S3 Storage). Only used if you have Post Actions configured.
string
File name/key for Post Action (S3 Storage). Do not include file extension. Use slash (/) as folder delimiter. Must be unique.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_CREATE_EDITOR_SESSIONTool to create an embeddable editor session URL for a template. Use when you need to embed the PDF editor for a specific template.

Input Parameters

string
URL to navigate to when the user clicks the back button.
boolean
Allow saving changes in the editor.
integer
Mode for JSON: 1 = editor, 2 = viewer.
boolean
Allow previewing document within the editor.
integer
Session lifetime in minutes (e.g., 1440 for 24 hours).
boolean
Allow direct JSON editing of the template.
boolean
Show or hide data tab in the editor.
boolean
Show or hide help/documentation panel.
string
required
The PDF template ID to open in the editor. Get template IDs from the List Templates action.
boolean
Allow generating PDF from the editor.
boolean
Show CraftMyPDF header in the editor UI.
boolean
Show layers panel in the editor.
boolean
Allow viewing editor settings.
boolean
Show or hide expression documentation pane.
boolean
Show property panel for elements in the editor.
boolean
Show or hide property binding options.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_CREATE_PDF_ASYNC2Create a PDF asynchronously from a template and JSON data, returning a transaction reference and optionally sending a GET callback to a supplied webhook URL when the PDF is generated. Supports image optimization, resizing, and custom storage options.

Input Parameters

string
required
JSON data to populate template fields. Accepts either a JSON object or a stringified JSON string. Keys should match the template’s data bindings.
string
Template version to use. If not specified, uses the latest version of the template.
integer
Expiration time of the generated PDF in minutes. Default is 5 minutes, range is between 1 minute and 10080 minutes (7 days).
string
required
Template ID to use for PDF generation. Obtain valid template IDs from the list-templates endpoint.
string
Callback URL to your server for receiving the PDF result. Must start with http:// or https:// and should be URL-encoded. When PDF is generated, a GET request is made to: webhook_url?file=[file_url]&transaction_ref=[transaction_ref]&status=[status]&message=[message]&details=[details]
integer
Upload the generated PDFs/images to storage CDN. Default is 1. Set to 0 if you have configured Post Actions to upload to your own S3.
string
If resize_images is enabled, specify the format of resized images. Either ‘jpeg’ or ‘png’.
boolean
Resize all images in the PDF to help reduce file size, especially if the template contains multiple or large images. Set to true to enable. Only works with JPEG/JPG/PNG images.
integer
If resize_images is enabled, specify the maximum width in pixels for images. Default is 1000.
integer
If resize_images is enabled, specify the maximum height in pixels for images. Default is 1000.
integer
Optimize/downsample images in the PDF to a specified resolution in DPI. Helps reduce PDF file size. Suggested values are 1200, 600, 300, 150, or 72.
string
Override the AWS Bucket for Post Action (S3 Storage) if configured.
string
Specify the file name for Post Action (S3 Storage). Do not include file extension. Ensure the file name is unique. You can use slash (/) as folder delimiter.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_CREATE_PDF_PARALLELTool to create multiple PDF files in parallel from templates with JSON data. Processes multiple PDF generation requests concurrently for improved performance. Optionally merges all generated PDFs into a single file when merge parameter is enabled. Use when you need to generate multiple PDFs at once from different templates or data.

Input Parameters

boolean
Whether to merge all generated PDFs into a single PDF file. Defaults to false if not specified.
array
required
Array of PDF generation requests to process in parallel. Each request contains template_id, data, and optional meta field.
integer
Expiration time in minutes for the merged PDF file. Only applicable when merge is true. Valid range: 1-10080 minutes (7 days). Defaults to 5 minutes.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_GET_ACCOUNT_INFOTool to retrieve account information including subscription and usage details. Use when you need to check quota limits, template usage, or account creation date.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_GET_PDF_INFOTool to retrieve information about a PDF file including metadata, page count, and other properties. Use when you need to analyze PDF file structure or extract metadata without downloading the entire file.

Input Parameters

string
required
URL to a PDF file to retrieve information from

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_LIST_TEMPLATESTool to retrieve a paginated list of PDF templates. Use when you need to browse available templates before generating a PDF.

Input Parameters

integer
Maximum number of templates to return, must be at least 1
integer
Number of templates to skip before returning results, must be non-negative
string
Filter templates by group name

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_LIST_TRANSACTIONSTool to retrieve a paginated list of API transactions. Use when you need to view transaction history with pagination support.

Input Parameters

integer
Maximum number of transactions to return. Default is 300
integer
Number of transactions to skip before returning results. Default is 0

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_MERGE_PDFSTool to merge multiple PDF files from URLs into a single PDF document. Use when you need to combine multiple PDF files into one consolidated document. The API fetches PDFs from the provided URLs and merges them in the order specified.

Input Parameters

array
required
Array of PDF URLs to merge. Each URL should be publicly accessible and point to a valid PDF file.
integer
Expiration time in minutes for the generated PDF link. Default is 5 minutes, range between 1 minute and 10080 minutes (7 days).
string
Output filename for the merged PDF. Default is ‘output.pdf’.
integer
Upload the generated PDF to storage CDN. Default is 1 (enabled). Set to 0 if you have configured Post Actions to upload to your own S3.
string
AWS bucket name to overwrite for Post Action S3 Storage.
string
File name for Post Action S3 Storage. Do not specify the file extension. Make sure the file name is unique. You can use slash (/) as folder delimiter.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_QUERY_TEMPLATE_USAGETool to retrieve usage statistics for specified templates within a date range. Use when you need to track PDF generation counts and credit consumption for specific templates.

Input Parameters

string
End date for the usage query in ISO 8601 format (UTC time). Example: ‘2025-01-30T23:59:59Z’. If not provided, uses default date range.
string
Start date for the usage query in ISO 8601 format (UTC time). Example: ‘2025-01-30T00:00:00Z’. If not provided, uses default date range.
string
required
Comma-separated list of template IDs to query usage statistics for. Example: ‘bba77b234e84443e,02077b2b1aa8b938’

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not
Slug: CRAFTMYPDF_UPDATE_PDF_FIELDSTool to update fillable fields in a PDF document such as text fields, checkboxes, and dropdowns. Use when you need to programmatically fill out PDF forms by updating field values. The PDF must contain fillable form fields with identifiable names that match the field IDs you provide.

Input Parameters

string
required
The publicly accessible URL of the PDF file to update. The PDF must contain fillable form fields with identifiable names.
array
required
Array of field updates to apply to the PDF. Each field object specifies which field to update and its new value. The field IDs must match existing field names in the PDF.
integer
Expiration time in minutes for the generated PDF URL. Valid range: 1 to 10080 minutes (7 days). Defaults to 5 minutes if not specified.
string
The filename for the generated PDF. Defaults to ‘output.pdf’ if not specified.
integer
Whether to upload the generated PDF to the CraftMyPDF CDN. Set to 1 (default) to upload to CDN, or 0 if you have configured Post Actions to upload to your own S3 storage.

Output

string
required
Data from the action execution
string
Error if any occurred during the execution of the action
boolean
required
Whether or not the action execution was successful or not