SmartReach API
Scroll down for code samples, example requests and responses.
Below describes the path on how to use our APIs. We recommend creating an API key, review the Authentication section on how to create one, then once ready, dive in to API calls.
Email support: [email protected]
Authentication
REST API Key
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
-H "X-API-KEY: ImqrZcZhtIBHZt9e0vZsZoaZPs34EyP7"
Make sure to replace
ImqrZcZhtIBHZt9e0vZsZoaZPs34EyP7
with your API key.
To create or manage API key for a specific SmartReach user, go to Settings -> Integrations
.
Campaigns
List campaigns
Code samples
curl "https://api.smartreach.io/api/v1/campaigns" \
-H "X-API-KEY: YOUR_API_KEY"
The above command returns JSON structured like this:
{
"status": "success",
"message": "Campaigns found",
"data": {
"campaigns": [
{
"id": 16,
"account_id": 2,
"name": "Marketing Leads 1",
"status": "running",
"stats": {
"total_sent": 100,
"total_opened": 47,
"total_clicked": 19,
"total_replied": 9
},
"created_at": 1493893976127
}
]
}
}
This retrieves all campaigns.
GET https://api.smartreach.io/api/v1/campaigns
Prospects
Get prospects
Code samples
curl "https://api.smartreach.io/api/v1/prospects?page=1" \
-H "X-API-KEY: YOUR_API_KEY"
The above command returns JSON structured like this:
{
"status": "success",
"message": "Prospects found",
"data": {
"prospects": [
{
"id": 123456,
"account_id": 123,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"created_at": 1535687355064,
"custom_fields": {},
"list": "SmartReach Demo List",
"company": "SmartReach",
"city": "LA",
"country": "United States",
"timezone": "America/Los_Angeles",
"prospect_category": "interested"
}
]
}
}
This endpoint retrieves upto 500 prospects at a time.
GET https://api.smartreach.io/api/v1/prospects?page={page_number}
URL Parameters
Parameter | Description |
---|---|
page_number | page number of the prospects to retrieve (starts with 1) |
Add prospect
Code samples
curl "https://api.smartreach.io/api/v1/prospects" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-X POST -d '{"city": "LA", "company": "Amazon",
"country": "USA", "state": "CA",
"email": "[email protected]","first_name": "John",
"last_name": "Doe","list": "Marketing Leads 1", "timezone": "America/Los_Angeles",
"custom_fields":{}}'
The above command returns JSON structured like this:
{
"status": "success",
"message": "New prospect has been saved!",
"data": {
"prospect": {
"id": 2399816,
"account_id": 282,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"created_at": 1536140515656,
"custom_fields": {},
"list": "Marketing Leads 1",
"company": "Amazon",
"city": "LA",
"country": "USA",
"timezone": "America/Los_Angeles",
"prospect_category": "not_categorized"
}
}
}Î
POST https://api.smartreach.io/api/v1/prospects
Add a prospect in your account.
Post Body Parameters
Parameter | Description |
---|---|
prospect’s email (required) | |
first_name | prospect’s first name |
last_name | prospect’s last name |
city | prospect’s city |
company | prospect’s company |
country | prospect’s country |
state | prospect’s state |
list | name of the list in which prospect will be added |
timezone | prospect’s time zone (We accept Olson timezone IDs: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) |
custom_fields | user created fields to store prospects additional details. Once you have added a custom column / field in your SmartReach prospects page, you can send those in the custom_fields object |
Errors
Example of error response
{
"status": "error",
"message": "Please provide valid api key",
"data": {
"error_type": "unauthorized"
}
}
The SmartReach API uses the following error codes:
Type | Error Code | Description |
---|---|---|
invalid_param | 400 | Your parameters were not valid |
bad_request | 400 | Record was not found |
not_found | 404 | URL was not valid |
rate_limit | 429 | The request has been rate limited |
api_error | 500 | Internal API error |
forbidden | 403 | The requested api is accessible by administrator only |
unauthorized | 401 | Your API key is wrong |