Get a sample Automation record

GET/api/automation/sample/{resource}

Returns one representative record for the resource - the most recent one - so an automation platform can show the user a real payload and let them map fields onto later steps. When the resource holds no records yet the endpoint still answers 200 with an empty field map built from the live table definition, so field mapping works on a fresh install; meta.source says which of the two you got ("record" or "schema"). The field list in meta.fields gives each returned column with its SQL type. Credential and sensitive columns are stripped exactly as they are everywhere else in this plugin, so they appear neither in the record nor in the field list.

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
resource String Resource key from /api/automation/resources. Hyphens are accepted in place of underscores, so both invoice-payments and invoice_payments work.
curl -X GET "https://yoursite.com/api/automation/sample/clients" \
  -H "authtoken: YOUR_API_TOKEN"

Success-Response:

HTTP/1.1 200 OK
{
  "status": true,
  "resource": "clients",
  "data": {
    "id": "12",
    "company_name": "Acme Corporation",
    "type": "organization",
    "city": "San Francisco",
    "country": "United States",
    "created_date": "2026-07-14 09:21:45",
    "owner_id": "3",
    "created_by": "1",
    "is_lead": "0",
    "deleted": "0"
  },
  "meta": {
    "source": "record",
    "label": "client",
    "plural": "clients",
    "dedupe_key": "id",
    "cursor_fields": ["created_date"],
    "order_by": "created_date",
    "detects_updates": false,
    "fields": [
      { "name": "id", "type": "int" },
      { "name": "company_name", "type": "varchar" },
      { "name": "created_date", "type": "datetime" }
    ],
    "timezone": "UTC",
    "server_time": "2026-07-21T09:45:12+00:00"
  }
}

Unknown resource:

HTTP/1.1 404 Not Found
{ "status": false, "messages": { "error": "Unknown automation resource. Call /api/automation/resources for the resources that can be polled." } }
MethodGET
Path/api/automation/sample/{resource}
GroupAutomation
Sincev1.0.0
Defined inRestApi/Controllers/AutomationController.php