Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to CraftMyPDF

Scalekit connector
Open markdown

The CraftMyPDF connector lets your AI agent act in each user's CraftMyPDF account. Each user connects their own CraftMyPDF API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 23 tools.

Tools
23
What they doRead · write · destructive
7 · 15 · 17 read15 write1 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the CraftMyPDF connection

    In AgentKit > Connections, create a CraftMyPDF connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'craftmypdf'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize CraftMyPDF:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'craftmypdf_account_info_get',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their CraftMyPDF credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • craftmypdf_account_info_getGet your CraftMyPDF account information.Read-only

    Get Account Info

    Get your CraftMyPDF account information. Returns the plan, credits used and remaining, and team details. Use it to check remaining quota.

    Inputs

    This tool takes no inputs.

  • craftmypdf_pdf_info_getGet information about a PDF at a URL.Read-only

    Get PDF Info

    Get information about a PDF at a URL. Returns its page count, page sizes and metadata. The PDF must be publicly reachable.

    Inputs

    urlstringrequired
    URL to a PDF file. Example: https://example.com/sample.pdf.
  • craftmypdf_template_getGet a template's content, optionally at a specific version.Read-only

    Get Template

    Get a template's content, optionally at a specific version. Returns its name, sample JSON data and body definition. Use templates_list to find template IDs.

    Inputs

    template_idstringrequired
    Template id. Example: ad577b2b22d4e612.
    versionstring
    Version of the template. Leave it empty to use the latest version. Example: 0.
  • craftmypdf_template_usage_getGet how many PDFs and images were generated from templates over a date range.Read-only

    Get Template Usage

    Get how many PDFs and images were generated from templates over a date range. Returns usage counts per template ID. Dates are ISO 8601 in UTC.

    Inputs

    template_idsstringrequired
    Comma-separated list of template IDs. Example: bba77b234e84443e,02077b2b1aa8b938.
    end_datestring
    End date in ISO 8601 format (UTC time). Example: 2025-01-30T11:59:59Z.
    start_datestring
    Start date in ISO 8601 format (UTC time). Example: 2025-01-30T00:00:00Z.
  • craftmypdf_template_versions_listList all saved versions of a template.Read-only

    List Template Versions

    List all saved versions of a template. Returns each version's number, timestamp and retained flag. Pass a version to the create tools to use an older one.

    Inputs

    template_idstringrequired
    Template ID. Example: 5ef77b2b187c968c.
  • craftmypdf_templates_listList your templates, optionally by group, with paging.Read-only

    List Templates

    List your templates, optionally by group, with paging. Returns each template's id, name, group and last update time. Use the template ID with the create tools.

    Inputs

    group_namestring
    Filter templates in the same group(group_name). Example: Customer_009.
    limitinteger
    Retrieve only the number of records specified. Default to 300. Example: 300.
    offsetinteger
    Offset is used to skip the number of records from the results. Default to 0. Example: 0.
  • craftmypdf_transactions_listList your generation transactions (each PDF or image created), newest first, with paging.Read-only

    List Transactions

    List your generation transactions (each PDF or image created), newest first, with paging. Returns each transaction's ref, template, pages, file URL and time. Use it to audit usage.

    Inputs

    limitinteger
    Retrieve only the number of records specified. Default to 300. Example: 300.
    offsetinteger
    Offset is used to skip the number of records from the results. Default to 0. Example: 0.
  • craftmypdf_editor_session_createCreate an embeddable editor session for a template, with options for what the user can see and do.Write

    Create Editor Session

    Create an embeddable editor session for a template, with options for what the user can see and do. Returns the editor URL to embed in an iframe and the session token UUID. Use editor_session_deactivate to end it early.

    Inputs

    expirationintegerrequired
    Expiration of the editor session in minutes. e.g. 1440=24 hours. Example: 1440.
    template_idstringrequired
    Template ID. Example: 5ef88b2b237c968c.
    back_urlstring
    The URL for the back button. Example: https://yoururl.com.
    can_create_pdfboolean
    Can Generate PDF. Default to true. Example: true.
    can_edit_jsonboolean
    Can edit JSON. Default to true. Example: true.
    can_previewboolean
    Can preview. Default to true. Example: true.
    can_saveboolean
    Can save the template. Default to true. Example: true.
    can_show_back_urlboolean
    Show Back button. Default to true. Example: true.
    can_show_databoolean
    Show Data tab . Default to true. Example: true.
    can_show_expression_docboolean
    Show Expression Doc tab. Default to true. Example: true.
    can_show_headerboolean
    Show CraftMyPDF header. Default to true. Example: true.
    can_show_helpboolean
    Show Help tab. Default to true. Example: true.
    can_show_layersboolean
    Show layer dialogue. Default to true. Example: true.
    can_show_property_bindingboolean
    Show Property Bind tab for element. Default to true. Example: true.
    can_show_property_panelboolean
    Show property panel. Default to true. Example: true.
    can_view_settingsboolean
    Can view settings. Default to true. Example: true.
    json_modeinteger
    JSON editor - 1, JSON viewer - 2. Default to 1. Example: 1.