Companies

Your CallRail Account can include multiple Companies. A company is comprised of Source Trackers, Session Trackers, and a set of Users.

Contents

Listing All Companies

Returns a paginated list of the Companies in your Account.

API Endpoint

Method URL
GET /v1/companies.json

Request Parameters

Name Type Required? Description
per_page number optional How many companies 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 company.
Example: 1856123
name string Company name.
Example: “Bob’s Auto Shop”
time_zone string Time Zone configured for this company (List of Timezones).
Example: “Eastern Time (US & Canada)”
time_zone_utc_offset number Offset in seconds from Coordinated Universal Time (UTC) of the Time Zone above.
Example: -14400
created_at string The date and time the company was created in UTC (ISO 8601 format).
Example: “2011-07-05T19:06:10Z”
disabled_at string If the company has been disabled, this will be the date and time at which it was disabled (UTC, ISO 8601 format). If the company is still enabled, this value will be null.
Example: “2012-08-03T19:06:10Z”
script_url string The URL for the CallRail tracking script for this company. More information is available at https://support.callrail.com/hc/en-us/articles/201051406-Installing-Dynamic-Number-Insertion.
Example: “//cdn.callrail.com/companies/291183543/f6b60be971d552061219/12/swap.js”

Example

curl -H "Authorization: Token token=abc1234" \
  https://api.callrail.com/v1/companies.json?per_page=2&page=1
{
  "page": 1,
  "per_page": 2,
  "total_pages": 2,
  "total_records": 4,
  "companies": [
    {
      "id": 254822795,
      "name": "Web Star Marketing",
      "time_zone": "Eastern Time (US & Canada)",
      "time_zone_utc_offset": -14400,
      "disabled_at": "2012-06-23T19:14:03Z",
      "created_at": "2012-06-20T19:14:03Z",
      "script_url": "//cdn.callrail.com/companies/291183543/f6b60be971d552061219/12/swap.js"
    },
    {
      "id": 245874536,
      "name": "Bob's Auto Shop",
      "time_zone": "Eastern Time (US & Canada)",
      "time_zone_utc_offset": -14400,
      "created_at": "2012-06-20T19:18:48Z",
      "disabled_at": null,
      "script_url": "//cdn.callrail.com/companies/291183543/f6b60be971d552061219/12/swap.js"
    }
  ]
}

Retrieving a Single Company

Returns a single object describing the company with the requested id.

API Endpoint

Method URL
GET /v1/companies/{company_id}.json

Request Parameters

None.

Response Fields

Name Type Description
id number Unique identifier for this company.
Example: 1856123
name string Company name.
Example: “Bob’s Auto Shop”
time_zone string Time Zone configured for this company (List of Timezones).
Example: “Eastern Time (US & Canada)”
time_zone_utc_offset number Offset in seconds from Coordinated Universal Time (UTC) of the Time Zone above.
Example: -14400
created_at string The date and time the company was created in UTC (ISO 8601 format).
Example: “2011-07-05T19:06:10Z”
disabled_at string If the company has been disabled, this will be the date and time at which it was disabled (UTC, ISO 8601 format). If the company is still enabled, this value will be null.
Example: “2012-08-03T19:06:10Z”
script_url string The URL for the CallRail tracking script for this company. More information is available at https://support.callrail.com/hc/en-us/articles/201051406-Installing-Dynamic-Number-Insertion.
Example: “//cdn.callrail.com/companies/291183543/f6b60be971d552061219/12/swap.js”

Example

curl -H "Authorization: Token token=abc1234" \
  https://api.callrail.com/v1/companies/245874536.json
{
  "id": 245874536,
  "name": "Bob's Auto Shop",
  "time_zone": "Eastern Time (US & Canada)",
  "time_zone_utc_offset": -14400,
  "created_at": "2012-06-20T19:18:48Z",
  "disabled_at": null,
  "script_url": "//cdn.callrail.com/companies/291183543/f6b60be971d552061219/12/swap.js"
}

Creating a New Company

Creates a new Company under your Account.

API Endpoint

Method URL
POST /v1/companies.json

Request Body

Name Type Required? Description
name string required Company name.
Example: “Bob’s Auto Shop”
time_zone string optional Time Zone configured for this company (Default: US Eastern Time). See List of Timezones.
Example: “Eastern Time (US & Canada)”

Response Fields

When successful, the HTTP response code will indicate 201 CREATED. The newly-created Company object will be returned in the same format as described above:

Name Type Description
id number Unique identifier for this company.
Example: 1856123
name string Company name.
Example: “Bob’s Auto Shop”
time_zone string Time Zone configured for this company (List of Timezones).
Example: “Eastern Time (US & Canada)”
time_zone_utc_offset number Offset in seconds from Coordinated Universal Time (UTC) of the Time Zone above.
Example: -14400
created_at string The date and time the company was created in UTC (ISO 8601 format).
Example: “2011-07-05T19:06:10Z”
disabled_at string If the company has been disabled, this will be the date and time at which it was disabled (UTC, ISO 8601 format). If the company is still enabled, this value will be null.
Example: “2012-08-03T19:06:10Z”
script_url string The URL for the CallRail tracking script for this company. More information is available at https://support.callrail.com/hc/en-us/articles/201051406-Installing-Dynamic-Number-Insertion.
Example: “//cdn.callrail.com/companies/291183543/f6b60be971d552061219/12/swap.js”

If an error occurs, no company will be created and the response code will be 4xx or 5xx. The response will contain only:

Name Type Description
error string Short description of why the request failed.
Example: “missing required parameter ‘name’“

Example

curl -H "Authorization: Token token=abc1234" \
     -H "Content-Type: application/json"     \
     -d '{"name": "WebMarketing Inc", "time_zone": "Pacific Time (US & Canada)"}' \
  https://api.callrail.com/v1/companies.json
{
  "id": 254822795,
  "name": "WebMarketing Inc",
  "time_zone": "Pacific Time (US & Canada)",
  "time_zone_utc_offset": -25200,
  "disabled_at": null,
  "created_at": "2014-06-20T19:14:03Z",
  "script_url": "//cdn.callrail.com/companies/291183543/f6b60be971d552061219/12/swap.js"
}