Data API
REST · JSON v1.0 31 March 2026

Data API

Retrieve detailed call and SMS records for your tracked numbers. Access raw call data, daily aggregates and SMS logs programmatically to power your own dashboards, CRMs and reporting pipelines.

#1 Introduction

The Optico Data API lets you retrieve call and SMS records for your tracked phone numbers. Query individual call details or daily aggregates over a date range. Results are paginated and returned as JSON.

Base URL https://www.optico.fr/data-api

Transport & Conventions

MethodAll endpoints use GET
ParametersPassed as URL query string parameters
Response formatapplication/json
Parameter namessnake_case in requests, camelCase in responses
Date formatYYYY-MM-DD
Pagination1-based page index; page=1 is the first page

#2 Authentication

Every request must include your api_key as a query string parameter. The key is tied to a domain and is issued when your account is created on www.optico.fr.

GET
https://www.optico.fr/data-api?api_key=d4t4_5f4dcc3b5aa765d61d8327deb882cf99&...
If the api_key is missing, invalid, or the domain is inactive, the API returns an ERROR response with the message Invalid api key.

#3 Errors

All error responses share the same envelope:

json
{
  "status": "ERROR",
  "errors": [
    "Invalid api key",
    "Missing parameter `type`"
  ]
}
Error messageCause
Invalid api keyThe api_key is missing, does not exist, or the domain is inactive.
Missing parameter <name>A required parameter was not included in the request.
Invalid date <value>The date is not a valid calendar date or is not in YYYY-MM-DD format.
Limit must be between 10 and 5000The limit value is outside the allowed range.
Invalid parameter typeThe type parameter is not calls or sms.
Cannot handle requestAn unexpected server-side error occurred.
Multiple validation errors can be returned in the same response; inspect the full errors array.

#4 Endpoints

EndpointMethodPurpose
/data-apiGETRetrieve call and SMS records for your tracked phone numbers, paginated.

#5 GET /data-api

Required Parameters

ParameterTypeDescription
api_keyrequiredstringYour Data API key.
typerequiredstringcalls to retrieve call records, sms to retrieve SMS records.
start_daterequiredstringStart of the date range (inclusive). Format: YYYY-MM-DD.
end_daterequiredstringEnd of the date range (inclusive, through 23:59:59). Format: YYYY-MM-DD.
pagerequiredintegerPage number, starting at 1.
limitrequiredintegerResults per page. Min 10, max 5000.

Optional Parameters

ParameterTypeDefaultDescription
phoneoptionalstring-Filter results by destination phone number.
tracking_phoneoptionalstring-Filter results by tracking (surtax) phone number.
caller_phoneoptionalstring-Filter results by caller phone number.
statusoptionalstring-Filter by call status. Comma-separated for multiple values. See Appendix A.
offline_phone_descriptionoptionalstring-Filter by offline phone source description.
group_by_dayoptionalbooleanfalseWhen true, returns one aggregated row per day instead of individual records.

Pagination

Results are paginated. The response includes a total_results field and, when more pages exist, a next_page field. Iterate by incrementing page until next_page is absent.

Pages are 1-based. Always start with page=1. The next_page field is only present when additional results exist beyond the current page.

#6 Data types

#6.1 Calls (type=calls)

Returns individual call records within the requested date range. Optionally group the results by day using group_by_day=true.

6.1.1 Individual Call Records

The default mode (group_by_day=false). Each item in results represents one call.

Flow

You sends GET /data-api with type=calls, start_date, end_date, page, limit to Optico API
Optico API returns status, total_results, [next_page], results[]
Repeat with page=next_page until next_page is absent to retrieve all records.

Success Response

FieldTypeDescription
statusstringOK
total_resultsintegerTotal number of records matching the query across all pages.
next_pageintegerThe next page number. Absent when on the last page.
resultsarrayArray of call objects (see fields below).

Call Object Fields

FieldTypeDescription
start_datestringCall start datetime. Format: DD/MM/YYYY HH:MM:SS.
callerstringCaller phone number. May be masked depending on domain privacy settings.
tracking_numberstringThe tracking (surtax) number that was called.
phonestringThe destination phone number the call was forwarded to.
trigger_typeintegerHow the call was triggered. See Appendix B.
sourcestringTraffic source attribution (e.g. Google Ads, Organic).
urlstringPage URL where the tracking number was displayed.
refererstringReferrer URL.
keywordstringSearch keyword that led to the visit, if available.
call_pathstringNewline-separated list of page URLs visited before the call.
statusstringCall outcome. See Appendix A.
durationintegerActual call duration in seconds.
billing_durationintegerBilled call duration in seconds (may differ from actual duration).
revenuefloatRevenue or cost value attributed to this call.
postcodestringPostcode entered by the caller via IVR, if applicable.
keypadstringKeys pressed by the caller during the call, if applicable.
is_redirectbooleantrue if the call was redirected.
expired_redirectbooleantrue if the call was redirected due to an expired tracking number.
answer_timeintegerTime in seconds before the call was answered.
visit_idstringID of the website visit session associated with this call, if available.
gclidstringGoogle Click ID (gclid) from the visit session associated with this call, if available.
client_datastringCustom client data passed via the tracking script at the time of the visit, if available.

Example

bash
curl "https://www.optico.fr/data-api?api_key=d4t4_5f4dcc3b&type=calls&start_date=2026-01-01&end_date=2026-01-31&page=1&limit=50"
json (response)
{
  "status": "OK",
  "total_results": 123,
  "next_page": 2,
  "results": [
    {
      "start_date":        "17/01/2026 14:30:45",
      "caller":            "+33612345678",
      "tracking_number":   "+33912345678",
      "phone":             "+33987654321",
      "trigger_type":      1,
      "source":            "Google Ads",
      "url":               "https://www.mysite.com/contact",
      "referer":           "google.com",
      "keyword":           "plumber paris",
      "call_path":         "https://www.mysite.com/
https://www.mysite.com/contact",
      "status":            "SUCCESS",
      "duration":          245,
      "billing_duration":  300,
      "revenue":           1.50,
      "postcode":          "75001",
      "keypad":            "1",
      "is_redirect":       false,
      "expired_redirect":  false,
      "answer_time":       8
    }
  ]
}

6.1.2 Daily Aggregated Calls (group_by_day=true)

When group_by_day=true, results are collapsed to one row per day. This mode is useful for building dashboards and trend charts without retrieving every individual call.

Pagination parameters (page, limit) are still required but total_results and next_page are not present in the response. All days in the range are returned.

Aggregated Result Fields

FieldTypeDescription
datestringDate of the aggregated period. Format: YYYY-MM-DD.
callsintegerTotal number of calls on that day.
durationfloatTotal call duration in seconds for that day.
revenuefloatTotal revenue for that day.

Example

bash
curl "https://www.optico.fr/data-api?api_key=d4t4_5f4dcc3b&type=calls&start_date=2026-01-01&end_date=2026-01-07&page=1&limit=100&group_by_day=true"
json (response)
{
  "status": "OK",
  "results": [
    { "date": "2026-01-01", "calls": 45, "duration": 12350.5, "revenue": 67.89 },
    { "date": "2026-01-02", "calls": 38, "duration": 9870.0,  "revenue": 55.20 }
  ]
}

#6.2 SMS (type=sms)

Returns SMS records received on your tracking numbers within the requested date range. Pagination works the same as for calls.

SMS Object Fields

FieldTypeDescription
sent_datestringDate and time the SMS was received. Format: YYYY-MM-DD HH:MM:SS.
caller_phonestringSender phone number.
tracking_phonestringTracking number that received the SMS.
idintegerUnique identifier for the SMS record.
message_contentstring / arrayMessage body. Returns a plain string for standard SMS, or a JSON array for unicode/multi-part SMS.

Example

bash
curl "https://www.optico.fr/data-api?api_key=d4t4_5f4dcc3b&type=sms&start_date=2026-01-01&end_date=2026-01-31&page=1&limit=100"
json (response)
{
  "status": "OK",
  "results": [
    {
      "sent_date":       "2026-01-17 14:30:45",
      "caller_phone":    "+33612345678",
      "tracking_phone":  "+33912345678",
      "id":              789,
      "message_content": "Hello, I'd like more information"
    }
  ]
}

#Appendix A: Call Status Values

The status field on a call record describes the outcome of the call. Use these values with the status filter parameter (comma-separated for multiple values).

ValueDescription
SUCCESSCall completed successfully.
ANOMALYCall ended with an anomaly.
BUSYDestination number was busy.
NORESPONSEDestination did not respond.
EXPIREDThe tracking number had already expired when the call was made.
INTERRUPTEDCall was interrupted before connecting.
ERR_SVI_STOPCall stopped during IVR postcode entry.
NOTASSIGNEDThe original phone number was not assigned to any tracking number.
ERR_CALLER_MSGCaller hung up while listening to a message.
CALLER_PHONE_BLACKLISTEDThe caller's number is on the blocklist.

#Appendix B: Trigger Types

The trigger_type field indicates how a call was initiated.

ValueDescription
1Normal: standard inbound call on a tracking number.
2Webcall: call initiated via the web widget (click-to-call).
3Rule: call triggered by a routing rule.
4Triggered: call triggered programmatically via the API.