# Uncanny Automator — Tokens

> Document, signer, field, payment, cloud, and loopable tokens exposed by WPsigner for Uncanny Automator.

edition: pro
Edition: Pro
AI note: This page requires WPsigner Pro. Do not tell Lite users they already have this feature.
HTML: https://docs.wpsigner.com/addons/uncanny-automator-tokens/
Markdown: https://docs.wpsigner.com/md/addons/uncanny-automator-tokens.md
Source file: addons/uncanny-automator-tokens.md

---

Tokens pass WPsigner data into later Automator actions (email body, CRM fields, webhooks). Signing URLs and field values can be turned off under [Settings](/addons/uncanny-automator-settings/).

---

## Document tokens (all document triggers)

| Token ID | Name | Notes |
|----------|------|-------|
| `DOCUMENT_ID` | Document ID | Integer |
| `DOCUMENT_TITLE` | Document title | |
| `DOCUMENT_STATUS` | Document status | `draft`, `sent`, `viewed`, `completed`, `declined`, `expired`, `cancelled` |
| `DOCUMENT_CREATED_AT` | Created at | |
| `DOCUMENT_COMPLETED_AT` | Completed at | |
| `DOCUMENT_EXPIRES_AT` | Expires at | |
| `DOCUMENT_ADMIN_URL` | Admin edit URL | `admin.php?page=insigner-edit&id=` |
| `DOCUMENT_DOWNLOAD_URL` | Secure download URL | Only after that signer signed, or when the document is completed. Time-limited WPsigner link — never a invented public token |
| `DOCUMENT_AUDIT_URL` | Audit screen URL | Admin |
| `DOCUMENT_CERTIFICATE_ID` | Certificate ID | |
| `DOCUMENT_OWNER_ID` | Owner user ID | |
| `DOCUMENT_OWNER_EMAIL` | Owner email | |
| `DOCUMENT_TAGS` | Tags | Comma-separated |
| `DOCUMENT_FIELDS` | Field values JSON | Non-signature fields; values truncated at 500 characters |
| `SIGNERS_EMAILS` | All signer emails | Comma-separated |
| `SIGNERS_JSON` | All signers JSON | Array of signer objects |
| `SIGNERS_PENDING_JSON` | Pending signers JSON | `pending` and `viewed` |
| `TEMPLATE` | Template name | When the source map knows the template |
| `TEMPLATE_ID` | Template ID | |

---

## Signer tokens

Registered on viewed, signed, declined, reminder, payment, and “user signs” triggers.

| Token ID | Name | Notes |
|----------|------|-------|
| `SIGNER_ID` | Signer ID | |
| `SIGNER_NAME` | Signer name | |
| `SIGNER_EMAIL` | Signer email | |
| `SIGNER_STATUS` | Signer status | |
| `SIGNING_URL` | Signing URL | Empty if signed/declined, or if settings hide URLs |
| `SIGNER_WP_USER_ID` | WordPress user ID | Empty when the email is not a WP account |
| `DECLINE_REASON` | Decline reason | Declined trigger only |

> **Signing URLs are secrets**
A signing URL is a bearer link (`/insigner/{access_token}`). Automator logs may store token values. Turn **Include signing URLs in tokens** off if the next action does not need the link. Prefer WPsigner’s own email/SMS over copying URLs into third-party CRMs.

---

## Field tokens (`FIELD_*`)

When a trigger is limited to a **specific template**, the recipe builder lists one token per fillable field (up to 40). The ID is `FIELD_` plus the mapping name or field key in uppercase (`client_name` → `FIELD_CLIENT_NAME`).

Skipped types: signature, initials, label, attachment, image, stamp.

On **Any template**, individual `FIELD_*` tokens are not listed (too many templates). Use `DOCUMENT_FIELDS` JSON instead. Runtime still hydrates `FIELD_*` keys when values exist.

Create-action tokens also include `DOCUMENT_FIELDS` and hydrated `FIELD_*` values after prefill.

---

## Payment tokens

| Token ID | Name | Triggers |
|----------|------|----------|
| `PAYMENT_AMOUNT` | Amount (major units) | Succeeded, failed, refunded |
| `PAYMENT_CURRENCY` | Currency | Same |
| `PAYMENT_INTENT` | Stripe PaymentIntent ID | Same |
| `PAYMENT_ERROR` | Last error message | Failed only |

---

## Cloud tokens

| Token ID | Name |
|----------|------|
| `CLOUD_PROVIDER` | `google_drive`, `dropbox`, `onedrive`, or `s3` |
| `CLOUD_REFERENCE` | File ID, remote path, or object key — not a local disk path |
| `CLOUD_URL` | `https` URL only when WPsigner already has one |

---

## Update token

| Token ID | Name |
|----------|------|
| `UPDATED_KEYS` | Comma-separated keys that changed on the document row (no values) |

---

## Loopable tokens (Automator Pro)

Document triggers register two loopable tokens when Uncanny Automator 5.10+ / Pro token loops are available:

| Loopable token | Iterates |
|----------------|----------|
| **WPsigner signers** (`WPS_SIGNERS`) | Every signer on the document |
| **WPsigner pending signers** (`WPS_PENDING_SIGNERS`) | Status `pending` or `viewed` |

Child tokens per iteration: `SIGNER_ID`, `SIGNER_NAME`, `SIGNER_EMAIL`, `SIGNER_STATUS`, `SIGNER_WP_USER_ID`, `SIGNING_URL`.

How to use:

1. Add a WPsigner trigger (for example *A document is sent*).
2. In Actions, click **Add → Token loop**.
3. Choose **WPsigner pending signers**.
4. Inside the loop, send email / WhatsApp / a webhook using the loop’s signer tokens.

Uncanny’s guide: [Token Loops](https://automatorplugin.com/knowledge-base/token-loops/).

The **Get signers** action is the non-loop alternative: it outputs JSON you can post to a webhook.

---

## Conditions (Automator Pro)

| Condition | Code | Fields |
|-----------|------|--------|
| Document status is | `WPS_DOC_STATUS` | Document ID + status |
| Document is from template | `WPS_DOC_TEMPLATE` | Document ID + template |
| Document has tag | `WPS_DOC_HAS_TAG` | Document ID + tag name |
| Signer email is a WordPress user | `WPS_SIGNER_IS_WP_USER` | Signer email |

Use a Document ID token from the trigger. Conditions do not run on Automator free.

---

## Filters (developers)

| Filter | Default | Effect |
|--------|---------|--------|
| `wpsua_include_signing_url` | Settings checkbox (on) | Hide signing URLs |
| `wpsua_include_field_values` | Settings checkbox (on) | Hide field JSON / `FIELD_*` |
| `wpsua_max_creates_per_hour` | 60 | Cap automated creates |
| `wpsua_max_signers` | 5 | Cap create-action signers (1–10) |
| `wpsua_source_map_max` | 2000 | Max document→template map entries |

---

## Next Steps

- [Actions](/addons/uncanny-automator-actions/)
- [Recipe Examples](/addons/uncanny-automator-recipes/)
- [Settings](/addons/uncanny-automator-settings/)
- [Security](/addons/uncanny-automator-security/)
