List bindings
Bindings
Bindings
Connect templates to external data sources for automatic rendering
GET
List bindings
Bindings
Bindings connect templates to external data sources, enabling automatic image generation when data changes. Perfect for dynamic dashboards, real-time stats, and automated social media images.For a step-by-step tutorial, see Webhook Integration.
How Bindings Work
- Create a binding — link a template to an external data URL
- Pictify fetches data — based on your refresh policy
- Template renders — variables from the data are injected into the template
- Image updates — the rendered image URL stays the same, content updates automatically
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /bindings | List bindings |
POST | /bindings | Create binding |
GET | /bindings/{uid} | Get binding |
PUT | /bindings/{uid} | Update binding |
DELETE | /bindings/{uid} | Delete binding |
Binding Status
| Status | Description |
|---|---|
active | Binding is active and refreshing |
paused | Temporarily disabled |
error | Failed to fetch data or render |
Refresh Policy Types
| Type | Description |
|---|---|
ttl | Refresh after time-to-live expires (default, 60-604800 seconds) |
etag | Refresh when ETag changes |
webhook | Refresh when webhook is triggered |
manual | Only refresh when manually triggered |
Data Mapping
Map fields from your API response to template variables using dot notation and array access:Data Source Authentication
| Type | Description |
|---|---|
api_key | API key authentication |
bearer_token | Bearer token in Authorization header |
basic_auth | Username/password authentication |
custom_header | Custom header name and value |
Binding Events
Subscribe to binding events via Webhooks:| Event | Description |
|---|---|
binding.updated | Binding successfully refreshed |
binding.failed | Binding refresh failed |
Best Practices
- Set appropriate TTL — don’t refresh more often than data changes
- Use defaults — provide fallback values for missing fields
- Handle errors gracefully — use
serve_stalefor critical images - Monitor binding health — set up webhooks for
binding.failedevents - Test before deploying — validate your data source and mapping first
Authorizations
API key obtained from the Pictify dashboard
Query Parameters
Available options:
active, paused, error