### Swap.js Getting Started Source: https://apidocs.callrail.com/ Instructions for getting started with Swap.js for dynamic number insertion. ```APIDOC ## Swap.js - Getting Started ### Description Swap.js is a JavaScript library that enables dynamic number insertion on your website. Follow these steps to integrate it. ``` -------------------------------- ### Example GET Request URL Source: https://apidocs.callrail.com/ Use this URL to retrieve a list of companies. Replace `{account_id}` with your actual account ID. ```HTTP https://api.callrail.com/v3/a/{account_id}/companies.json ``` -------------------------------- ### Example Response for Creating an Integration Source: https://apidocs.callrail.com/ This is an example of the JSON response when successfully creating a new integration. The 'signing_key' is included for Webhook types. ```json { "id": 4, "type": "Webhooks", "state": "active", "config": { "pre_call_webhook": ["http://example.com/webhook.php"] }, "signing_key": "5f3d3ebe065cd800b8c154347437e958" } ``` -------------------------------- ### Update User Response Example Source: https://apidocs.callrail.com/ This is an example of the JSON response received after successfully updating a user. ```json { "email": "gene@example.com", "id": "USR8154748ae6bd4e278a7cddd38a662f4f", "created_at": "2017-01-13T13:01:17.320-05:00", "role": "reporting", "first_name": "Gene", "last_name": "Belcher", "name": "Gene Belcher", "companies": [ { "id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "Widget Shop 2" }, { "id": "COM8154748ae6bd4e278a7cddd38a662e4e", "name": "Widget Shop" } ] } ``` -------------------------------- ### Example Notification Response Source: https://apidocs.callrail.com/ This is an example of the JSON response when listing all notifications. It includes details about each notification configuration. ```json { "page": 1, "per_page": 100, "total_pages": 1, "total_records": 2, "notifications": [ { "id": 100, "user_id": "USR8154748ae6bd4e278a7cddd38a662f4f", "alert_type": "all", "call_enabled": true, "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "All Calls and All Texts for Katherine's Ice Cream", "send_desktop": false, "send_email": true, "send_push": false, "sms_enabled": true, "tracker_id": null }, { "id": 101, "user_id": "USR8154748ae6bd4e278a7cddd38a662f4f", "alert_type": "all", "call_enabled": true, "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "All Calls and All Texts for Google Organic", "send_desktop": false, "send_email": true, "send_push": true, "sms_enabled": true, "tracker_id": "TRK8154748ae6bd4e278a7cddd38a662f4f" } ] } ``` -------------------------------- ### Example Response for Retrieving an Integration Source: https://apidocs.callrail.com/ This is an example of the JSON response structure you can expect when successfully retrieving a single integration. The 'config' object's content varies by integration type. ```json { "id": 4, "config": { "pre_call_webhook": ["http://example.com/webhook.php"] }, "state": "active", "type": "Webhooks" } ``` -------------------------------- ### Example Query for Searching Users Source: https://apidocs.callrail.com/ This example demonstrates how to query the Users Index Endpoint to find records matching a specific search term like 'belcher'. The `search` parameter is optional and filters results. ```http GET /v3/a/{account_id}/users.json?search=belcher ``` -------------------------------- ### Example Response for Listing Integrations Source: https://apidocs.callrail.com/ This is an example of the JSON response structure you can expect when listing all integrations. It includes pagination details and a list of integration objects, each with an ID, configuration, state, and type. ```json { "page": 1, "per_page": 100, "total_pages": 1, "total_records": 3, "integrations": [ { "id": 5, "config": { "api_key": "12345" }, "state": "disabled", "type": "GoogleAnalytics" }, { "id": 10, "config": { "api_key": "12345" }, "state": "active", "type": "Slack" }, { "id": 4, "config": { "pre_call_webhook": ["http://example.com/webhook.php"] }, "state": "active", "type": "Webhooks" } ] } ``` -------------------------------- ### Example Lead List Response Source: https://apidocs.callrail.com/ This is an example of the JSON response structure you will receive when successfully listing leads. It includes pagination details and a list of lead objects, each with various fields. ```json { "page": 1, "per_page": 100, "total_pages": 1, "total_records": 2, "leads": [ { "id": "PER8154748ae6bd4e278a7cddd38a662f4f", "name": "Jane Smith", "phone": "+14045551234", "email": "jane@example.com", "created_at": "2024-01-15T10:30:00.000Z", "company_id": "COM1234567890abcdef", "company_name": "Acme Corp" }, { "id": "PER9265859bf7ce5f389b8deee49b773g5g", "name": "John Doe", "phone": "+14045555678", "email": "john@example.com", "created_at": "2024-01-14T08:15:00.000Z", "company_id": "COM1234567890abcdef", "company_name": "Acme Corp" } ] } ``` -------------------------------- ### Example JSON Response with Selected Fields Source: https://apidocs.callrail.com/ This is an example of a JSON response that includes only user-selected fields. Field selection allows for tailored data retrieval. ```json { "answered": false, "business_phone_number": null, "customer_city": "Seattle", "customer_country": "US", "customer_name": "Jovani Osinski", "customer_phone_number": "+15896836609", "customer_state": "WA", "direction": "inbound", "duration": null, "id": 444941612, "recording": "http://cdn.callrail.com/v3/a/297251749/calls/444941612/recording", "recording_duration": null, "start_time": "2017-06-04T13:36:24.000Z", "tracking_phone_number": "+14045555466", "voicemail": true, "company_id": "COM37221d54e80c4216898d2f857fc69fa0", "company_name": "Grand Symphony Resort" } ``` -------------------------------- ### Example Lead Timeline Response Source: https://apidocs.callrail.com/ This is an example of the JSON response structure returned when successfully retrieving a lead's timeline. It includes pagination details, lead summary information, and a detailed timeline of events. ```json { "page": 1, "per_page": 100, "total_pages": 2, "total_records": 120, "lead": { "customer_name": "John Doe", "customer_phone_number": "+15551234567", "total_interactions": 8, "first_touch": { "touchpoint_type": "organic_search", "source": "google", "medium": "organic", "created_at": "2024-01-15T10:30:00Z" }, "last_touch": { "touchpoint_type": "direct", "created_at": "2024-02-01T14:20:00Z" }, "lead_creation": { "touchpoint_type": "organic_search", "source": "google", "lead_creation_time": "2024-01-15T10:35:00Z" }, "lead_qualification": { "touchpoint_type": "paid_search", "source": "google", "created_at": "2024-01-20T09:15:00Z" }, "tags": [ { "id": "TAG123", "name": "Hot Lead", "color": "red" } ], "convert_assist": { "id": "CAI123", "created_at": "2024-02-01T14:20:00Z", "last_interaction_id": "CALL456", "last_interaction_type": "call", "interaction_count": 3, "status": "answered", "answers": [ { "answer_key": "intent", "answer_text": "Looking to purchase" } ] }, "voice_assist": true, "transcript": true, "source": "google", "medium": "organic", "campaign": null, "landing_page_url": "https://example.com/", "referrer_url": null, "click_id": null }, "timeline": [ { "type": "call", "id": "CALL123", "event_date": "2024-02-01T14:20:00Z", "customer_name": "John Doe", "customer_phone_number": "+15551234567", "direction": "inbound", "duration": 300, "answered": true }, { "type": "form_submission", "id": "FORM456", "event_date": "2024-01-20T09:15:00Z", "form_name": "Contact Us", "form_url": "https://example.com/contact", "form_fields": { "name": "John Doe", "email": "john@example.com", "message": "I'm interested in your services" }, "form_submission_url": "https://example.com/thank-you" }, { "type": "sms", "id": "SMS789", "event_date": "2024-01-18T11:30:00Z", "message_content": "Hello, I have a question about pricing", "message_phone_number": "+15551234567", "message_type": "sms", "thread_id": "SMS789" }, { "type": "chat", "id": "CHAT321", "event_date": "2024-01-16T16:45:00Z", "chat_subject": "Product inquiry", "chat_id": "CHAT321", "conversation_participant_phone_number": "+15551234567" }, { "type": "milestone", "id": "TOUCH654", "event_date": "2024-01-15T10:30:00Z", "milestone_type": "lead_created", "touchpoint_type": "organic_search" } ] } ``` -------------------------------- ### Example JSON Response with Companies Source: https://apidocs.callrail.com/ This is an example of a JSON response that might be returned when listing companies. It includes fields like id, name, status, created_at, and disabled_at. ```json { "page": 1, "per_page": 100, "total_pages": 1, "total_records": 1, "companies": [ { "id": 196207137, "name": "Bob's Burgers", "status": "disabled", "created_at": "2016-02-23T20:16:38.389Z", "disabled_at": "2016-04-13T15:35:29.040Z" }, { "id": 635837866, "name": "Falafel on a Waffle", "status": "disabled", "created_at": "2017-02-13T15:10:42.742Z", "disabled_at": "2017-02-13T15:39:23.149Z" }, { "id": 289003184, "name": "Jimmy Pesto's Pizzeria", "status": "disabled", "created_at": "2015-11-24T17:51:34.908Z", "disabled_at": "2015-11-24T17:51:55.133Z" } ] } ``` -------------------------------- ### Session Tracker Response Example Source: https://apidocs.callrail.com/ This is an example of the JSON response received after successfully creating a session tracker. It includes the tracker's ID, name, status, associated tracking numbers, and call flow configuration. ```json { "id": "TRK8154748ae6bd4e278a7cddd38a662f4f", "name": "Website Call Tracker", "type": "session", "status": "active", "destination_number": "+15553104554", "tracking_numbers": ["+14045551111","+14045552222", "+14045553333", "+14045554444"], "whisper_message": "Call from [source]", "sms_supported": true, "sms_enabled": true, "company": { "id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "Bob's Auto Shop" }, "call_flow": { "type": "basic", "recording_enabled": true, "destination_number": "+15553104554", "greeting_text": "This call will be recorded for quality assurance" }, "source": { "google": ["paid", "organic"], "bing": ["paid", "organic"], "yahoo": ["paid", "organic"] }, "created_at": "2011-07-05T19:06:10Z", "disabled_at": null } ``` -------------------------------- ### Tag Creation Response Source: https://apidocs.callrail.com/ This is an example of the JSON response received after successfully creating a tag. It includes details of the newly created tag. ```json { "id": "1234569", "name": "Existing Customer", "tag_level": "company", "color": "gray1", "background_color": "gray1", "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "status": "enabled", "created_at": "2014-06-06T12:11:02.964-04:00" } ``` -------------------------------- ### Example Page View Response Source: https://apidocs.callrail.com/ This is an example of the JSON response structure when successfully retrieving page views for a call. It includes pagination details and a list of individual page view objects. ```json { "page": 1, "per_page": 100, "total_pages": 1, "total_records": 5, "page_views": [ { "referrer_url": "https://www.grandsymphonyresort.com/available-suites/", "page_url": "https://www.grandsymphonyresort.com/book-now/", "created_at": "2017-03-09T10:17:29-08:00" }, { "referrer_url": "https://www.grandsymphonyresort.com/things-to-do", "page_url": "https://www.grandsymphonyresort.com/available-suites/", "created_at": "2017-03-09T10:17:21-08:00" }, { "referrer_url": "https://www.grandsymphonyresort.com/attractions/", "page_url": "https://www.grandsymphonyresort.com/things-to-do", "created_at": "2017-03-09T10:17:19-08:00" }, { "referrer_url": "https://www.grandsymphonyresort.com/?utm_source=google&utm_medium=cpc&utm_campaign=Non-Brand&matchtype=b&device=c&position=1t1&keyword=%2Bvacation%20%2Bresort%20%2Brelax&gclid=DjwKCBjwcdbLBRALEiwFn8pA5QgnviLjpiYy9fY3hcwHxrpIhUj7WbkYGFDhVy-LL2WA9HsQ_KcA_RoCpPgQAvD_BwE", "page_url": "https://www.grandsymphonyresort.com/attractions/", "created_at": "2017-03-09T10:17:09-08:00" }, { "referrer_url": "https://www.google.com/", "page_url": "https://www.grandsymphonyresort.com/?utm_source=google&utm_medium=cpc&utm_campaign=Non-Brand&matchtype=b&device=c&position=1t1&keyword=%2Bvacation%20%2Bresort%20%2Brelax&gclid=DjwKCBjwcdbLBRALEiwFn8pA5QgnviLjpiYy9fY3hcwHxrpIhUj7WbkYGFDhVy-LL2WA9HsQ_KcA_RoCpPgQAvD_BwE", "created_at": "2017-03-09T10:17:00-08:00" } ] } ``` -------------------------------- ### Create Company Response Source: https://apidocs.callrail.com/ This is an example of a successful JSON response when creating a company. It includes details of the newly created company. ```json { "id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "Widget Shop", "status": "active", "time_zone": "America/New_York", "created_at": "2017-01-26T22:58:04.184Z", "disabled_at": null, "dni_active": null, "script_url": "//cdn.callrail.com/companies/279054151/a74c824140d67442debd/12/swap.js", "callscribe_enabled": false, "lead_scoring_enabled": false, "swap_exclude_jquery": null, "swap_ppc_override": null, "swap_landing_override": null, "swap_cookie_duration": 6, "swap_cookie_duration_unit": "months", "callscore_enabled": false, "keyword_spotting_enabled": false } ``` -------------------------------- ### Get Hourly Call Summary Data Source: https://apidocs.callrail.com/ Retrieve hourly call summary data for a specified date range and time zone. This example demonstrates setting the interval to 'hour' and specifying a time zone. ```curl curl -H "Authorization: Token token=abc1234" \ https://api.callrail.com/v3/a/{account_id}/calls/timeseries.json?start_date=2016-10-01&end_date=2016-10-04&interval=hour&time_zone=EST ``` ```json { "start_date": "2016-10-01T00:00:00-0500", "end_date": "2016-10-02T23:59:59-0500", "time_zone": "EST", "total_results": { "total_calls": 130 }, "data": [ { "date": "2016-10-01T00:00:00-0500", "total_calls": 0 }, { "date": "2016-10-01T01:00:00-0500", "total_calls": 0 }, { "date": "2016-10-01T02:00:00-0500", "total_calls": 0 }, { "date": "2016-10-01T03:00:00-0500", "total_calls": 0 }, { "date": "2016-10-01T04:00:00-0500", "total_calls": 0 }, { "date": "2016-10-01T05:00:00-0500", "total_calls": 0 }, { "date": "2016-10-01T06:00:00-0500", "total_calls": 5 }, { "date": "2016-10-01T07:00:00-0500", "total_calls": 20 } ] } ``` -------------------------------- ### List All Integrations Source: https://apidocs.callrail.com/ Use this command to retrieve a paginated list of all integrations associated with a specific company. Ensure you replace `{api_token}` and `{account_id}` with your actual credentials. ```bash curl -H "Authorization: Token token={api_token}" \ -X GET \ "https://api.callrail.com/v3/a/{account_id}/integrations.json?company_id=213472384" ``` -------------------------------- ### Example Call Recording Response Source: https://apidocs.callrail.com/ This is an example of the JSON response when requesting a call recording. It contains a URL to access the recording. ```json { "url": "http://app.callrail.com/calls/CAL11df32690b7d46123456789123456789/recording/redirect?access_key=241sa242sadqwerty123" } ``` -------------------------------- ### Webhooks Introduction Source: https://apidocs.callrail.com/ Introduction to using webhooks for real-time event notifications. ```APIDOC ## Webhooks ### Description Webhooks allow you to receive real-time notifications about events happening in your CallRail account. You can configure webhooks to send data to a specified URL when certain events occur. ``` -------------------------------- ### Example JSON Request Payload Source: https://apidocs.callrail.com/ This is an example JSON payload for testing signature computation. Use a test signing key to verify your implementation. ```json {"answered":false,"business_phone_number":"","call_type":"voicemail","company_id":155920786,"company_name":"Boost Marketing","company_time_zone":"America/Los_Angeles","created_at":"2018-02-19T13:41:00.252-05:00","customer_city":"Rochester","customer_country":"US","customer_name":"Kaylah Mills","customer_phone_number":"+12148654559","customer_state":"PA","device_type":"","direction":"inbound","duration":"13","first_call":false,"formatted_call_type":"Voicemail","formatted_customer_location":"Rochester, PA","formatted_business_phone_number":"","formatted_customer_name":"Kaylah Mills","prior_calls":16,"formatted_customer_name_or_phone_number":"Kaylah Mills","formatted_customer_phone_number":"214-865-4559","formatted_duration":"13s","formatted_tracking_phone_number":"404-555-8514","formatted_tracking_source":"Google Paid","formatted_value":"--","good_lead_call_id":715587840,"good_lead_call_time":"2016-06-17T10:23:33.363-04:00","id":766970532,"lead_status":"previously_marked_good_lead","note":"","recording":"https://app.callrail.com/calls/766970532/recording/redirect?access_key=aaaaccccddddeeee","recording_duration":8,"source_name":"Google AdWords","start_time":"2018-02-19T13:41:00.236-05:00","tags":[],"total_calls":17,"tracking_phone_number":"+14045558514","transcription":"","value":"","voicemail":true,"tracker_id":354024023,"keywords":"","medium":"","referring_url":"","landing_page_url":"","last_requested_url":"","referrer_domain":"","conversational_transcript":"","utm_source":"google","utm_medium":"cpc","utm_term":"","utm_content":"","utm_campaign":"Google AdWords","utma":"","utmb":"","utmc":"","utmv":"","utmz":"","ga":"","gclid":"","integration_data":[{"integration":"Webhooks","data":null}],"keywords_spotted":"","recording_player":"https://app.callrail.com/calls/766970532/recording?access_key=aaaabbbbccccdddd","speaker_percent":"","call_highlights":[],"callercity":"Rochester","callercountry":"US","callername":"Kaylah Mills","callernum":"+12148654559","callerstate":"PA","callsource":"google_paid","campaign":"","custom":"","datetime":"2018-02-19 18:41:00","destinationnum":"","ip":"","kissmetrics_id":"","landingpage":"","referrer":"","referrermedium":"","score":1,"tag":"","trackingnum":"+14045558514","timestamp":"2018-02-19T13:41:00.236-05:00"} ``` -------------------------------- ### Example Sorted JSON Response Source: https://apidocs.callrail.com/ This is an example of a JSON response that includes sorted user data. It shows the structure of paginated and sorted results. ```json { "page": 1, "per_page": 100, "total_pages": 1, "total_records": 3, "users": [ { "email": "bob@example.com", "id": 223166018, "created_at": "2016-01-29T12:43:10.286-05:00", "role": "admin", "first_name": "Bob", "last_name": "Belcher", "name": "Bob Belcher" }, { "email": "linda@example.com", "id": 159539165, "created_at": "2016-04-08T10:55:38.632-04:00", "role": "manager", "first_name": "Linda", "last_name": "Belcher", "name": "Linda Belcher" }, { "email": "teddy@example.com", "id": 330833311, "created_at": "2015-03-03T12:15:22.954-05:00", "role": "reporting", "first_name": "Teddy", "last_name": "Francisco", "name": "Teddy Francisco" } ] } ``` -------------------------------- ### Listing All Integrations Source: https://apidocs.callrail.com/ Retrieves a list of all configured integrations. ```APIDOC ## GET /integrations ### Description Retrieves a list of all integrations. ### Method GET ### Endpoint /integrations ``` -------------------------------- ### List All Trackers Source: https://apidocs.callrail.com/ Use this command to retrieve a list of all trackers for a given account. Replace `{api_token}` and `{account_id}` with your actual credentials. ```bash curl -H "Authorization: Token token={api_token}" \ -X GET \ "https://api.callrail.com/v3/a/{account_id}/trackers.json" ``` -------------------------------- ### Example Tracker Response Source: https://apidocs.callrail.com/ This is an example of the JSON response structure when listing trackers. It includes details like tracker ID, name, type, status, and associated company information. ```json { "page": 1, "per_page": 250, "total_pages": 1, "total_records": 3, "trackers": [ { "id": "TRK8154748ae6bd4e278a7cddd38a662f4f", "name": "My Billboard", "type": "source", "status": "active", "destination_number": "+15553104554", "tracking_numbers": ["+14045559999"], "whisper_message": null, "sms_enabled": false, "sms_supported": true, "company": { "id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "Bob's Auto Shop" }, "call_flow": { "type": "basic", "recording_enabled": true, "destination_number": "+15553104554", "greeting_text": "This call will be recorded for quality assurance" }, "source": { "type": "search", "search_engine": "google", "search_type": "organic" }, "created_at": "2011-07-05T19:06:10Z", "disabled_at": null }, { "id": "TRK8154748ae6bd4e278a7cddd38a662f4f", "name": "Widget Shop", "type": "session", "status": "active", "destination_number": "+15553104554", "tracking_numbers": ["+14045551111","+14045552222", "+14045553333", "+14045554444"], "whisper_message": "Call from [source].", "sms_enabled": true, "sms_supported": true, "company": { "id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "Bob's Auto Shop" }, "call_flow": { "type": "basic", "recording_enabled": true, "destination_number": "+15553104554", "greeting_text": "This call will be recorded for quality assurance" }, "source": { "google": ["paid", "organic"], "bing": ["paid", "organic"], "yahoo": ["paid", "organic"] }, "created_at": "2011-07-05T19:06:10Z", "disabled_at": null } ] } ``` -------------------------------- ### Creating a Source Tracker Source: https://apidocs.callrail.com/ Creates a new source tracker. ```APIDOC ## POST /trackers/source ### Description Creates a source tracker. ### Method POST ### Endpoint /trackers/source ### Request Body - **name** (string) - Required - The name of the source tracker. - **source_id** (string) - Required - The ID of the source. ``` -------------------------------- ### SMS Threads Response Example Source: https://apidocs.callrail.com/ This is an example of the JSON response structure when listing SMS threads. It includes pagination details and a list of SMS thread objects, each containing thread-specific information. ```json { "page": 1, "per_page": 100, "total_pages": 4, "total_records": 312, "sms_threads": [ { "id": "KZaGR", "notes": null, "tags": ["Urgent"], "value": 5.0, "lead_qualification": "good_lead", "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "initial_tracker_id": "TRK8154748ae6bd4e278a7cddd38a662f4f", "current_tracker_id": "TRK8154748ae6bd4e278a7cddd38a662f5f", "customer_name": "MANN KEVIN", "customer_phone_number": "+14042223333", "initial_tracking_number": "+14045556677", "current_tracking_number": "+17703334455", "state": "active", "company_time_zone": "America/New_York" }, { "id": "KZaGY", "notes": "Follow up needed", "tags": ["Follow-up"], "value": null, "lead_qualification": null, "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "initial_tracker_id": "TRK8154748ae6bd4e278a7cddd38a662f4f", "current_tracker_id": "TRK8154748ae6bd4e278a7cddd38a662f4f", "customer_name": "POWELL ANDY", "customer_phone_number": "+14042223333", "initial_tracking_number": "+14045556677", "current_tracking_number": "+17703334455", "state": "active", "company_time_zone": "America/New_York" } ] } ``` -------------------------------- ### Creating a User Source: https://apidocs.callrail.com/ Creates a new user. ```APIDOC ## POST /users ### Description Creates a new user. ### Method POST ### Endpoint /users ### Request Body - **email** (string) - Required - The email address of the user. - **role** (string) - Required - The role of the user. ``` -------------------------------- ### Outbound Caller ID Response Example Source: https://apidocs.callrail.com/ This is an example of the JSON response structure when listing outbound caller IDs. It includes details like phone number, name, and verification status. ```json { "page": 1, "per_page": 100, "total_pages": 1, "total_records": 2, "caller_ids": [ { "id": 13, "phone_number": "+14043334455", "name": "Bob's Cell", "verified": true, "created_at": "2016-08-26T09:29:00.198-04:00", "validation_code": "906053" }, { "id": 14, "phone_number": "+14043345566", "name": "Gene's Cell", "verified": true, "created_at": "2016-08-26T09:29:00.198-04:00", "validation_code": "916054" } ] } ``` -------------------------------- ### Basic Call Flow Object - Text Greeting Source: https://apidocs.callrail.com/ Set up a basic call flow to use a text-to-speech greeting. Ensure greeting_recording_url is null when using text greetings. ```json { "type": "basic", "recording_enabled": true, "destination_number": "+15558675309", "greeting_text": "This call will be recorded for quality assurance", "greeting_recording_url": null } ``` -------------------------------- ### Create a New Integration Source: https://apidocs.callrail.com/ Use this cURL command to create a new integration, specifying the type, company ID, and configuration. Replace placeholders with your API token and account ID. ```bash curl -H "Authorization: Token token={api_token}" \ -X POST \ -H "Content-Type: application/json" \ -d '{ "type": "Webhooks", "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "config": { "pre_call_webhook": ["http://example.com/webhook.php"] } }' \ "https://api.callrail.com/v3/a/{account_id}/integrations.json" ``` -------------------------------- ### Configure Source Tracker for All Visitors Source: https://apidocs.callrail.com/ Use 'type: "all"' to show the tracking number to all online visitors. This acts as a catch-all if no other tracker matches. ```javascript // Show this number to all website visitors "source": { "type": "all" } ``` -------------------------------- ### Single Tracker Response Example Source: https://apidocs.callrail.com/ This is an example of the JSON response structure when successfully retrieving a single tracker. It includes details about the tracker's ID, name, status, associated numbers, and call flow. ```json { "id": "TRK8154748ae6bd4e278a7cddd38a662f4f", "name": "My Billboard", "type": "source", "status": "active", "destination_number": "+15553104554", "tracking_numbers": ["+14045554444"], "whisper_message": "Call from [source].", "sms_enabled": true, "sms_supported": true, "company": { "id": "COM8154748ae6bd4e278a7cddd38a662f4f", "name": "Bob's Auto Shop" }, "call_flow": { "type": "basic", "recording_enabled": true, "destination_number": "+15553104554", "greeting_text": "This call will be recorded for quality assurance" }, "source": { "type": "search", "search_engine": "google", "search_type": "organic" }, "created_at": "2011-07-05T19:06:10Z", "disabled_at": null } ``` -------------------------------- ### Create a Tag with Color Source: https://apidocs.callrail.com/ This snippet demonstrates how to create a new tag with a specified color. Ensure you provide a valid color name from the available options. ```bash curl -H "Authorization: Token token={api_token}" \ -X POST \ -H "Content-Type: application/json" \ -d '{ "name": "Existing Customer", "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "color": "gray1" }' \ "https://api.callrail.com/v3/a/{account_id}/tags.json" ``` -------------------------------- ### Configure Claude Desktop MCP Server Source: https://apidocs.callrail.com/ Add this JSON configuration to your `claude_desktop_config.json` file. Replace `{MCP_SERVER_URL}` with your CallRail provided server URL. Claude Desktop will handle the OAuth flow on first connection. ```json { "mcpServers": { "callrail": { "url": "https://{MCP_SERVER_URL}/mcp" } } } ``` -------------------------------- ### Example Form Submission JSON Response Source: https://apidocs.callrail.com/ This is an example of the JSON structure returned when requesting form submissions with milestone data. It includes pagination information and a list of form submissions, each with detailed form data and associated milestones. ```json { "page": 1, "per_page": 2, "total_pages": 75, "total_records": 150, "form_submissions": [ { "id": "FOR8154748ae6bd4e278a7cddd38a662f4f", "company_id": "COM8154748ae6bd4e278a7cddd38a662f4f", "person_id": "anonymous", "form_data": { "name": "Graham Armstrong", "email": "graham@example.com", "phone": "(999) 999-9999", "contact_method": "call", "best_time_to_call": "evening" }, "form_url": "http://www.uptowndental.com/appointment", "landing_page_url": "http://www.uptowndental.com/appointment?campaign=back_to_school&keywords=pediatric%20dentist&gclid=12345abgdef", "referrer": "www.google.com", "referring_url": "www.google.com", "submitted_at": "2017-11-17T07:46:28.000Z", "first_form": false, "customer_phone_number": "+19999999999", "customer_name": "Graham Armstrong", "customer_email": "graham@example.com", "formatted_customer_phone_number": "999-999-9999", "formatted_customer_name": "Graham Armstrong", "source": "Google Ads", "keywords": "pediatric dentist", "campaign": "back_to_school", "medium": "CPC", "milestones": { "first_touch": { "event_date": "2017-10-22T19:41:45.183-04:00", "ad_position": null, "campaign": "back_to_school", "device": "desktop", "keywords": "pediatric dentist", "landing": "http://www.uptowndental.com/appointment?campaign=back_to_school&keywords=pediatric%20dentist&gclid=12345abgdef", "landing_page_url_params": { "campaign": "back_to_school", "keywords": "pediatric dentist", "gclid": "12345abgdef" }, "match_type": null, "medium": "cpc", "referrer": "https://www.google.com/", "referrer_url_params": {}, "session_browser": "Chrome", "url_utm_params": {}, "source": "Google Ads" }, "lead_created": { "event_date": "2017-10-22T19:41:45.183-04:00", "ad_position": null, "campaign": "back_to_school", "device": "desktop", "keywords": "pediatric dentist", "landing": "http://www.uptowndental.com/appointment?campaign=back_to_school&keywords=pediatric%20dentist&gclid=12345abgdef", "landing_page_url_params": { "campaign": "back_to_school", "keywords": "pediatric dentist", "gclid": "12345abgdef" }, "match_type": null, "medium": "cpc", "referrer": "https://www.google.com/", "referrer_url_params": {}, "session_browser": "Chrome", "url_utm_params": {}, "source": "Google Ads" }, "qualified": { "event_date": "2017-10-22T19:41:45.183-04:00", "ad_position": null, "campaign": "back_to_school", "device": "desktop", "keywords": "pediatric dentist", "landing": "http://www.uptowndental.com/appointment?campaign=back_to_school&keywords=pediatric%20dentist&gclid=12345abgdef", "landing_page_url_params": { "campaign": "back_to_school", "keywords": "pediatric dentist", "gclid": "12345abgdef" }, "match_type": null, "medium": "cpc", "referrer": "https://www.google.com/", "referrer_url_params": {}, "session_browser": "Chrome", "url_utm_params": {}, "source": "Google Ads" }, "last_touch": { "event_date": "2017-11-17T07:46:28.000-04:00", "ad_position": null, "campaign": null, "device": "desktop", "keywords": null, "landing": "https://www.example.com/", "landing_page_url_params": {}, ``` -------------------------------- ### Filtering Companies by Status Source: https://apidocs.callrail.com/ This example demonstrates how to filter the list of companies to retrieve only those with a specific status, such as 'disabled'. ```APIDOC ## GET /v3/a/{account_id}/companies.json?status=disabled ### Description Retrieves a list of company objects within the specified account, filtered by their status. This example specifically shows how to get disabled companies. ### Method GET ### Endpoint /v3/a/{account_id}/companies.json ### Parameters #### Query Parameters - **status** (text) - Optional - The field by which the returned response will be filtered. For example, 'disabled' to filter for disabled companies. ```