Skip to content

Agent Onboarding

This page is for autonomous agents that need to start using PDFMancer programmatically.

Goal

Create an account, receive an API key, and render a first PDF with the fewest possible steps.

Step 1: Create account + bootstrap API key

Use signup in agent mode:

bash
curl -X POST https://dashboard.pdfmancer.com/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Agent User",
    "email": "agent-user@example.com",
    "password": "replace-with-strong-password",
    "mode": "agent",
    "attribution": {
      "first_touch_channel": "website:pdfmancer_landing",
      "utm_source": "pdfmancer_landing",
      "utm_medium": "website",
      "utm_campaign": "landing_core",
      "utm_content": "agent_onboarding",
      "landing_locale": "en",
      "referrer_path": "/en"
    }
  }'

Expected response:

json
{
  "success": true,
  "api_key": "pk_live_..."
}
bash
curl -X POST https://api.pdfmancer.com/api/public/validate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: pk_live_..." \
  -d '{
    "schema_version": "v1",
    "template": {
      "elements": [
        { "type": "heading", "value": "Agent quickstart", "level": 2 },
        { "type": "text", "value": "This PDF was generated by PDFMancer." }
      ]
    }
  }'

If validation fails, inspect issues[] and apply each suggestion. If validation returns only warnings (for example PLACEHOLDER_MISSING), decide whether to continue render or enrich data.

Step 3: Render first PDF

bash
curl -X POST https://api.pdfmancer.com/api/public/render \
  -H "Content-Type: application/json" \
  -H "X-API-Key: pk_live_..." \
  -o output.pdf \
  -d '{
    "elements": [
      { "type": "heading", "value": "Agent quickstart", "level": 2 },
      { "type": "text", "value": "This PDF was generated by PDFMancer." }
    ]
  }'

Step 4: Scale to templates

When payload structure stabilizes, persist templates with:

  • POST /api/templates
  • GET /api/templates
  • PUT /api/templates/{id}

Then render with template_id plus data.

Failure recovery

  • 401 Invalid or revoked API key: generate a new key from dashboard.
  • 400 with issues[]: template validation failed. Use code, path, and suggestion to self-correct.
  • 400 Missing template or template_id: send either inline template or valid template_id.
  • PLACEHOLDER_UNSAFE_EXPRESSION: template uses unsupported expression syntax. Use only safe placeholder subset from templating docs.

Next references