Call Trace Service
The Call Trace Service enables callers to obtain information about all API calls that took place within a given time period. For example, you can view the count of queries or mutations of a particular service that were called within a given time period. The service also reports the outbound webhook deliveries that SBS attempted, through the webhookCalls query.
This service is a tenant-level service, and, consequently, it returns data only for other tenant-level services. To return the list of tenant-level services, run the services query.
To return call trace data for account-level services, or for the account-api service, run the calls query of the Account API.
Access info
| Endpoint | https://call-trace-api.socrate.io/graphql |
| MCP endpoint | https://call-trace-api.socrate.io/mcp |
| Required access keys | Tenant-level service access key |
| Pricing | Check the available purchase options. |
| Notes | To call the service, the access key must be provided in the x-api-key header of the HTTP request. If you are using the GraphQL console, you can view the service’s documentation and schema only after entering an access key. Make sure that the scope of the key allows access to the queries that you require. For example, to grant the key access to all queries, the key’s scope must be set to call-trace-api:query:*. |
Queries
calls
Returns the count of queries or mutations that were run for a particular service, or for all services.
Arguments
| Argument | Type | Description |
|---|---|---|
| filter | CallsFilter! |
Provides filtering options to the query. |
| nextToken | String |
Optional argument used to fetch the next set of query results. This value can be obtained from the nextToken attribute of the CallsResult type. |
CallsFilter input
| Attribute | Type | Description |
|---|---|---|
| from | DateTime! |
Mandatory. The date and time starting with which call trace data will be fetched. |
| to | DateTime |
Optional. The date and time up to which call trace will be fetched, for example, 2024-07-16, 2024-07-15T06:59:59, 2024-07-16T11:30:53.983Z. Note that, if you specify only a date value without time, then the time is considered to be 00:00:00. |
| service | ServiceCode |
Optional. The service code specifies the service for which you would like to collect call trace data. To obtain all available service codes, run the services query. |
| operationType | OperationType |
Optional. Specifies the operation type for which call trace data should be returned. Valid values: query, mutation. |
| result | CallResult |
Optional. Lets you filter calls by result type. Valid values: data - return calls with data, error- return calls with errors. |
| field | Field |
Optional. Specifies the name of the query or mutation for which call trace data should be returned. |
| publicKey | ID |
Optional. Lets you filter calls where a tenant-level service access key (not a token) was used and the public key is the one you supply in this input parameter. |
| userId | ID |
Optional. Lets you filter calls initiated by a specific SBS Portal User. To filter such calls, supply the ID of the portal user in this input parameter. You can find the ID of an SBS Portal User by running the portalUsers query of the Account API. |
Result
CallsResult type
| Attribute | Type | Description |
|---|---|---|
| items | [CallsValue] |
The call trace data that matches the filtering options, as an array of items of type CallsValue. |
| nextToken | String |
If null, then the query has reached the end of the list of results that match the query criteria. If not null, then use this value in the nextToken input argument, with the same filter, to fetch the next set of results. |
CallsValue type
| Attribute | Type | Description |
|---|---|---|
| service | ServiceCode |
The service code indicates specifies the service for which call trace data have been retrieved. |
| operationType | OperationType |
Specifies the operation type for which call trace data have been returned. Valid values: query, mutation. |
| field | Field |
Specifies the name of the query or mutation for which call trace data have been retrieved. |
| count | Float |
The actual count of calls (queries or mutations) that took place. |
| duration | Float |
The call duration, in milliseconds. |
Example
The following call returns the count of runs for the sendMessage mutation of the Email Service starting from the 1st of July 2023 up to the current date and time:
query calls ($filter:CallsFilter!){
calls(filter:$filter) {
items {
service
operationType
field
count
}
}
}
{
"filter": {
"from": "2023-07-01",
"service": "email-api",
"field": "sendMessage"
}
}
distinctCalls
Returns more detailed trace information about API calls. Compared to the calls query, the distinctCalls query does not aggregate the count of calls, and thus is useful for debugging individual calls.
Arguments
| Argument | Type | Description |
|---|---|---|
| filter | DistinctCallsFilter! |
Provides filtering options to the query. |
| nextToken | String |
Optional argument used to fetch the next set of query results. This value can be obtained from the nextToken attribute of the CallsResult type. |
DistinctCallsFilter input
| Attribute | Type | Description |
|---|---|---|
| from | DateTime! |
Mandatory. The date and time starting with which call records will be fetched. |
| to | DateTime |
Optional. The date and time up to which call records will be fetched, for example, 2024-07-16, 2024-07-15T06:59:59, 2024-07-16T11:30:53.983Z. Note that, if you specify only a date value without time, then the time is considered to be 00:00:00. |
| service | ServiceCode |
Optional. The service code specifies the service for which you would like to retrieve calls. To obtain all available service codes, run the services query. |
| operationType | OperationType |
Optional. Specifies the operation type for which call records should be returned. Valid values: query, mutation. |
| field | Field |
Optional. Specifies the name of the query or mutation for which call records should be returned. |
| publicKey | ID |
Optional. Lets you filter calls where a tenant-level service access key (not a token) was used and the public key is the one you supply in this input parameter. |
| userId | ID |
Optional. Lets you filter calls initiated by a specific SBS Portal User. To filter such calls, supply the ID of the portal user in this input parameter. You can find the ID of an SBS Portal User by running the portalUsers query of the Account API. |
| requestId | ID |
Optional. Lets you filter calls by the unique request ID assigned to this call by AWS. |
| result | CallResult |
Optional. Lets you filter calls by result type. Valid values: data - return calls with data, error- return calls with errors. |
Result
DistinctCallsResult type
| Attribute | Type | Description |
|---|---|---|
| items | [DistinctCallsValue] |
The data that matches the filtering options, as an array of items of type DistinctCallsValue. |
| nextToken | String |
If null, then the query has reached the end of the list of results that match the query criteria. If not null, then use this value in the nextToken input argument, with the same filter, to fetch the next set of results. |
DistinctCallsValue type
| Attribute | Type | Description |
|---|---|---|
| service | ServiceCode |
The service code indicates specifies the service for which call records have been retrieved. |
| operationType | OperationType |
Specifies the operation type for which call records have been returned. Valid values: query, mutation. |
| field | Field |
Specifies the name of the query or mutation for which call records have been retrieved. |
| publicKey | ID |
The public key with which the call was made. Applicable only for calls that were made through an API key. |
| userId | ID |
The ID of the user in User Management Service that made this call through the SBS Portal. Applicable only for calls that were made through an authorization token by SBS Portal users. |
| requestId | ID |
The unique identifier of the request assigned by AWS. |
| result | CallResult |
Indicates whether the call returned data or an error. Valid values: data, error. |
| message | String |
The error message. This value is present only if the call result was error. |
| duration | Float |
The call duration, in milliseconds. |
| time | DateTime |
The date and time when the call took place. |
| sourceIp | String |
The IP address of the API caller. |
Example
The following call returns information about erroneous calls that took place for the Email Service on May 28th, 2025:
query distinctCalls ($filter:DistinctCallsFilter!, $nextToken:String) {
distinctCalls(filter:$filter, nextToken:$nextToken) {
items {
service
operationType
field
publicKey
userId
requestId
result
message
duration
time
}
nextToken
}
}
{
"filter": {
"from": "2025-05-28",
"to": "2025-05-29",
"service": "email-api",
"result": "error"
}
}
webhookCalls
Returns the individual webhook deliveries that SBS attempted, so you can check whether a webhook your application expected was sent, and how your endpoint responded.
Results are scoped to the tenant of the access key that you use, so the query takes no tenant, account, or application argument. Deliveries are returned newest first.
For information about configuring webhooks, see Webhooks.
Arguments
| Argument | Type | Description |
|---|---|---|
| filter | WebhookCallsFilter! |
Provides filtering options to the query. |
| nextToken | String |
Optional argument used to fetch the next set of query results. This value can be obtained from the nextToken attribute of the WebhookCallsResult type. |
WebhookCallsFilter input
Filtering options are combined conjunctively: a delivery is returned only if it matches every option that you supply.
| Attribute | Type | Description |
|---|---|---|
| from | DateTime! |
Mandatory. The date and time starting with which webhook deliveries will be fetched. |
| to | DateTime |
Optional. The date and time up to which webhook deliveries will be fetched, for example, 2026-07-16, 2026-07-15T06:59:59, 2026-07-16T11:30:53.983Z. Note that, if you specify only a date value without time, then the time is considered to be 00:00:00. |
| service | ServiceCode |
Optional. The service code specifies the service whose webhook deliveries you would like to retrieve. To obtain all available service codes, run the services query. |
| event | String |
Optional. The event that triggered the delivery, for example, EMAIL_DELIVERED. To find the events that a service raises, see the Webhooks section of the reference page of that service. |
| webhookType | WebhookType |
Optional. Not currently used. |
| result | WebhookCallResult |
Optional. Lets you filter deliveries by outcome. Valid values: SUCCESS - return deliveries that reached your endpoint successfully, ERROR - return failed deliveries. |
Result
WebhookCallsResult type
| Attribute | Type | Description |
|---|---|---|
| items | [WebhookCallValue] |
The webhook deliveries that match the filtering options, as an array of items of type WebhookCallValue. |
| nextToken | String |
If null, then the query has reached the end of the list of results that match the query criteria. If not null, then use this value in the nextToken input argument, with the same filter, to fetch the next set of results. |
WebhookCallValue type
| Attribute | Type | Description |
|---|---|---|
| timestamp | DateTime |
The date and time when the delivery took place. |
| service | ServiceCode |
The service code of the service that raised the webhook. |
| event | String |
The event that triggered the delivery. |
| webhookType | WebhookType |
Not currently used. |
| httpMethod | String |
The HTTP method with which SBS posted to your endpoint. |
| httpStatus | Int |
The HTTP status code that your endpoint returned. This value is null if the delivery never reached your endpoint. |
| duration | Float |
The duration of the delivery, in milliseconds. |
| result | WebhookCallResult |
The outcome of the delivery. Valid values: SUCCESS, ERROR. |
| requestId | ID |
The unique identifier of the delivery. Quote this value when you report a delivery problem to support. |
Example
The following call returns the failed webhook deliveries raised by the Email Service between the 1st and the 8th of July 2026:
query webhookCalls ($filter:WebhookCallsFilter!, $nextToken:String) {
webhookCalls(filter:$filter, nextToken:$nextToken) {
items {
timestamp
service
event
webhookType
httpMethod
httpStatus
duration
result
requestId
}
nextToken
}
}
{
"filter": {
"from": "2026-07-01",
"to": "2026-07-08",
"service": "email-api",
"result": "ERROR"
}
}
services
Returns a list of all services exposed by the Socrate Business Services API. This query is useful when you need to find out the service code of a particular service, for example, when querying usage.
Arguments
None.
Result
An array of service codes.
Example
query services {
services
}
version
Returns the API version.
AI agent access (MCP)
The service serves its queries as tools to AI agent clients over the Model Context Protocol (MCP), a JSON-RPC 2.0 protocol through which a client reads a catalog of tools and calls them by name. Agent clients such as Claude Code connect to https://call-trace-api.socrate.io/mcp.
Access
The MCP endpoint is on the same host as the GraphQL endpoint and accepts the same credentials:
- A tenant-level service access key, in the
x-api-keyheader. - A service access token, in the
Authorizationheader asBearer YOUR_SERVICE_ACCESS_TOKEN.
The endpoint speaks protocol revision 2026-07-28 and accepts protocol requests as POST only. It is stateless: every request carries its own credentials, and there is no handshake or session to open first. Your agent client must support revision 2026-07-28.
For connection instructions, open https://call-trace-api.socrate.io/mcp in a browser. The page needs no credential.
Tools
The catalog holds one tool per query of this service:
| Tool | Required arguments |
|---|---|
version |
— |
services |
— |
calls |
filter |
distinctCalls |
filter |
webhookCalls |
filter |
The filter of each of these tools requires from. The optional nextToken argument of each query is an optional argument of its tool.
The catalog a caller receives lists only the tools whose query the scope of its key or token allows. If a service access denial blocks a query, your agent does not see a tool for it. A tool call runs the query under the caller’s own credentials and returns the data that the equivalent GraphQL query returns for that caller. Every tool is marked read-only (readOnlyHint is true), and answers from SBS alone, without calling any system outside SBS (openWorldHint is false).
Documentation resources
Besides its tools, the endpoint publishes, as addresses, this page and the API conventions page.
Connecting an agent client
To add the endpoint to Claude Code, run:
claude mcp add --transport http call-trace-api https://call-trace-api.socrate.io/mcp --header "x-api-key: YOUR_ACCESS_KEY"
Other agent clients take the same URL and header in their own configuration.
Example
An agent client builds the protocol requests for you. To call a tool directly over HTTP, send a POST request that names the protocol revision both in the MCP-Protocol-Version header and in the request’s _meta, the method in the Mcp-Method header, and, for a tool call, the tool in the Mcp-Name header:
POST /mcp HTTP/1.1
Host: call-trace-api.socrate.io
Content-Type: application/json
Accept: application/json
x-api-key: YOUR_ACCESS_KEY
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: calls
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
},
"name": "calls",
"arguments": {
"filter": {
"from": "2026-10-01",
"service": "email-api",
"field": "sendMessage"
}
}
}
}
The call trace data is returned in structuredContent, and as the same JSON text in content:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"resultType": "complete",
"content": [
{ "type": "text", "text": "{\"items\":[{\"service\":\"email-api\", ...}" }
],
"structuredContent": {
"items": [
{
"service": "email-api",
"operationType": "mutation",
"field": "sendMessage",
"count": 42,
"duration": 318.5
}
],
"nextToken": null
}
}
}