Zapier Integration
← View User GuideComplete technical documentation for Zapier Platform App integration. This documentation is intended for Zapier support and developers integrating with Repostra.
API Base URL
https://repostra.app/api/zapier
Authentication
All API endpoints require authentication using an API key. The API key can be provided in one of two ways:
- Query Parameter:
?api_key=YOUR_API_KEY - Request Body:
{"api_key": "YOUR_API_KEY"}(for POST requests)
Note: API keys are 64 characters long and are generated from the Repostra Integrations page. Each brand has a unique API key.
API Endpoints
1. Test Authentication
Endpoint: POST /api/zapier/test
Description: Verifies that the provided API key is valid and returns brand information.
Authentication: Required (API key)
Request Body:
{
"api_key": "your-api-key-here"
}
Success Response (200):
{
"status": "success",
"message": "Authentication successful",
"brand": {
"id": 1,
"name": "Your Brand Name"
}
}
Error Responses:
- 400:
{"error": "Invalid request", "message": "API key is required"} - 401:
{"error": "Invalid API key", "message": "The provided API key is invalid"}
2. Authenticate
Endpoint: POST /api/zapier/authenticate
Description: Used by Zapier to authenticate brands when they connect their account.
Authentication: Required (API key)
Request Body:
{
"api_key": "your-api-key-here"
}
Success Response (200):
{
"authenticated": true,
"brand_id": 1,
"brand_name": "Your Brand Name"
}
3. List Triggers
Endpoint: GET /api/zapier/triggers
Description: Returns all available trigger types that Zapier can subscribe to.
Authentication: Not required
Success Response (200):
{
"triggers": [
{
"key": "blog_post",
"label": "Blog Post Published",
"description": "Triggers when a blog post is published in Repostra"
},
{
"key": "social_text_post",
"label": "Social Text Post Published",
"description": "Triggers when a text-based social media post is published"
},
{
"key": "social_image_post",
"label": "Social Image Post Published",
"description": "Triggers when an image-based social media post is published"
}
]
}
4. List Accounts
Endpoint: GET /api/zapier/accounts
Description: Returns all Zapier-configured social accounts for the authenticated brand. Used by Zapier to populate account selection dropdowns.
Authentication: Required (API key)
Query Parameters:
api_key(required) - Brand API key
Success Response (200):
[
{
"id": "11",
"label": "website - Zapier Integration Account",
"platform": "website"
},
{
"id": "12",
"label": "linkedin - My LinkedIn Account",
"platform": "linkedin"
}
]
Notes:
- Only returns accounts with
posting_method = 'zapier'and active status - Account IDs are returned as strings
- If no accounts are found, returns an empty array
[]
5. List Websites
Endpoint: GET /api/zapier/websites
Description: Returns only website-type Zapier accounts. This is an alias for /accounts filtered to platform = 'website'.
Authentication: Required (API key)
Response Format:
Same as /api/zapier/accounts, but only includes accounts where platform = 'website'.
6. Subscribe to Trigger
Endpoint: POST /api/zapier/subscribe
Description: Creates a REST Hook subscription. Zapier calls this when a user subscribes to a trigger.
Authentication: Required (API key)
Request Body:
{
"api_key": "your-api-key-here",
"account_id": 11,
"trigger_type": "blog_post",
"target_url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/"
}
Request Parameters:
api_key(required, string) - Brand API keyaccount_id(required, integer) - ID of the Zapier account from/accountsendpointtrigger_type(required, string) - One of:blog_post,social_text_post,social_image_posttarget_url(required, url) - Zapier webhook URL where events will be sent
Success Response (200):
{
"id": "subscription_11_blog_post_67890abcdef",
"target_url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
"trigger_type": "blog_post"
}
Error Responses:
- 400: Invalid request (missing required fields, invalid trigger_type, invalid URL format)
- 401: Invalid API key
- 404: Account not found or not configured for Zapier
Notes:
- Subscription ID format:
subscription_{account_id}_{trigger_type}_{unique_id} - Multiple subscriptions can exist for the same account and trigger type
- The account must exist and have
posting_method = 'zapier'
7. Unsubscribe from Trigger
Endpoint: POST /api/zapier/unsubscribe
Description: Removes a REST Hook subscription. Zapier calls this when a user unsubscribes.
Authentication: Required (API key)
Request Body:
{
"api_key": "your-api-key-here",
"id": "subscription_11_blog_post_67890abcdef"
}
Request Parameters:
api_key(required, string) - Brand API keyid(required, string) - Subscription ID returned from/subscribe
Success Response (200):
{
"status": "success"
}
Error Responses:
- 400: Invalid request (missing API key)
- 401: Invalid API key
Notes:
- Returns success even if subscription ID doesn't exist (idempotent operation)
- Only subscriptions belonging to the authenticated brand can be deleted
8. Get Sample Data
Endpoint: GET /api/zapier/samples/{triggerType}
Description: Returns sample data for a trigger type. Used by Zapier's performList to show users what data the trigger will return.
Authentication: Required (API key)
URL Parameters:
triggerType(required) - One of:blog_post,social_text_post,social_image_post
Query Parameters:
api_key(required) - Brand API key
Response Format:
Returns an array with one sample object. If real data exists for the brand, it returns the most recent published item. Otherwise, returns example data.
Blog Post Sample Response:
[
{
"trigger_type": "blog_post",
"title": "Example Blog Post Title",
"content": "<h2>Introduction</h2><p>HTML content...</p>",
"excerpt": "Short description or excerpt",
"featured_image_url": "https://example.com/images/featured.jpg",
"repostra_post_id": 123,
"published_at": "2025-11-28T10:00:00Z",
"scheduled_for": "2025-11-28T10:00:00Z",
"brand_id": 1,
"brand_name": "Your Brand Name",
"author_id": 5,
"author_name": "John Doe"
}
]
Social Text Post Sample Response:
[
{
"trigger_type": "social_text_post",
"platform": "linkedin",
"topic": "Example Social Post Topic",
"content": "This is the post content text",
"repostra_post_id": 456,
"published_at": "2025-11-28T10:00:00Z",
"brand_id": 1,
"brand_name": "Your Brand Name"
}
]
Social Image Post Sample Response:
[
{
"trigger_type": "social_image_post",
"platform": "linkedin",
"topic": "Example Image Post Topic",
"content": "This is the caption for the image",
"image_url": "https://example.com/images/social-image.jpg",
"repostra_post_id": 789,
"published_at": "2025-11-28T10:00:00Z",
"brand_id": 1,
"brand_name": "Your Brand Name"
}
]
Webhook Payloads
When content is published, Repostra sends POST requests to the subscribed Zapier webhook URLs. The payload format depends on the trigger type.
Blog Post Payload
Trigger Type: blog_post
HTTP Method: POST
Content-Type: application/json
Payload Structure:
{
"trigger_type": "blog_post",
"title": "Blog Post Title",
"content": "<h2>Full HTML content</h2><p>...</p>",
"excerpt": "Short description (optional)",
"featured_image_url": "https://example.com/image.jpg (optional)",
"repostra_post_id": 123,
"published_at": "2025-11-28T10:00:00Z",
"scheduled_for": "2025-11-28T10:00:00Z (optional)",
"brand_id": 1,
"brand_name": "Brand Name",
"author_id": 5 (optional),
"author_name": "Author Name" (optional)
}
Field Descriptions:
trigger_type(string, required) - Always"blog_post"title(string, required) - Blog post titlecontent(string, required) - Full HTML content converted from EditorJS formatexcerpt(string, optional) - Post description/summary if availablefeatured_image_url(string, optional) - URL to featured image if availablerepostra_post_id(integer, required) - Unique identifier in Repostrapublished_at(string, required) - ISO 8601 datetime when post was publishedscheduled_for(string, optional) - ISO 8601 datetime if post was scheduledbrand_id(integer, required) - Brand identifierbrand_name(string, required) - Brand nameauthor_id(integer, optional) - Author ID if availableauthor_name(string, optional) - Author name if available
Social Text Post Payload
Trigger Type: social_text_post
HTTP Method: POST
Content-Type: application/json
Payload Structure:
{
"trigger_type": "social_text_post",
"platform": "linkedin",
"topic": "Post Topic/Title",
"content": "Post content text",
"repostra_post_id": 456,
"published_at": "2025-11-28T10:00:00Z",
"brand_id": 1,
"brand_name": "Brand Name"
}
Field Descriptions:
trigger_type(string, required) - Always"social_text_post"platform(string, required) - Social platform (e.g., "linkedin", "twitter", "facebook")topic(string, required) - Post topic/titlecontent(string, required) - Post text/captionrepostra_post_id(integer, required) - Unique identifier in Repostrapublished_at(string, required) - ISO 8601 datetime when post was publishedbrand_id(integer, required) - Brand identifierbrand_name(string, required) - Brand name
Social Image Post Payload
Trigger Type: social_image_post
HTTP Method: POST
Content-Type: application/json
Payload Structure:
{
"trigger_type": "social_image_post",
"platform": "linkedin",
"topic": "Post Topic/Title",
"content": "Image caption text",
"image_url": "https://example.com/images/post-image.jpg",
"repostra_post_id": 789,
"published_at": "2025-11-28T10:00:00Z",
"brand_id": 1,
"brand_name": "Brand Name"
}
Field Descriptions:
trigger_type(string, required) - Always"social_image_post"platform(string, required) - Social platform (e.g., "linkedin", "twitter", "facebook")topic(string, required) - Post topic/titlecontent(string, required) - Image caption textimage_url(string, required) - URL to the image (may be empty string if image not found)repostra_post_id(integer, required) - Unique identifier in Repostrapublished_at(string, required) - ISO 8601 datetime when post was publishedbrand_id(integer, required) - Brand identifierbrand_name(string, required) - Brand name
Webhook Delivery
How Webhooks are Sent:
- When content is published in Repostra, the system checks for active Zapier subscriptions
- For each subscription matching the trigger type and account, a POST request is sent to the
target_url - The payload is sent as JSON in the request body with
Content-Type: application/json - Multiple subscriptions can exist for the same trigger type, and all will receive the webhook
Response Handling:
- Repostra expects a successful HTTP response (2xx status code) from Zapier
- If Zapier returns a URL in the response (e.g.,
{"url": "..."}), it may be stored as the published URL - Partial success is allowed - if at least one subscription succeeds, the operation is considered successful
Error Handling:
- If no subscriptions exist for a trigger type, the operation fails with an error message
- Network errors or non-2xx responses are logged but don't prevent other subscriptions from receiving the webhook
Account Setup Requirements
Before users can subscribe to triggers, they must create a Zapier account in Repostra:
- Go to Integrations > Social Accounts
- Click Add Account
- Select a platform (can be "Website" or any social platform)
- Set Posting Method to Zapier
- Set account as Active
- Save the account
Only accounts with posting_method = 'zapier' will appear in the /accounts endpoint and can be used for subscriptions.
Common Error Scenarios
1. "No Accounts Found"
User needs to create a Zapier account in Repostra first. The account must have posting_method = 'zapier'.
2. "Account not found or not configured for Zapier"
The provided account_id doesn't exist, doesn't belong to the authenticated brand, or doesn't have Zapier as the posting method.
3. "Invalid trigger_type"
The trigger_type must be exactly one of: blog_post, social_text_post, or social_image_post.
4. "No Zapier subscriptions found"
When content is published but no active subscriptions exist for that trigger type and account. This is logged but doesn't prevent content from being published.
Testing Endpoints
You can test all endpoints using curl or any HTTP client. Example commands:
Test Authentication:
curl -X POST "https://repostra.app/api/zapier/test" \
-H "Content-Type: application/json" \
-d '{"api_key": "YOUR_API_KEY"}'
List Accounts:
curl "https://repostra.app/api/zapier/accounts?api_key=YOUR_API_KEY"
Subscribe to Trigger:
curl -X POST "https://repostra.app/api/zapier/subscribe" \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"account_id": 11,
"trigger_type": "blog_post",
"target_url": "https://hooks.zapier.com/hooks/catch/test/123456/"
}'