Skip to main content
POST
/
v2
/
workflow-runs
/
search
Search Workflow Runs
curl --request POST \
  --url https://public.api.serval.com/v2/workflow-runs/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "teamId": "<string>",
  "workflowId": "<string>",
  "statuses": [
    "WORKFLOW_RUN_STATUS_UNSPECIFIED"
  ],
  "targetUserId": "<string>",
  "initiatedByUserId": "<string>",
  "createdAfter": "<string>",
  "createdBefore": "<string>",
  "linkedTicketId": "<string>",
  "pageSize": 123,
  "pageToken": "<string>"
}
'
{
  "data": [
    {
      "id": "<string>",
      "workflowId": "<string>",
      "teamId": "<string>",
      "status": "WORKFLOW_RUN_STATUS_UNSPECIFIED",
      "createdAt": "<string>",
      "completedAt": "<string>",
      "initiatedByUserId": "<string>",
      "targetUserId": "<string>",
      "inputs": "<string>",
      "output": "<string>",
      "linkedTicketId": "<string>",
      "approvalRequestId": "<string>"
    }
  ],
  "nextPageToken": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
teamId
string

The ID of the team. Required.

workflowId
string | null

Filter by workflow ID.

statuses
enum<string>[]

Filter by statuses (multiple allowed).

Available options:
WORKFLOW_RUN_STATUS_UNSPECIFIED,
WORKFLOW_RUN_STATUS_PENDING,
WORKFLOW_RUN_STATUS_RUNNING,
WORKFLOW_RUN_STATUS_COMPLETED,
WORKFLOW_RUN_STATUS_FAILED,
WORKFLOW_RUN_STATUS_DENIED,
WORKFLOW_RUN_STATUS_CANCELED
targetUserId
string | null

Filter by the target user for the workflow run.

initiatedByUserId
string | null

Filter by the user who initiated the workflow run.

createdAfter
string | null

Filter by runs created after this timestamp (RFC3339 format).

createdBefore
string | null

Filter by runs created before this timestamp (RFC3339 format).

linkedTicketId
string | null

Filter by linked ticket ID.

pageSize
integer<int32> | null

Maximum number of results to return. Default is 1000, maximum is 5000.

pageToken
string | null

Token for pagination. Leave empty for the first request.

Response

Success

data
WorkflowRun · object[]

The list of workflow runs.

nextPageToken
string | null

Token for retrieving the next page of results. Empty if no more results.