Call and Text Message Alerts

Call and Text Message Alerts allow users to receive notifications when a call or call is received on a specific tracker. This API is located at four different endpoints, corresponding to Call and Text Message Alerts for Session and Source Trackers.

Contents

Listing Alerts for a Tracker

Returns a paginated list of users who will receive Call or Text Message alerts for a given Tracker.

API Endpoint

Method URL Description
GET /v1/companies/{company_id}/source_trackers/{tracker_id}/call_alerts.json List the users who will receive Call Alerts for the given Source Tracker.
GET /v1/companies/{company_id}/source_trackers/{tracker_id}/sms_alerts.json List the users who will receive Text Message Alerts for the given Source Tracker.
GET /v1/companies/{company_id}/session_trackers/{tracker_id}/call_alerts.json List the users who will receive Call Alerts for the given Session Tracker.
GET /v1/companies/{company_id}/session_trackers/{tracker_id}/sms_alerts.json List the users who will receive Text Message Alerts for the given Session Tracker.

Request Parameters

Name Type Required? Description
per_page number optional How many users to return for this request (default 100, maximum 250).
Example: 25
page number optional Page number that should be returned for this request (the first page is 1). Example: 3

Response Fields

Name Type Description
id number Unique identifier for this user.
Example: 321752
first_name string The user’s first name.
Example: “John”
last_name string The user’s last name.
Example: “Robertson”
email string The email address assocated with this user.
Example: “john.robertson@example.com”
role string The user’s permission within this CallRail account; one of “admin”, “reporting”, “manager” or “notification”. See User Roles.
Example: “reporting”
created_at string The date and time the user was created in UTC (ISO 8601 format).
Example: “2011-07-05T19:06:10Z”

Example

curl -H "Authorization: Token token=abc1234" \
  https://api.callrail.com/v1/companies/2528/source_trackers/13281/sms_alerts.json?per_page=2&page=1
  "page": 1,
  "per_page": 2,
  "total_pages": 2,
  "total_records": 4,
  "users": [
    {
      "id": 14152,
      "first_name": "John",
      "last_name": "Robertson",
      "email": "john@example.com",
      "created_at": "2014-05-28T14:14:47-04:00",
      "role": "admin"
    },
    {
      "id": 22412,
      "first_name": "Carry",
      "last_name": "Robertson",
      "email": "carry@example.com",
      "created_at": "2014-05-28T14:14:48-04:00",
      "role": "reporting"
    }
  ]
}

Get Individual User information for an Alert

Method URL Description
GET /v1/companies/{company_id}/source_trackers/{tracker_id}/call_alerts/{user_id}.json User who will receive Call Alerts for the given Session Tracker.
GET /v1/companies/{company_id}/source_trackers/{tracker_id}/sms_alerts/{user_id}.json Users who will receive Text Message Alerts for the given Source Tracker.
GET /v1/companies/{company_id}/session_trackers/{tracker_id}/call_alerts/{user_id}.json User who will receive Call Alerts for the given Keyword Tracker.
GET /v1/companies/{company_id}/session_trackers/{tracker_id}/sms_alerts/{user_id}.json User who will receive Text Message Alerts for the given Keyword Tracker.

Request Parameters

None

Response Fields

Name Type Description
id number Unique identifier for this user.
Example: 321752
first_name string The user’s first name.
Example: “John”
last_name string The user’s last name.
Example: “Robertson”
email string The email address assocated with this user.
Example: “john.robertson@example.com”
role string The user’s permission within this CallRail account; one of “admin”, “reporting”, “manager” or “notification”. See User Roles.
Example: “reporting”
created_at string The date and time the user was created in UTC (ISO 8601 format).
Example: “2011-07-05T19:06:10Z”

Example

curl -H "Authorization: Token token=abc1234" \
  https://api.callrail.com/v1/companies/2528/source_trackers/13281/sms_alerts/14152.json?per_page=2&page=1
{
  "id": 14152,
  "first_name": "John",
  "last_name": "Robertson",
  "email": "john@example.com",
  "created_at": "2014-05-28T14:14:47-04:00",
  "role": "admin"
}

Remove an Alert

Delete the alert notification for this user. They will no longer receive an email when a call / text message is received on this tracker.

API Endpoint

Method URL Description
DELETE /v1/companies/{company_id}/source_trackers/{tracker_id}/call_alerts/{user_id}.json No longer notify the user of calls on this tracker.
DELETE /v1/companies/{company_id}/source_trackers/{tracker_id}/sms_alerts/{user_id}.json No longer notify the user of texts on this tracker.
DELETE /v1/companies/{company_id}/session_trackers/{tracker_id}/call_alerts/{user_id}.json No longer notify the user of calls on this tracker.
DELETE /v1/companies/{company_id}/session_trackers/{tracker_id}/sms_alerts/{user_id}.json No longer notify the user of texts on this tracker.

Request Parameters

None

Response Body

On success, the response code will indicate 204 No Content and no body will be present. If the request fails, the response code will be 4xx or 5xx and include:

Name Type Description
error string Short description of why the request failed.
Example: “alert not found”

Example

curl -H "Authorization: Token token=abc1234" \
     -X DELETE \
     -v \
     https://api.callrail.com/v1/companies/267130707/source_trackers/254098509/sms_alerts/280894682.json
< HTTP/1.1 204 No Content
< Cache-Control: no-cache
< Connection: close
<
* Closing connection 0

Create an Alert

Add a user to be notified when a call / text message is received on this tracker.

Method URL Description
POST /v1/companies/{company_id}/source_trackers/{tracker_id}/call_alerts.json Set a user to receive Call Alerts for the given Source Tracker.
POST /v1/companies/{company_id}/source_trackers/{tracker_id}/sms_alerts.json Set a user to receive Text Message Alerts for the given Source Tracker.
POST /v1/companies/{company_id}/session_trackers/{tracker_id}/call_alerts.json Set a user to receive Call Alerts for the given Session Tracker.
POST /v1/companies/{company_id}/session_trackers/{tracker_id}/sms_alerts.json Set a user to receive Text Message Alerts for the given Session Tracker.

Request Body

Name Type Required? Description
user number required The numeric user id of the user who should be notified when a call / text message is received.
Example: 1256342

Response Fields

If successful, the response will be 201 CREATED and include the user’s basic information:

Name Type Description
id number Unique identifier for this user.
Example: 321752
first_name string The user’s first name.
Example: “John”
last_name string The user’s last name.
Example: “Robertson”
email string The email address assocated with this user.
Example: “john.robertson@example.com”
role string The user’s permission within this CallRail account; one of “admin”, “reporting”, “manager” or “notification”. See User Roles.
Example: “reporting”
created_at string The date and time the user was created in UTC (ISO 8601 format).
Example: “2011-07-05T19:06:10Z”

If unsuccessful, the response will be 4xx or 5xx and include:

Name Type Description
error string Short description of why the request failed.
Example: “user already assigned”

Example

curl -H "Authorization: Token token=abc1234" \
     -H "Content-Type: application/json"     \
     -d '{"user": 121691}' \
  https://api.callrail.com/v1/companies/527915/source_trackers/24811/call_alerts.json
{
  "id": 125819,
  "first_name": "Ron",
  "last_name": "Johnson",
  "email": "ron@example.com",
  "role": "reporting",
  "created_at": "2014-05-28T14:14:48-04:00"
}