Poll Executions

Poll for new file executions that Stedi has recently processed.

GET/polling/executions

This endpoint returns file executions that Stedi processed after the specified startDateTime.

Executions are ordered from oldest to newest according to the processedAt property. This is exclusive of the startDateTime. For example, if the provided startDateTime is 2023-08-10T18:00:00Z, an execution processed at exactly that time would not be included in the results. There is also a fifteen-second window where newly created executions are excluded, meaning Stedi returns results up to fifteen seconds before the time of your request. This functionality accounts for any network latency or clock drift within the systems to ensure you don't miss any executions.

Polling with page tokens

We don't recommend polling using startDateTime only. Due to the exclusive nature of startDateTime, you could potentially miss an execution if two executions occur at the exact same time and are on the edge of a pagination. Instead, you should use pageToken.

After the initial request, you can poll again immediately using pageToken to continue iterating through the pages of executions. The endpoint always returns a nextPageToken, regardless of whether additional executions match the request criteria. If the items array is empty, continue using the provided nextPageToken to poll for new executions. New executions will be returned when available.

We recommend storing pageToken values as part of your polling process. They don't expire, allowing you to start from that point in the execution stream again if you need to catch a system up to date or recover from a failure.

Note that pageToken values are unique per request, opaque, and shouldn't be parsed or modified in any way. They are not guaranteed to be in any particular format, and may change in the future.

Authorization
RequiredHeader

A Stedi API Key for authentication.

Query Parameters

pageSize
NumberRange: ≥ 1

The maximum number of elements to return in a page. You can set this to a maximum of 500 elements. If not specified, the default is 100.

pageToken
StringLength: 1 - 1024

A token returned by a previous call to this operation in the nextPageToken. If not specified, Stedi returns the first page of results.

You must supply either this property or startDateTime in every request.

startDateTime
StringFormat: date-time

An ISO 8601 formatted string. For example 2023-08-28T00:00:00Z. Stedi returns executions processed after this time.

You must supply either this property or pageToken in every request. The startDateTime must be at least one minute in the past.

Response

application/json

ListPollingExecutions 200 response

nextPageToken
StringLength: 1 - 1024

Token for pagination to retrieve the next page of results; null if there are no more results

items
Array of ObjectsRequired

The processed executions that match the request criteria. The items array is empty if there are no matching executions.

Array item
createdAt
items[].createdAt
StringRequiredFormat: date-time

The date and time when the resource was created, in ISO 8601 format. For example, 2023-08-28T00:00:00Z.

updatedAt
items[].updatedAt
StringRequiredFormat: date-time

The date and time when the resource was last updated, in ISO 8601 format. For example, 2023-08-28T00:00:00Z.

executionId
items[].executionId
StringRequired

A unique identifier for the processed file within Stedi. This ID is included in the transaction processed event. You can also retrieve it manually from the file's details page in the Stedi portal.

status
items[].status
StringRequired

The status of the execution. An execution is COMPLETED when Stedi has finished processing the file with no errors. If the file is an outbound file, a COMPLETED status also means that Stedi successfully delivered it to the configured connection.

Possible values
COMPLETED
PARTIALLY_COMPLETED
FAILED
IGNORED
IN_PROGRESS
direction
items[].direction
StringRequired

The direction of the transaction. Inbound transactions are those you receive from a payer, provider, or other trading partner. Outbound transactions are those you send to a payer, provider, or other trading partner.

Possible values
INBOUND
OUTBOUND
UNKNOWN
transactionCount
items[].transactionCount
Number

The number of individual transactions included in the file.

faultCount
items[].faultCount
Number

The number of errors that occurred during processing. If the file was successfully processed completely, this value is 0.

faultCode
items[].faultCode
String

A code specifying the reason for the fault.

Possible values
DELIVERY_FAILURE
FAILED_TO_EXTRACT_BUSINESS_IDENTIFIERS
FAILED_TO_FIND_GUIDE
FAILED_TO_FIND_LOCAL_PROFILE
FAILED_TO_FIND_PARTNER_PROFILE
faultMessage
items[].faultMessage
String

A message providing more information about the fault. Note that if there are multiple faults, Stedi sets the first fault as the code and corresponding message.

fileType
items[].fileType
String

The file format. For example, EDI/EDIFACT for an EDIFACT file or EDI/X12 for an X12 EDI file.

Possible values
CSV
EDI/EDIFACT
FILEPART
JSON
PSV
retryable
items[].retryable
Boolean

If true, you can retry the file in the Stedi portal.

parentExecutionId
items[].parentExecutionId
String

The ID of this execution's parent execution, if it is part of a retry chain. When you retry a file, Stedi creates a child execution with a new ID and links it to the original (parent) execution.

childExecutionId
items[].childExecutionId
String

The ID of this execution's child execution, if it is part of a retry chain. When you retry a file, Stedi creates a child execution with a new ID and links it to the original (parent) execution.

partnershipId
items[].partnershipId
StringRegex pattern: ^([a-zA-Z0-9._-]+)$Length: 1 - 81

The unique identifier for the partnership within the Stedi platform.

A partnership describes all aspects of the EDI relationship between two profiles in your Stedi account, such as which transaction sets they will exchange and other important information for processing EDI files.

connectionType
items[].connectionType
String

The type of connection used for exchanging files.

Possible values
bucket
remote-ftp
stedi-ftp
as2
connectionId
items[].connectionId
StringRegex pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$

An autogenerated identifier for the connection within the Stedi platform.

source
items[].source
Object

The source of the file, including the directory where Stedi received it and the file name.

Show attributes
dirname
items[].source.dirname
StringRequired

The directory where Stedi received the file for processing.

name
items[].source.name
StringRequired

The name of the file.