Insights
The Insights APIs give you the data that shows in the Insights Hub. Use them to monitor your workflows from your own tools.
All Insights endpoints use the POST method. You send the query in the JSON body.
Key terms
These terms have the same meaning in all Insights endpoints.
-
Workflow run: One execution of a workflow, from the trigger to the end. A workflow run has one of these results:
- Successful: All steps completed.
- Failed: A step had an error that stopped the run.
- Terminated: A Terminate step stopped the run.
- Stopped: A user or Tray stopped the run before it completed.
Insights counts a run only after it ends. Runs that Tray did not start because your organization was at its task limit are not counted.
-
Task: One execution of one step in a workflow run. If a step is in a loop, each iteration is one task. For example, if a Slack step is in a loop with 3 iterations, the Slack step has 3 tasks in that run. Refer to What is a task?
-
Task runs: The number of tasks that completed with success or with an error.
-
Data volume: The total size of the data that the steps processed, in bytes.
-
Active workflow: A workflow that had one or more workflow runs in the time period. "Active" does not mean that the workflow is enabled.
-
End user (Embedded only): A user of your solution instances. Insights identifies an end user by the external user ID that you set when you create the end user.
Note: Task runs in Insights are for monitoring. They are not the same as your billable task count. For billable usage, use the Usage APIs.
Embedded workflows
When an end user runs a solution instance, Tray runs a copy of each workflow in the solution. Insights counts the runs and tasks of these copies against the source workflow in your project. Thus, a source workflow shows the total of all its solution instances.
To see data for one solution instance, use the solutionInstances filter. To see a table with one row for each solution instance, use Get Table with gridType SolutionInstance.
Time period
Each request has a time period:
startPeriodis necessary. Tray includes data from this time.endPeriodis optional. Tray includes data up to this time, but not data at this time. If you do not setendPeriod, Tray uses the current time.
Use ISO 8601 format in UTC, for example 2026-10-01T00:00:00Z.
The length of time that you can query depends on your package. Refer to Insights.
Time intervals
The KPI and time series endpoints group data into time intervals. The length of the time period sets the interval:
| Time period | Interval |
|---|---|
| Less than 50 hours | 5 minutes |
| 50 hours to less than 50 days | 1 hour |
| 50 days or more | 1 day |
All intervals start at UTC times. For example, a 1-day interval starts at 00:00 UTC. To get correct totals, start and end your time period at the start of an interval.
Data delay
New data shows in Insights approximately 20 minutes after a workflow run ends. Thus, the most recent 20 minutes of a time period can be incomplete.
KPIs with the solutionInstances filter can take longer. For these, new data can show up to 40 minutes after the end of the hour in which the workflow run ended.
Filters
Use the filters object to limit the data to some workflows. All filters are optional.
- If you set more than one filter, the data must agree with all the filters.
- If a filter has more than one value, the data must agree with one of the values.
- If you set a filter to an empty list (
[]), the response contains no data.
| Filter | Data that it keeps |
|---|---|
workspaces |
Workflows in these workspaces. |
projects |
Workflows in these projects. |
workflows |
These workflows. |
solutions |
Runs of these solutions (Embedded only). |
solutionInstances |
Runs of these solution instances (Embedded only). |
isMcpToolExecution |
If true, only workflow runs that an AI agent started as an MCP tool. If false, Tray does not filter. |
contextUserIds |
MCP tool runs that these Tray users started. |
To find the IDs for the filters, use the list endpoints, for example List Workflows.
Permissions
Use the token of an API user. Refer to API users and tokens.
The API user must have one of these organization roles: Owner, Admin, Contributor or Viewer. The response contains data only from the organization of the API user. The organization role changes the data:
- Owner or Admin: The KPI, time series and table endpoints give data from all workspaces in the organization.
- Contributor or Viewer: All endpoints give data only from the workspaces that the API user can access.
The list endpoints always give only the items in workspaces that the API user can access.
If a workspace admin makes the API user, its organization role is Viewer. Thus, its token gives data only from the workspaces that it can access.
Pagination
The table and list endpoints give the data in pages. The default page size is 100.
- Set
firstto the page size. - Read
pageInfoin the response. IfhasNextPageistrue, send the same request again. Setafterto the value ofpageInfo.endCursor. - Do step 2 again until
hasNextPageisfalse.
To go back one page, set before to the value of pageInfo.startCursor.
The first page has no startCursor. The last page has no endCursor.
Note: The cursor does not keep your filters or sort order. Send the same filters and orderBy in each request.
When the last page is full, hasNextPage can be true. In this case, the next page is empty.
Rate limits
Tray limits the number of requests to the Insights endpoints: 300 requests each minute and 5,000 requests each hour.
Each response has headers that show the limit and the number of requests that remain, for example RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. RateLimit-Reset is the number of seconds before the limit for the minute starts again.
If you go above a limit, the response is 429. Wait, then send the request again.
Get Table
Gets a table with one row for each workflow, project, connector, workspace or solution instance. The workflow, project and connector tables are the tables in the Insights Hub.
Use gridType and metricType to select the table:
gridType |
metricType |
Columns |
|---|---|---|
Workflow |
WORKFLOW_EXECUTIONS (default) |
WorkflowId, WorkflowName, WorkflowRuns, SuccessRate, SuccessfulRuns, FailedRuns, TerminationRuns |
Project |
WORKFLOW_EXECUTIONS (default) |
ProjectId, WorkspaceId, ProjectName, WorkflowRuns, SuccessRate, SuccessfulRuns, FailedRuns, TerminationRuns |
Workflow |
TASK_RUNS or DATA_VOLUME |
WorkflowId, WorkflowName, and TaskRuns or DataVolume |
Project |
TASK_RUNS or DATA_VOLUME |
ProjectId, WorkspaceId, ProjectName, and TaskRuns or DataVolume |
Connector |
TASK_RUNS or DATA_VOLUME |
ConnectorName, and TaskRuns or DataVolume |
Workspace |
WORKFLOW_EXECUTIONS (default) |
WorkspaceId, WorkspaceName, WorkflowRuns, SuccessRate, SuccessfulRuns, FailedRuns, TerminationRuns |
Workspace |
TASK_RUNS or DATA_VOLUME |
WorkspaceId, WorkspaceName, and TaskRuns or DataVolume |
SolutionInstance (Embedded only) |
WORKFLOW_EXECUTIONS (default) |
SolutionInstanceId, SolutionInstanceName, WorkflowRuns, SuccessRate, SuccessfulRuns, FailedRuns, TerminationRuns |
SolutionInstance (Embedded only) |
TASK_RUNS or DATA_VOLUME |
SolutionInstanceId, SolutionInstanceName, and TaskRuns or DataVolume |
You cannot use gridType Connector with WORKFLOW_EXECUTIONS.
The response contains SuccessfulRuns, FailedRuns and TerminationRuns only if you set previewMode to false.
Column values
| Column | Value |
|---|---|
WorkflowRuns |
The number of workflow runs. This includes successful, failed, terminated and stopped runs. |
SuccessfulRuns |
The number of successful workflow runs. |
FailedRuns |
The number of failed workflow runs. |
TerminationRuns |
The number of workflow runs that a Terminate step stopped. |
SuccessRate |
The percentage of workflow runs that were successful or terminated, as a whole number. |
TaskRuns |
The number of tasks. |
DataVolume |
The size of the data that the steps processed, in bytes. |
Solution instance table
The SolutionInstance table has one row for each solution instance that had a workflow run in the time period (Embedded only). Use it to see the runs and tasks of each of your end users.
SolutionInstanceName is the name of the end user. If the end user has no name, it is the name of the solution instance. If the solution instance has no name, it is the ID of the solution instance.
This table has two limits:
- The time period can be a maximum of 31 days. If the time period is longer, the response is
400. - Tray answers one request for this table at a time for each organization. This includes requests to Get Table Row Count. If you send a second request before the first request is complete, the response can be
429. Thus, send the requests one after the other. If you get a429, send the request again.
The other tables do not have these limits.
Rows
Each row is an object. The keys are column codes. All values are strings, also for numbers. For example:
{
"WorkflowId": "6a1f0c7e-1d1b-4c55-9d43-0c5f2a8e4b11",
"WorkflowName": "Sync new leads to Slack",
"WorkflowRuns": "1240",
"SuccessRate": "98"
}
Sort order
The default sort order is by name, A to Z. To change the sort order, set orderBy to one column and a direction (Asc or Desc). Use only a column that is in the table. If you use a different column, the response is 400.
The response contains one page of rows. Refer to Pagination. To get the number of rows, use Get Table Row Count.
Request Examples
{
"gridType": "Workflow",
"metricType": "WORKFLOW_EXECUTIONS",
"startPeriod": "2026-10-01T00:00:00Z",
"endPeriod": "2026-10-08T00:00:00Z",
"previewMode": false,
"orderBy": [
{
"column": "FailedRuns",
"direction": "Desc"
}
],
"first": 100
}Response Examples
{
"data": {
"pageInfo": {
"hasPreviousPage": false,
"hasNextPage": true,
"startCursor": "LEFzYywwLDEwMA==",
"endCursor": "LEFzYywxMDAsMTAw",
"orderBy": "Ascending"
},
"rows": [
{
"WorkflowId": "6a1f0c7e-1d1b-4c55-9d43-0c5f2a8e4b11",
"WorkflowName": "Sync new leads to Slack",
"WorkflowRuns": "1240",
"SuccessRate": "98",
"SuccessfulRuns": "1200",
"FailedRuns": "25",
"TerminationRuns": "15"
},
{
"WorkflowId": "b3c2d1e0-5f4a-4b3c-8d2e-1f0a9b8c7d6e",
"WorkflowName": "Nightly invoice export",
"WorkflowRuns": "7",
"SuccessRate": "100",
"SuccessfulRuns": "7",
"FailedRuns": "0",
"TerminationRuns": "0"
}
]
}
}Get Table Columns
Gets the columns of a table from Get Table. Use this endpoint to make the headers of a table in your tool.
Send the same gridType and metricType that you send to Get Table.
nameis the column code. Use this code inorderBy.headerNameis the text for the column header.dataTypetells you how to show the value.hiddenis for ID columns that you do not show.showInPreviewisfalsefor columns that show only whenpreviewModeisfalse.
Request Examples
{
"gridType": "Workflow",
"metricType": "WORKFLOW_EXECUTIONS"
}Response Examples
{
"data": {
"columns": [
{
"headerName": "Workflow",
"name": "WorkflowName",
"dataType": "string",
"showInPreview": true
},
{
"headerName": "Runs",
"name": "WorkflowRuns",
"dataType": "number",
"showInPreview": true
},
{
"headerName": "Success rate",
"name": "SuccessRate",
"dataType": "number",
"unit": "%",
"showInPreview": true
},
{
"headerName": "Failed",
"name": "FailedRuns",
"dataType": "number",
"showInPreview": false
},
{
"headerName": "Workflow ID",
"name": "WorkflowId",
"dataType": "hidden",
"showInPreview": true
}
]
}
}Get Table Row Count
Gets the number of rows in a table from Get Table. Use it to calculate the number of pages.
Send the same gridType, metricType, time period and filters that you send to Get Table.
For gridType SolutionInstance, the limits of the solution instance table apply: a maximum time period of 31 days, and one request at a time. Thus, do not send this request at the same time as the Get Table request.
Request Examples
{
"gridType": "Workflow",
"startPeriod": "2026-10-01T00:00:00Z",
"endPeriod": "2026-10-08T00:00:00Z"
}Response Examples
{
"data": {
"totalCount": 42
}
}Get KPIs
Gets totals for the time period, with the change from the previous time period. These are the KPI cards in the Insights Hub.
Use kpis to select the KPIs. If you do not send kpis, the response contains all the KPIs that you can get. If you send an empty list, the response is empty.
| KPI | Value |
|---|---|
ACTIVE_WORKFLOWS |
The number of workflows that had one or more workflow runs. For Embedded, each solution instance copy of a workflow counts as one workflow. |
TASK_RUNS |
The number of tasks. Refer to Key terms. |
DATA_VOLUME |
The size of the data that the steps processed, in bytes (unit is B). |
SOLUTIONS |
The number of solutions that had one or more workflow runs. Embedded only. |
SOLUTION_INSTANCES |
The number of solution instances that had one or more workflow runs. Embedded only. |
END_USERS |
The number of end users that had one or more workflow runs. Embedded only. |
MCP_CONNECTOR_TOOL_CALLS |
The number of connector operations that AI agents called as MCP tools. |
ACTIVE_WORKFLOW_TOOL_USERS |
The number of Tray users that started a workflow as an MCP tool. |
ACTIVE_CONNECTOR_TOOL_USERS |
The number of Tray users that called a connector operation as an MCP tool. |
You get the Embedded KPIs only if your organization uses Embedded. You get the MCP KPIs only if you set filters.isMcpToolExecution to true.
Percentage change
percentageChange compares the time period with the previous time period of the same length. For example, if your time period is 1 to 8 October, the previous time period is 24 September to 1 October.
The value is a whole number. For example, 25 means an increase of 25%.
- If the two values are 0,
percentageChangeis0. - If the previous value is 0 and the new value is more than 0, the response does not contain
percentageChange.
Request Examples
{
"startPeriod": "2026-10-01T00:00:00Z",
"endPeriod": "2026-10-08T00:00:00Z",
"kpis": [
"ACTIVE_WORKFLOWS",
"TASK_RUNS",
"DATA_VOLUME"
],
"filters": {
"workspaces": [
"0d7e3f6a-8f0c-4e7b-9a55-2f1c9a7b6d21"
]
}
}Response Examples
{
"data": {
"kpis": [
{
"name": "Active Workflows",
"value": 42,
"percentageChange": 5
},
{
"name": "Task Runs",
"value": 182350,
"percentageChange": -12
},
{
"name": "Data Volume",
"value": 734003200,
"unit": "B",
"percentageChange": 3
}
]
}
}Get Time Series
Gets the values of one metric in time intervals, for a chart. Refer to Time intervals for the length of each interval.
Use metric to select the metric:
| Metric | Value in each interval |
|---|---|
WORKFLOW_EXECUTIONS (default) |
The number of workflow runs. |
TASK_RUNS |
The number of tasks. |
DATA_VOLUME |
The size of the data that the steps processed, in bytes. |
END_USERS |
The number of end users that had one or more workflow runs. Embedded only. |
MCP_CONNECTOR_TOOL_CALLS |
The number of connector operations that AI agents called as MCP tools. |
Use breakdown to split the metric into series:
| Breakdown | One series for each |
|---|---|
WORKFLOW (default) |
Workflow. With WORKFLOW_EXECUTIONS, one series for each run result: successful, failed, terminated and stopped. With MCP_CONNECTOR_TOOL_CALLS, one series for successful and one for failed. |
WORKFLOW_NAME |
Workflow. |
PROJECT |
Project. Runs of workflows that are not in a project are not included. |
CONNECTOR |
Connector. All versions of a connector are in one series. You cannot use this breakdown with WORKFLOW_EXECUTIONS. |
CONTEXT_USER |
Tray user that started the MCP tool run. |
END_USERS always has one series. Tray does not use breakdown for this metric.
You cannot use PROJECT or WORKFLOW_NAME with MCP_CONNECTOR_TOOL_CALLS.
Response
- The response contains the 10 series with the largest
totalValue. Tray adds all other series together in one series with the nameOthers. totalValueis the total of the series for the time period.- Each item in
seriesis a pair: the start time of the interval and the value in that interval. Intervals with no data have the value0. - For
END_USERS,totalValueis the sum of the values in all intervals. If one end user has workflow runs in 2 intervals,totalValuecounts this end user 2 times.
To get the response in CSV format, set the Accept header to text/csv.
Request Examples
{
"startPeriod": "2026-10-01T00:00:00Z",
"endPeriod": "2026-10-03T00:00:00Z",
"metric": "TASK_RUNS",
"breakdown": "WORKFLOW_NAME"
}Response Examples
{
"data": {
"timeseries": [
{
"id": "6a1f0c7e-1d1b-4c55-9d43-0c5f2a8e4b11",
"name": "Sync new leads to Slack",
"totalValue": 1350,
"series": [
{
"value": [
"2026-10-01T00:00:00Z",
60
]
},
{
"value": [
"2026-10-01T01:00:00Z",
45
]
}
]
},
{
"id": "Others",
"name": "Others",
"totalValue": 220,
"series": [
{
"value": [
"2026-10-01T00:00:00Z",
10
]
},
{
"value": [
"2026-10-01T01:00:00Z",
8
]
}
]
}
]
}
}List Projects
Gets the projects in the workspaces that you can access. Use the IDs in the projects filter.
The response includes projects that have no workflow runs. It also includes projects that a user deleted in the last 6 months. For these projects, deleted is true.
hasSolution is true if a user made a solution from the project (Embedded only).
To find projects by name, set filters.searchTerm. The search is not case-sensitive and finds part of a name. If you set filters.projects, these projects are first in the response.
Request Examples
{
"filters": {
"searchTerm": "sales"
},
"first": 100
}Response Examples
{
"elements": [
{
"id": "5e0b1a2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
"name": "Sales automation",
"hasSolution": false,
"deleted": false
}
],
"pageInfo": {
"hasPreviousPage": false,
"hasNextPage": false,
"startCursor": "LEFzYywwLDEwMA==",
"endCursor": "LEFzYywxMDAsMTAw",
"orderBy": "Ascending"
}
}List Solution Instances
Gets the solution instances of the solutions that you can access (Embedded only). Use the IDs in the solutionInstances filter.
name is the name of the end user. If the end user has no name, name is the name of the solution instance.
To get only the solution instances of some projects or solutions, set filters.projects or filters.solutions.
The response includes solution instances that a user deleted in the last 6 months. For these solution instances, deleted is true.
Request Examples
{
"filters": {
"solutions": [
"9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d"
]
},
"first": 100
}Response Examples
{
"elements": [
{
"id": "1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"name": "Acme Inc",
"deleted": false
}
],
"pageInfo": {
"hasPreviousPage": false,
"hasNextPage": false,
"startCursor": "LEFzYywwLDEwMA==",
"endCursor": "LEFzYywxMDAsMTAw",
"orderBy": "Ascending"
}
}List Solutions
Gets the solutions in the workspaces that you can access (Embedded only). Use the IDs in the solutions filter.
To get only the solutions of some projects, set filters.projects. To find solutions by name, set filters.searchTerm.
Request Examples
{
"first": 100
}Response Examples
{
"elements": [
{
"id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
"name": "CRM sync"
}
],
"pageInfo": {
"hasPreviousPage": false,
"hasNextPage": false,
"startCursor": "LEFzYywwLDEwMA==",
"endCursor": "LEFzYywxMDAsMTAw",
"orderBy": "Ascending"
}
}List Workflows
Gets the workflows in the workspaces that you can access. Use the IDs in the workflows filter.
To get only the workflows of some workspaces, projects or solutions, set the related filters. To find workflows by name, set filters.searchTerm. If you set filters.workflows, these workflows are first in the response.
The response includes workflows that a user deleted in the last 6 months. For these workflows, deleted is true.
IsEndUserWorkflow is true if the workflow is in a project that has a solution with one or more solution instances.
Workflows of a solution instance
To get the solution instance copies of workflows, set filters.solutionInstances and startPeriod. The response then contains only the copies that had one or more workflow runs in the time period. In this case:
idis the ID of the copy.nameis the name of the source workflow.IsEndUserWorkflowistrue.
If you set filters.solutionInstances without startPeriod, the response is empty.
Request Examples
{
"filters": {
"projects": [
"5e0b1a2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c"
]
},
"first": 100
}Response Examples
{
"elements": [
{
"id": "6a1f0c7e-1d1b-4c55-9d43-0c5f2a8e4b11",
"name": "Sync new leads to Slack",
"IsEndUserWorkflow": false,
"deleted": false
},
{
"id": "b3c2d1e0-5f4a-4b3c-8d2e-1f0a9b8c7d6e",
"name": "Nightly invoice export",
"IsEndUserWorkflow": false,
"deleted": false
}
],
"pageInfo": {
"hasPreviousPage": false,
"hasNextPage": false,
"startCursor": "LEFzYywwLDEwMA==",
"endCursor": "LEFzYywxMDAsMTAw",
"orderBy": "Ascending"
}
}