List bindings
curl --request GET \
--url https://api.pictify.io/bindings \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pictify.io/bindings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/bindings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/bindings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/bindings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"bindings": [
{
"uid": "<string>",
"name": "<string>",
"templateId": "<string>",
"dataSource": {
"type": "http",
"url": "<string>",
"method": "GET"
},
"mapping": {},
"defaults": {},
"refreshPolicy": {
"type": "ttl",
"ttlSeconds": 123,
"onError": "serve_stale"
},
"status": "active",
"renderUrl": "<string>",
"webhookUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123,
"hasNext": true,
"hasPrev": true
}
}Bindings
Bindings
Connect templates to external data sources for automatic rendering
GET
/
bindings
List bindings
curl --request GET \
--url https://api.pictify.io/bindings \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pictify.io/bindings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/bindings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/bindings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/bindings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"bindings": [
{
"uid": "<string>",
"name": "<string>",
"templateId": "<string>",
"dataSource": {
"type": "http",
"url": "<string>",
"method": "GET"
},
"mapping": {},
"defaults": {},
"refreshPolicy": {
"type": "ttl",
"ttlSeconds": 123,
"onError": "serve_stale"
},
"status": "active",
"renderUrl": "<string>",
"webhookUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123,
"hasNext": true,
"hasPrev": true
}
}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
[Your Data API] → [Binding] → [Template] → [Updated Image]
- 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:{
"mapping": {
"title": "name",
"stars": "stargazers_count",
"userName": "user.name",
"firstItem": "items[0].name"
}
}
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