# Poll for New Data

`GET /api/zapier/poll/{resource}`

Polling endpoint used by automation platforms (Zapier, Make.com, n8n) to retrieve new or updated records. Returns records that were created or modified after the specified timestamp.

- **Group:** Automation
- **Since:** v0.0.0
- **Authentication:** `authtoken` header, created under Setup > API > API Management
- **HTML version:** /apiguide/automation/poll-data/

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authtoken` | String | **required** | Authentication token, generated from admin area |
| `Authorization` | String | optional | Bearer token (alternative to authtoken header) |

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resource` | String | **required** | Resource name. Must be one of: customers, invoices, leads, tasks, tickets |
| `since` | Number | optional | Unix timestamp to filter records created/updated after this time. Default: last 24 hours |
| `limit` | Number | optional | Maximum number of records to return. Default: 50 |

## Example request

```bash
curl -X GET "https://yoursite.com/api/zapier/poll/customers" \
  -H "authtoken: YOUR_API_TOKEN"
```

## Success response

### Success-Response:

```json
HTTP/1.1 200 OK
{
  "status": true,
  "data": [
    {
      "id": "1",
      "company": "Example Company",
      "datecreated": "2024-01-15 10:30:00"
    }
  ],
  "meta": {
    "since": 1705312200,
    "count": 1,
    "next_poll": 1705315800
  }
}
```

## Error responses

### Error-Response:

```json
HTTP/1.1 400 Bad Request
{
  "status": false,
  "message": "Resource parameter required"
}
```

---

Perfex CRM REST API by Themesic Interactive. Full reference: /apiguide/
