Zapier Integration
Replyrush API Documentation
This document describes the Replyrush API used to power the Replyrush Zapier integration. It covers OAuth2 authentication, webhook events (triggers), and available actions.
Production Base URL: https://api.replyrush.com
1. Authentication (OAuth2)
Replyrush uses the standard OAuth2 Authorization Code flow to authenticate third-party applications, including Zapier.
1.1 Authorization
Endpoint: GET /oauth/authorize
Query Parameters
ParameterRequiredDescriptionclient_idYesYour registered client ID.redirect_uriYesThe URL to redirect to after authorization. It must exactly match your registered redirect URI.response_typeYesMust be code.stateRecommendedAn opaque value used to maintain state between the request and callback and protect against CSRF attacks.
If the user is not already authenticated, they will be redirected to the login and consent screen. After approving access, the user will be redirected to the specified redirect_uri with the code and state query parameters.
Example redirect URL:
https://app.replyrush.com/callback?code=AUTHORIZATION_CODE&state=xyz
The authorization code expires after 5 minutes and can only be used once.
1.2 Token Exchange
Endpoint: POST /oauth/token
Content-Type: application/json
Request body for exchanging an authorization code:
{
"grant_type": "authorization_code",
"code": "AUTHORIZATION_CODE",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"redirect_uri": "https://your-app.com/callback"
}Request body for refreshing an access token:
{
"grant_type": "refresh_token",
"refresh_token": "REFRESH_TOKEN",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}Successful response:
{
"access_token": "YOUR_ACCESS_TOKEN",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "YOUR_REFRESH_TOKEN"
}Token validity:
access_tokenis valid for 1 hour (3600 seconds).refresh_tokenis valid for 90 days.Use the refresh token to obtain a new access token without requiring the user to log in again.
If a request uses an expired access token, the API returns
401 Unauthorizedwith aninvalid_tokenerror. The client should refresh the token and retry the request when appropriate.
Example error response:
{
"error": "invalid_grant",
"error_description": "Code invalid or expired"
}1.3 Authenticated Requests
All authenticated endpoints require the access token to be sent in the Authorization header as a Bearer token.
Authorization: Bearer ACCESS_TOKEN1.4 Test Connection Endpoint
Endpoint: GET /api/zapier/me
This endpoint verifies that the connection is valid and retrieves basic account information for display purposes.
Headers:
Authorization: Bearer ACCESS_TOKENExample response:
{
"success": true,
"id": "59c2bd51-598e-4977-a4ee-aa34e55aa856",
"name": "[email protected]"
}2. Webhook Subscriptions
Replyrush uses webhooks to deliver trigger events to Zapier. A subscription is created for each event type and user.
2.1 Subscribe to an Event
Endpoint: POST /api/zapier/subscribe
Headers:
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/jsonRequest body:
{
"target_url": "https://hooks.zapier.com/hooks/standard/xxxxx/yyyyy/",
"event": "dm_received"
}Request Parameters
FieldRequiredDescriptiontarget_urlYesThe URL where Replyrush will send HTTP POST requests when the event occurs.eventYesThe event to subscribe to. Supported values are dm_received, comment_received, and flow_completed.
Example response:
{
"success": true,
"id": "665f1a2b3c4d5e6f7a8b9c0d"
}The response contains the subscription ID, which can be used to unsubscribe later.
2.2 Unsubscribe from an Event
Endpoint: POST /api/zapier/unsubscribe
Headers:
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/jsonRequest body:
{
"subscription_id": "665f1a2b3c4d5e6f7a8b9c0d"
}The subscription_id identifies the webhook subscription to remove.
3. Events (Triggers)
When a subscribed event occurs, Replyrush sends an HTTP POST request containing a JSON payload to the configured target_url.
3.1 New DM Received (dm_received)
This event fires when a new direct message is received on a connected Instagram or Facebook account.
Example payload:
{
"id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUl...",
"contact_id": "1987475715244517",
"message_text": "Hi, I have a question about pricing",
"platform": "instagram",
"received_at": "2026-07-21T18:10:00.000Z"
}Payload Fields
FieldTypeDescriptionidStringUnique message ID.contact_idStringThe sender's Instagram or Facebook user ID.message_textStringThe text content of the message.platformStringThe platform where the message was received: instagram or facebook.received_atStringISO 8601 timestamp indicating when the message was received.
3.2 New Comment Received (comment_received)
This event fires when someone comments on a connected account's post.
Example payload:
{
"id": "comment_17843521917213",
"post_id": "18041447204357181",
"contact_id": "1987475715244517",
"contact_name": "Jane Doe",
"comment_text": "Love this product! Where can I buy it?",
"platform": "instagram",
"received_at": "2026-07-21T18:10:00.000Z"
}Payload Fields
FieldTypeDescriptionidStringUnique comment ID.post_idStringID of the post where the comment was made.contact_idStringThe commenter's Instagram or Facebook user ID.contact_nameStringThe commenter's display name, if available.comment_textStringThe text content of the comment.platformStringThe platform where the comment was received: instagram or facebook.received_atStringISO 8601 timestamp indicating when the comment was received.
3.3 Automation Flow Completed (flow_completed)
This event fires when a contact reaches the end of an automated flow, such as a lead-generation or customer onboarding flow.
The payload includes the flow details and the answers collected from the contact during the flow.
Example payload:
{
"id": "07395ffd-befc-4b58-91b2-957a9d08a304",
"flow_id": "c1fcbbac-925b-4eb6-92b3-e0a44e1fd6a3",
"flow_name": "Customer Onboarding Form",
"contact_id": "1372013594704772",
"contact_name": "funqueue_",
"platform": "instagram",
"completed_at": "2026-03-10T07:03:58.772Z",
"fields": [
{
"field_index": 0,
"field_type": "quickMessage",
"field_text": "Welcome! What would you like to do?",
"user_value": "First Button"
},
{
"field_index": 1,
"field_type": "phone",
"field_text": "Please enter your phone number",
"user_value": "636363633"
},
{
"field_index": 2,
"field_type": "email",
"field_text": "Please enter your email address",
"user_value": "[email protected]"
}
]
}Payload Fields
FieldTypeDescriptionidStringUnique ID for the flow session or run.flow_idStringID of the automation flow definition.flow_nameStringName of the automation flow.contact_idStringThe contact's Instagram or Facebook user ID.contact_nameStringThe contact's display name or username.platformStringThe platform where the flow was completed: instagram or facebook.completed_atStringISO 8601 timestamp indicating when the flow was completed.fieldsArrayList of questions and answers collected during the flow. Each item contains field_index, field_type, field_text, and user_value.
Fields array properties
FieldTypeDescriptionfield_indexNumberPosition of the field within the flow.field_typeStringType of the field, such as quickMessage, phone, or email.field_textStringThe question or prompt displayed to the contact.user_valueStringThe answer or value provided by the contact.
4. Actions
4.1 Send a Direct Message
This action sends a direct message to a contact on Instagram or Facebook.
Endpoint: POST /api/zapier/send-dm
Headers:
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/jsonRequest body:
{
"contact_id": "1676126712671267",
"message": "Thanks for reaching out! We'll get back to you shortly."
}Request Parameters
FieldRequiredDescriptioncontact_idYesThe recipient's Instagram or Facebook user ID.messageYesThe text message to send to the contact.
Successful response (200 OK):
{
"id": "1231231231234",
"status": "sent",
"contact_id": "1676126712671267"
}Example error response: Message outside the messaging window
HTTP status: 400 Bad Request
{
"success": false,
"message": "Cannot send message: outside the 24-hour messaging window with this contact."
}Important: Message sending is subject to Meta's Instagram and Messenger policies. In general, Replyrush can send standard automated messages only when the contact has messaged the connected account within the permitted 24-hour messaging window. Other messaging permissions and exceptions depend on Meta's applicable policies and the type of message.
Replyrush cannot bypass Meta's messaging restrictions.
Other possible error responses
HTTP StatusMeaning400Missing required fields or the message is outside the permitted messaging window.401The access token is invalid or expired.500An internal server error occurred.
5. Rate Limits and Important Notes
Access tokens expire after 1 hour (3600 seconds). Use the refresh token to obtain a new access token.
Refresh tokens are valid for 90 days. If a refresh token expires, the user must reconnect their Replyrush account.
All timestamps use ISO 8601 format and UTC timezone, indicated by
Z.Webhook delivery is best-effort. Failed deliveries are retried a limited number of times before the subscription may be flagged as inactive.
Keep your client secret, access tokens, and refresh tokens secure. Never expose them in frontend code or public repositories.
API requests and message delivery remain subject to Replyrush and Meta's applicable policies and restrictions.
Support
For questions about the Replyrush API or the Zapier integration, contact:
Email: [email protected]
Website: https://replyrush.com