Authentication
Method: API Key
Header:
x-api-key
: Your unique API key.
Example:
x-api-key: YOUR_API_KEY_HERE
Note:
Ensure that your API key is kept secure and is not exposed publicly. Unauthorized access with invalid API keys will be denied.
API Endpoints
1. Get Contact Fields
Endpoint: /zapier/fields
HTTP Method: GET
Description:
Retrieves all available contact fields, including both custom properties and system-defined fields.
Headers:
x-api-key
(string, required): Your API key for authentication.
Request Parameters:
None
Response:
Status Code:
200 OK
Body:
[{
"label": "Email",
"key": "email",
"type": "string"
},
{
"label": "Phone Number",
"key": "phone",
"type": "string"
},
{
"label": "Tags",
"key": "tags",
"type": "string"
}]
Example Request:
curl -X GET https://api.swipeone.com/zapier/fields \ -H "x-api-key: YOUR_API_KEY_HERE"
Example Response:
[{
"label": "Email",
"key": "email",
"type": "string"
},
{
"label": "Phone Number",
"key": "phone",
"type": "string"
},
{
"label": "Tags",
"key": "tags",
"type": "string"
}]
2. Create Contact
Endpoint: /zapier/contact
HTTP Method: POST
Description:
Creates a new contact with the provided data. Optionally, tags can be added to the contact upon creation.
Headers:
x-api-key
(string, required): Your API key for authentication.Content-Type: application/json
(required): Indicates that the request body is in JSON format.
Request Body:
Type:
application/json
Structure:
{
"email": "[email protected]",
"phone": "+1234567890",
"tags": "new,subscriber"
}Parameters:
email
(string, optional): Email address of the contact.phone
(string, optional): Phone number of the contact.tags
(string, optional): Comma-separated tags to assign to the contact.
Response:
Status Code:
201 Created
Body:
{ "status": "success" }
Example Request:
curl -X POST https://api.swipeone.com/zapier/contact \ -H "x-api-key: YOUR_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "email": "[email protected]", "phone": "+1234567890", "tags": "new,subscriber" }'
Example Response:
{ "status": "success" }
3. Get Events
Endpoint: /zapier/events
HTTP Method: GET
Description:
Retrieves all available event definitions within the workspace.
Headers:
x-api-key
(string, required): Your API key for authentication.
Request Parameters:
None
Response:
Status Code:
200 OK
Body:
[{
"key": "user_signup",
"label": "User Signup"
},
{
"key": "purchase_made",
"label": "Purchase Made"
}
Example Request:
curl -X GET https://api.swipeone.com/zapier/events \ -H "x-api-key: YOUR_API_KEY_HERE"
Example Response:
[{
"key": "user_signup",
"label": "User Signup"
},
{
"key": "purchase_made",
"label": "Purchase Made"
}]
4. Get Event Properties
Endpoint: /zapier/events/{event}
HTTP Method: GET
Description:
Retrieves properties for a specific event identified by its name.
Headers:
x-api-key
(string, required): Your API key for authentication.
Path Parameters:
event
(string, required): The name of the event for which properties are to be retrieved.
Response:
Status Code:
200 OK
Body:
[{
"label": "Contact",
"key": "contact",
"type": "contact"
},
{
"label": "Purchase Amount",
"key": "amount",
"type": "number"
},
{
"label": "Purchase Date",
"key": "purchase_date",
"type": "datetime"
}]
Example Request:
curl -X GET https://api.swipeone.com/zapier/events/purchase_made \ -H "x-api-key: YOUR_API_KEY_HERE"
Example Response:
[{
"label": "Contact",
"key": "contact",
"type": "contact"
},
{
"label": "Purchase Amount",
"key": "amount",
"type": "number"
},
{
"label": "Purchase Date",
"key": "purchase_date",
"type": "datetime"
}]
5. Create Event
Endpoint: /zapier/event
HTTP Method: POST
Description:
Creates a new event for a contact. The event is processed asynchronously through a message queue.
Headers:
x-api-key
(string, required): Your API key for authentication.Content-Type: application/json
(required): Indicates that the request body is in JSON format.
Request Body:
Type:
application/json
Structure:
{
"event": "purchase_made",
"contact": "[email protected]",
"amount": 99.99,
"purchase_date": "2025-01-15T14:30:00Z"
}Parameters:
event
(string, required): The name of the event to create.contact
(string, required): The contact identifier, either an email address or phone number.amount
(number, optional): The amount associated with the purchase.purchase_date
(string, optional): The date and time of the purchase in ISO 8601 format.
Response:
Status Code:
202 Accepted
Body:
{ "status": "success" }
Example Request:
curl -X POST https://api.swipeone.com/zapier/event \ -H "x-api-key: YOUR_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "event": "purchase_made", "contact": "[email protected]", "amount": 99.99, "purchase_date": "2025-01-15T14:30:00Z" }'
Example Response:
{ "status": "success" }