Reporting

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:

  • startPeriod is necessary. Tray includes data from this time.
  • endPeriod is optional. Tray includes data up to this time, but not data at this time. If you do not set endPeriod, 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.

  1. Set first to the page size.
  2. Read pageInfo in the response. If hasNextPage is true, send the same request again. Set after to the value of pageInfo.endCursor.
  3. Do step 2 again until hasNextPage is false.

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

This endpoint is non-billable.

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 a 429, 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.

Get Table Columns

This endpoint is non-billable.

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.

  • name is the column code. Use this code in orderBy.
  • headerName is the text for the column header.
  • dataType tells you how to show the value. hidden is for ID columns that you do not show.
  • showInPreview is false for columns that show only when previewMode is false.

Get Table Row Count

This endpoint is non-billable.

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.

Get KPIs

This endpoint is non-billable.

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, percentageChange is 0.
  • If the previous value is 0 and the new value is more than 0, the response does not contain percentageChange.

Get Time Series

This endpoint is non-billable.

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 name Others.
  • totalValue is the total of the series for the time period.
  • Each item in series is a pair: the start time of the interval and the value in that interval. Intervals with no data have the value 0.
  • For END_USERS, totalValue is the sum of the values in all intervals. If one end user has workflow runs in 2 intervals, totalValue counts this end user 2 times.

To get the response in CSV format, set the Accept header to text/csv.

List Projects

This endpoint is non-billable.

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.

List Solution Instances

This endpoint is non-billable.

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.

List Solutions

This endpoint is non-billable.

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.

List Workflows

This endpoint is non-billable.

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:

  • id is the ID of the copy.
  • name is the name of the source workflow.
  • IsEndUserWorkflow is true.

If you set filters.solutionInstances without startPeriod, the response is empty.

Was this page helpful?