Skip to content

AI Call Analysis API

Reference guide to the AI Call Analysis API.

General Information

  • API version: 1.0
  • Base URL: https://cg-dub-ca-api.callgear.ae/api/v1.0/
  • Data format: JSON
  • Authentication: access_token cookie or Authorization: Bearer <token> header

Core Entities

  1. Scenarios - sets of rules and conditions for call analysis.
  2. Scenario Points - key moments in a scenario.
  3. Tags - labels for categorizing scenarios and results.
  4. Scenario Results - data on scenario execution for specific calls.
  5. Authorization Request - API access key.

Endpoint Overview

Purpose Path Method Description
Scenario Management /scenarios GET Get a list of all scenarios
Scenario Management /scenarios POST Create a new scenario
Scenario Management /scenarios/{id} GET Get a specific scenario by ID
Scenario Management /scenarios/{id} PUT Update an existing scenario
Scenario Management /toggle_scenario POST Toggle scenario state (active/inactive)
Scenario Points /scenarios/{scenario_id}/points GET Get all points of a specific scenario
Scenario Points /scenarios/{scenario_id}/points/{point_id} GET Get a specific scenario point
Scenario Points /scenarios/{scenario_id}/text_points GET Get text-based scenario points
Scenario Points /scenarios/points GET Get all points across all scenarios
Scenario Scores /scenarios/{scenario_id}/scenario_score GET Get the score of a specific scenario
Scenario Scores /scenarios/scenario_score GET Get a list of scores for all scenarios
Tag Management /tags GET Get a list of all tags
Tag Management /tags POST Create a new tag
Tag Management /tags/{id} GET Get a tag by ID
Tag Management /tags/{id} PUT Update an existing tag
Scenario Results /scenario_result GET Get a list of all scenario execution results
Scenario Results /scenario_result POST Create a new scenario execution result
Scenario Results /scenario_result/{id} GET Get a scenario execution result by ID
Scenario Results /scenario_result/{id} PUT Update a scenario execution result
Scenario Results /scenario_result/{id} DELETE Delete a scenario execution result
Result Analysis /scenario_result/{id}/summary GET Get a summary of a scenario execution result
Result Analysis /scenario_result/summary GET Get a list of result summaries
Result Analysis /transcription GET Get a list of call transcriptions
Result Analysis /scenario_result/{id}/success_points GET Get successful points from a result
Result Analysis /scenario_result/success_points GET Get a list of successful points
Result Analysis /scenario_result/{id}/tags GET Get tags associated with a result
Result Analysis /scenario_result/tags GET Get a list of result tags
Result Analysis /scenario_result/{id}/employees_metrics GET Get employee metrics from a result
Result Analysis /scenario_result/employees_metrics GET Get a list of employee metrics
Token Management /tokens GET Get a list of SSO tokens
Token Management /tokens POST Create a new SSO token
Token Management /tokens/{id} DELETE Delete an SSO token
JSON-RPC /rpc POST Execute a JSON-RPC request (universal method for remote calls)
Notifications /notification_conditions GET Get conditions for notification triggers
Authorization Request /api-login POST Create a new token

Response Data Format

Format MIME Type
JSON application/json

Explanation of Core Paths

  • /scenarios - base path for scenario objects (CRUD operations).
  • /scenario_result - base path for managing scenario execution results.
  • /tags - base path for tags (labels for data categorization).
  • /tokens - base path for authentication token management.
  • /rpc - universal path for JSON-RPC requests.
  • /notification_conditions - path for retrieving notification condition settings.

Scenarios

Get List of Scenarios

GET /scenarios

Parameters:

Parameter Type Description
_sort string Field for sorting. The default is id.
_order string Sort order: asc or desc. The default is asc.
_start integer Starting index for pagination.
_end integer Ending index for pagination.
filters object Filters.

Create Scenario

POST /scenarios

Request body:

{
  "state": "active|inactive",
  "scenario_text": "string",
  "scenario_name": "string",
  "scenario_score": number,
  "tags": [TagSchema],
  "filters": [FilterResponse]
}

Get Scenario by ID

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/{id}

Returns information about the scenario by its identifier.

Request headers:

  • X-Trace-Id (optional) - identifier for tracing.
  • Accept: application/json (required).

Path parameters:

  • id (required) - scenario identifier.

Example successful response (200 OK):

{
  "state": "inactive",
  "scenario_text": "1. Operator greeted...",
  "id": 130,
  "scenario_name": "Reception Script",
  "scenario_score": 70,
  "tags": [
    {
      "id": 208,
      "comagic_tag_id": 3733,
      "performer": "operator",
      "condition": "discuss",
      "color": "special-2",
      "description": "Expressed negative emotions",
      "name": "Negative behavior"
    }
  ],
  "filters": [
    [
      {
        "id": 203,
        "name": "Call duration",
        "operators": "more than",
        "data_type": "number",
        "values": 5
      }
    ]
  ]
}

Update Scenario

PUT https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/{id}

Updates scenario information by its identifier.

Request headers:

  • X-Trace-Id (optional).
  • Content-Type: application/json (required).
  • Accept: application/json (required).

Path parameters:

  • id (required) - scenario identifier.

Request body example:

{
  "state": "active",
  "scenario_text": "<string>",
  "scenario_name": "",
  "scenario_score": "<number>",
  "tags": [
    {
      "performer": "<string>",
      "condition": "<string>",
      "color": "<string>",
      "description": "<string>",
      "name": "<string>",
      "id": "<integer>",
      "comagic_tag_id": "<integer>"
    }
  ],
  "filters": [
    {
      "id": "<integer>",
      "name": "<string>",
      "operators": "<string>",
      "data_type": "<string>",
      "values": {
        "title": "Values"
      }
    }
  ]
}

The request body is similar to the one used when creating a scenario.

Toggle Scenario State

POST /toggle_scenario

Toggles the scenario state between active and inactive.

Scenario Points and Scores

Get Scenario Points

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/{scenario_id}/points

Parameters:

  • scenario_id (required) - scenario identifier.

Headers:

  • Accept: application/json.
  • access_token: {{apiKey}}.

Successful response (200 OK):

[
  {
    "id": 1,
    "point": "Operator greeted"
  },
  {
    "id": 2,
    "point": "Operator announced his name and position"
  }
]

Get a Specific Point in the Scenario

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/{scenario_id}/points/{point_id}

Parameters:

  • scenario_id (required) - ID of the scenario.
  • point_id (required) - ID of the point in the scenario.

Headers:

  • Accept: application/json.
  • access_token: {{apiKey}}.

Successful response (200 OK):

{
  "id": 1,
  "point": "Operator greeted"
}

Error response (500 Internal Server Error):

{
  "id": "<integer>",
  "point": "<string>"
}

Get Text Points from Scenario

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/{scenario_id}/text_points

Parameters:

  • scenario_id (required) - scenario ID.

Headers:

  • Accept: application/json.
  • access_token: {{apiKey}}.

Example error response (500 Internal Server Error):

{
  "text": "<string>"
}

Get All Points of All Scenarios

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/points

Query parameters:

Parameter Description
_sort Sort field. The default is id.
_order Sort order: asc or desc. The default is asc.
_start Starting index for pagination.
_end Ending index for pagination.
id__eq Filter by scenario ID.

Example request:

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/points?_sort=id&_order=asc

The 200 OK response body is an array of scenarios, where each scenario is an array of objects with the id and point fields:

[
  {
    "id": 1,
    "point": "Target purchase"
  },
  {
    "id": 2,
    "point": "Type of property"
  }
]

To filter by scenario ID, add id__eq={id}:

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenarios/points?_sort=id&_order=asc&id__eq=130

Errors:

  • 404 Not Found - a scenario with the specified ID was not found.
  • 500 Internal Server Error - an internal server error occurred.

Get Scenario Score

GET /scenarios/{scenario_id}/scenario_score

Returns the score of a specific scenario.

Get List of Scenario Scores

GET /scenarios/scenario_score

Returns a list of scores for all scenarios.

Tags

Get List of Tags

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/tags?_sort=id&_order=asc&_start=1&_end=10

Gets a list of tags with sorting and pagination.

Query parameters:

  • _sort - sort field. The default is id.
  • _order - sort order: asc or desc. The default is asc.
  • _start - starting index. The default is 1.
  • _end - ending index. The default is 10.

Headers:

  • X-Trace-Id (optional).
  • Accept: application/json.

Example request:

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/tags?_sort=id&_order=asc&_start=1&_end=10 HTTP/1.1
Host: cg-dub-ca-api.callgear.ae
Authorization: Bearer {{apiKey}}

Example response:

[
  {
    "id": 181,
    "comagic_tag_id": 3745,
    "performer": "operator",
    "condition": "discuss",
    "color": "special-3",
    "description": "Appointment scheduled",
    "name": "Follow-up"
  }
]

Create Tag

POST https://cg-dub-ca-api.callgear.ae/api/v1.0/tags

Creates a new tag.

Headers:

  • X-Trace-Id (optional).
  • Content-Type: application/json.
  • Accept: application/json.

Request body:

{
  "performer": "client",
  "condition": "not discuss",
  "description": "<string>",
  "name": "<string>",
  "color": "<string>",
  "id": "<integer>",
  "comagic_tag_id": "<integer>",
  "is_active": true
}

Example request:

POST https://cg-dub-ca-api.callgear.ae/api/v1.0/tags HTTP/1.1
Host: cg-dub-ca-api.callgear.ae
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
  "performer": "client",
  "condition": "not discuss",
  "description": "New tag description",
  "name": "New tag name",
  "color": "special-5",
  "id": 208,
  "comagic_tag_id": 3746,
  "is_active": true
}

Common status codes: 200 OK, 401 Unauthorized, 403 Forbidden, 404 Not Found, and 500 Internal Server Error.

Example error response:

{
  "error": "Internal Server Error",
  "message": "An error occurred while processing your request."
}

Get Tag by ID

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/tags/{id}

Retrieves a specific tag by its identifier.

Path parameters:

  • id (required) - the unique identifier of the tag.

Headers:

  • X-Trace-Id (optional).
  • Accept: application/json.

Example request:

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/tags/181 HTTP/1.1
Host: cg-dub-ca-api.callgear.ae
Authorization: Bearer {{apiKey}}

Update Tag

PUT https://cg-dub-ca-api.callgear.ae/api/v1.0/tags/{id}

Updates an existing tag.

Path parameters:

  • id (required) - unique identifier of the tag to update.

Headers:

  • X-Trace-Id (optional).
  • Content-Type: application/json.
  • Accept: application/json.

The request body uses the same schema as Create Tag.

Example request:

PUT https://cg-dub-ca-api.callgear.ae/api/v1.0/tags/181 HTTP/1.1
Host: cg-dub-ca-api.callgear.ae
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
  "performer": "client",
  "condition": "not discuss",
  "description": "Updated description",
  "name": "Updated tag name",
  "color": "special-2",
  "id": 181,
  "comagic_tag_id": 3745,
  "is_active": true
}

Scenario Results

Get List of Results

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result

Returns a list of all scenario results. Supports sorting, filtering, and pagination.

Query parameters are optional: _sort (default id), _order (asc or desc), _start, _end, and call_session_id__eq (filter by call session ID).

Example - results for a specific session:

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result?call_session_id__eq=129742035

Each object includes id, app_id, call_session_id, scenario_id, scenario_name, and result. The result object contains hold data, scenario data (name, evaluation, and timestamps), silences, profanity, a phrase list with emotions and timestamps, audio sources, a dialog summary, and the scenario score as a percentage.

Example response:

[
  {
    "id": 34612,
    "app_id": 64832,
    "call_session_id": 129742029,
    "scenario_id": 130,
    "scenario_name": "Medicine",
    "result": {
      "hold": {
        "data": [],
        "active_count": 0
      },
      "scenario": {
        "data": [
          {
            "end": 7.84,
            "name": "Operator greeted",
            "score": 1,
            "start": 2.72
          }
        ],
        "count": 3,
        "is_successful": false,
        "scenario_name": "Medicine",
        "percent_completion": 15
      },
      "phrase_list": [
        {
          "end": 1.32,
          "start": 1.04,
          "phrase": "All right.",
          "channel": 1,
          "emotions_result": "neutral"
        }
      ]
    }
  }
]

Errors: 400 Bad Request for invalid query parameters and 500 Internal Server Error for an internal server error.

Create Scenario Result

POST https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result

Saves the results of a scenario execution. On success, returns the created scenario result.

Headers:

  • X-Trace-Id (optional).
  • Content-Type: application/json (required).
  • Accept: application/json (required).

Request body:

{
  "call_session_id": "<integer>",
  "scenario_id": "<integer>",
  "scenario_name": "<string>",
  "result": {},
  "id": "<integer>",
  "app_id": "<integer>"
}

Example request:

curl -X POST \
  https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result \
  -H 'key: {{apiKey}}' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "call_session_id": 123,
    "scenario_id": 456,
    "scenario_name": "Test Scenario",
    "result": {},
    "id": 789,
    "app_id": 101
  }'

Mandatory fields: call_session_id, scenario_id, scenario_name, id, and app_id. The result field can be an empty object if data is not required.

Get Scenario Result by ID

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/{id}

Returns the result of a scenario execution by its unique identifier.

Path parameters:

  • id (required) - the unique identifier of the scenario result.

Example response:

{
  "id": 34618,
  "app_id": 64832,
  "call_session_id": 129742035,
  "scenario_id": 133,
  "scenario_name": "Football",
  "result": {
    "hold": {
      "data": [],
      "active_count": 0
    },
    "scenario": {
      "data": [
        {
          "end": 335.25563392,
          "name": "Discussed the latest transfers of the club",
          "score": 1,
          "start": 322.375647232
        }
      ],
      "count": 12,
      "is_successful": true,
      "scenario_name": "Football",
      "percent_completion": 80
    },
    "silences": {
      "data": [],
      "active_count": 0
    },
    "profanity": {
      "data": [
        {
          "end": 18.169,
          "name": "profanity",
          "start": 17.849,
          "state": "active",
          "duration": 0.32
        }
      ],
      "active_count": 6
    },
    "tag_events": {
      "events": [
        {
          "id": "cbc61a46-bcae-4dea-ae08-26d5381b1e0e",
          "end": 314.08,
          "score": 1,
          "start": 303.80,
          "state": "active",
          "tag_id": 211
        }
      ],
      "active_count": 2
    },
    "phrase_list": [
      {
        "end": 1.96,
        "start": 1.72,
        "phrase": "Hello.",
        "channel": 1,
        "words_list": [
          {
            "end": 1.96,
            "word": "hello",
            "start": 1.72
          }
        ],
        "emotion_state": "active",
        "emotions_result": "neutral"
      }
    ]
  }
}

Update Scenario Result

PUT https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/{id}

Updates a scenario result by its identifier.

Path parameters:

  • id (required).

Request body fields: call_session_id, scenario_id, scenario_name, result, id, and app_id.

{
  "call_session_id": 123,
  "scenario_id": 456,
  "scenario_name": "Test Scenario",
  "result": {},
  "id": 789,
  "app_id": 101
}

The response contains the updated scenario result.

Delete Scenario Result

DELETE https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/{id}

Deletes a scenario result by its identifier.

Path parameters:

  • id (required) - integer identifier of the scenario result.

Headers:

  • Accept: application/json.
  • X-Trace-Id (optional).

The response has no body. A successful execution is confirmed by 204 No Content.

Errors: 404 Not Found when the result does not exist and 400 Bad Request for an invalid identifier.

Result Analysis

Get Summary of Scenario Result

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/{id}/summary

Returns a summary of the scenario result by its identifier. The id parameter is required.

Example successful response (200 OK):

{
  "dialog_summary": "Main topic: Medical appointment\nResult: Request clarification on the appointment\nInteraction Type: Inquiry, not sales-related\nBrief Description: The customer inquires about the possibility of an appointment with Dr. Tarasenko on January 8th. The operator clarifies how to approach the customer to continue the conversation, but the appointment is not confirmed."
}

Get Summary List

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/summary

Returns a list of summaries for scenario results. Supports filtering by call session, sorting, and pagination.

Query parameters: _sort (default id), _order (asc or desc, default asc), call_session_id__eq, _start, and _end. Pagination is disabled in this example.

Example response:

[
  {
    "dialog_summary": "Main topic: Discussion about the football match..."
  }
]

Get Successful Points from Scenario Result

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/{id}/success_points

Returns the successful points of the scenario. The id parameter is required.

Headers:

  • Accept: application/json.
  • X-Trace-Id (optional).

Example successful response (200 OK):

[
  {
    "name": "Operator greeted",
    "start": 2.72,
    "end": 7.84
  },
  {
    "name": "Operator introduced himself, position",
    "start": 2.72,
    "end": 7.84
  },
  {
    "name": "Clarified the client's name",
    "start": 16.749,
    "end": 23.749
  }
]

Fields: name - name of the success criterion; start and end - execution time in seconds.

Get Successful Points List

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/success_points

Returns a list of success-point scores sorted by id ascending. Query parameters: _sort (default id), _order, _start, and _end.

Get Tags from Result

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/{id}/tags

Returns a list of tags associated with the result of executing a scenario. The id parameter is required.

Headers:

  • Accept: application/json.
  • X-Trace-Id (optional).

Each tag contains name, start, end, and color.

Example response:

[
  {
    "name": "failure to register",
    "start": 37.150,
    "end": 50.510,
    "color": "special-6"
  },
  {
    "name": "word parasites",
    "start": 15.363,
    "end": 33.203,
    "color": "special-4"
  }
]

Get List of Result Tags

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/tags

Returns a list of tags associated with scenario metric results, in sorted order.

Query parameters: _sort (default id), _order (asc or desc), _start, and _end.

Headers:

  • Accept: application/json.
  • X-Trace-Id (optional).

Get Employee Metrics from Scenario Result

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/{id}/employees_metrics

Returns the employee metrics for a scenario result. The id parameter is required.

Headers:

  • Accept: application/json.
  • X-Trace-Id (optional).

Each object contains name, start, and end in seconds.

Example response:

[
  {
    "name": "profanity",
    "start": 17.849,
    "end": 18.169
  },
  {
    "name": "profanity",
    "start": 49.302,
    "end": 49.622
  }
]

Get Employee Metrics List

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/scenario_result/employees_metrics

Returns a list of employee metrics with sorting and pagination.

All query parameters are optional: _sort (default id), _order (asc or desc, default asc), _start, and _end.

Headers:

  • Accept: application/json.
  • X-Trace-Id (optional).

Transcriptions

Get List of Call Transcriptions

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/transcription

Returns a list of call transcriptions generated by STT. The endpoint supports sorting, pagination, content search, date filtering, and filtering by call session ID.

Authentication: access_token cookie or Authorization: Bearer <token> header.

Query parameters:

Parameter Type Description
_sort string Optional field to sort by. Example: id.
_order enum Optional sort order: asc or desc. Example: asc.
_start integer Optional starting index for pagination. Example: 0.
_end integer Optional ending index or page size. Example: 100.
_q string Optional search by transcript content.
filters DataFilters Optional search filters.
call_session_id__eq integer Optional filter by a specific call session ID.
date_from string Optional start date in ISO 8601 format.
date_till string Optional end date in ISO 8601 format.

Headers:

  • X-Trace-Id (optional).
  • Accept: application/json (required).
  • Cookie: access_token=<KEY> or Authorization: Bearer <TOKEN>.

Example request:

curl -X GET \
  https://cg-dub-ca-api.callgear.ae/api/v1.0/transcription \
  -H 'Cookie: access_token=<KEY>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

Example response:

[
  {
    "app_id": 64832,
    "call_session_id": 156491350,
    "result": {
      "phrase_list": [
        {
          "end": 1.06,
          "start": 0.56,
          "phrase": "Hello.",
          "role": "client",
          "words_list": [
            {
              "end": 1.06,
              "word": "Hello.",
              "start": 0.56
            }
          ]
        },
        {
          "end": 2.34,
          "start": 1.84,
          "phrase": "Hello.",
          "role": "operator",
          "words_list": [
            {
              "end": 2.34,
              "word": "Hello.",
              "start": 1.84
            }
          ]
        }
      ],
      "call_segments": []
    }
  }
]

Example filters:

Get a call by ID: /api/v1.0/transcription?call_session_id__eq=123456
Sorting and pagination: /api/v1.0/transcription?_sort=id&_order=desc&_start=0&_end=50
Filter by date: /api/v1.0/transcription?date_from=2025-10-13T07:23:08.337Z&date_till=2025-10-14T07:23:08.337Z

To retrieve all transcriptions, call the endpoint without parameters. For specific records, use filters such as call_session_id__eq. For multiple call IDs, use call_session_id__in when supported. A single request should normally contain no more than 50-100 records; remaining records are indicated in the response headers.

Response fields: app_id, call_session_id, result.phrase_list, and result.call_segments. Each phrase contains start, end, phrase, role, and words_list; each word contains start, end, and word.

Errors: 400 Bad Request for invalid query parameters, 404 Not Found when the call session was not found, and 500 Internal Server Error for an internal server error.

Tokens

Get Token List

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/tokens

Returns a list of all SSO tokens.

Example response:

[
  {
    "name": "<string>",
    "access_token": "<access_token>",
    "token_type": "Bearer",
    "expires_in": "<string>",
    "id": "<string>",
    "issued_token_type": "<string>",
    "created_at": "<string>",
    "is_active": true
  }
]

Create Token

POST https://cg-dub-ca-api.callgear.ae/api/v1.0/tokens

Creates a new SSO token.

Request body:

{
  "name": "<string>"
}

Example response:

{
  "name": "<string>",
  "access_token": "<access_token>",
  "token_type": "Bearer",
  "expires_in": "<string>",
  "id": "<string>",
  "issued_token_type": "<string>",
  "created_at": "<string>",
  "is_active": true
}

Delete Token

DELETE https://cg-dub-ca-api.callgear.ae/api/v1.0/tokens/{id}

Deletes an SSO token by the specified identifier.

Path parameters:

  • id (string, required) - ID of the token to delete.

JSON-RPC

Execute a JSON-RPC Request

POST /rpc

Request body:

{
  "id": "string",
  "method": "string",
  "params": object
}

Notification Conditions

Get Notification Conditions

GET https://cg-dub-ca-api.callgear.ae/api/v1.0/notification_conditions

Provides access to notification conditions, which define the criteria for selecting callers based on filters such as visitor segments, call direction, phone numbers, contacts, advertising campaigns, and others.

Query parameters: none.

Headers:

  • X-Trace-Id (optional).
  • Accept: application/json (required).

Example response:

[
  {
    "id": 5,
    "name": "Segment List",
    "operators": [
      {
        "id": "=",
        "name": "Exactly matches",
        "is_default": true
      },
      {
        "id": "in",
        "name": "Includes",
        "is_default": false
      },
      {
        "id": "is_null",
        "name": "Empty",
        "is_default": false
      },
      {
        "id": "is_not_null",
        "name": "Not empty",
        "is_default": false
      },
      {
        "id": "intersect",
        "name": "Includes",
        "is_default": false
      }
    ],
    "data_type": "array",
    "values": [
      {
        "id": 2322,
        "name": "hcp.tb.ru",
        "data": [
          {
            "id": 5739,
            "name": "PC test"
          },
          {
            "id": 4995,
            "name": "Visitor viewed 5 or more pages"
          }
        ]
      }
    ]
  },
  {
    "id": 7,
    "name": "Call Direction",
    "operators": [
      {
        "id": "=",
        "name": "Exactly matches",
        "is_default": true
      }
    ],
    "data_type": "string",
    "values": [
      {
        "id": "in",
        "name": "Incoming call"
      },
      {
        "id": "out",
        "name": "Outgoing call"
      }
    ]
  }
]

Response fields: id, name, operators (each with id, name, and is_default), data_type (for example, array, string, or number), and values (may be null).

Errors: 400 Bad Request, 401 Unauthorized, and 500 Internal Server Error.

Data Models

TagSchema

{
  "id": integer,
  "comagic_tag_id": integer,
  "performer": "string",
  "condition": "string",
  "color": "string",
  "description": "string",
  "name": "string"
}

ScenarioFormResponse

{
  "state": "active|inactive",
  "scenario_text": "string",
  "id": integer,
  "scenario_name": "string",
  "scenario_score": number,
  "tags": [TagSchema],
  "filters": [FilterResponse]
}

ScenarioPoint

{
  "id": integer,
  "point": "string"
}

ScenarioScore

{
  "scenario_score": number
}

ScenarioResult

{
  "id": integer,
  "app_id": integer,
  "call_session_id": integer,
  "scenario_id": integer,
  "scenario_name": "string",
  "result": object
}

Token

{
  "name": "string",
  "id": "string",
  "access_token": "string",
  "token_type": "Bearer",
  "issued_token_type": "string",
  "expires_in": "string",
  "created_at": "string",
  "is_active": boolean
}

Authorization Request

POST https://cg-dub-ca-api.callgear.ae/api/v1.0/api-login

Request body:

{
  "username": "<your_username>",
  "password": "<your_password>"
}

Request headers:

  • X-Trace-Id (optional).
  • Content-Type: application/json.
  • Accept: application/json.

Successful response example (200 OK):

{
  "name": "",
  "id": "88e1164b-0fca-4266-73c4-69840cc8edf4",
  "access_token": "<access_token>",
  "token_type": "Bearer",
  "issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
  "expires_in": "2025-05-14T10:46:55.182817",
  "created_at": "2025-04-14T10:39:06.568300",
  "is_active": true
}

Error - 401 Unauthorized:

{
  "type": "HTTPUnauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Incorrect login or password"
}

Error - 500 Internal Server Error:

{
  "type": "HTTPInternalServerError",
  "title": "Server got itself in trouble",
  "status": 500,
  "detail": "Something went wrong. Please try again later."
}

Response fields: id (unique session identifier), access_token (API access token), expires_in (token expiry in YYYY-MM-DDTHH:MM:SS format), created_at (token creation date), and is_active (session activity status).