Insights

Run an Insights segment

Changed on

Runs the segment for the authenticated user and returns immediately with a run reference and its status; it does not wait for the segment run to finish. The run only covers the companies the token's user can access in Silverfin, and never changes the segment's definition.

If a run of this segment is already in progress, no new run is started. The response describes that pending run with the pending payload documented on GET /segments/{id}/results, without its message. Poll that endpoint until it finishes.

If the user's latest run of the segment finished less than 12 hours ago, no new run is started either. The 200 response describes that finished run (status is finished) and carries a message and next_run_allowed_at, the earliest time (ISO 8601) a request can start a new run. A request at that time can still get a 409 at the firm's limit. Fetch the results from GET /segments/{id}/results. Runs started in the Silverfin UI count as well. A change to the segment's filters or period removes the earlier runs, so the next request starts a new run at once.

Otherwise a new execution is created (a 202): there is no run yet, or the latest run was cancelled or finished 12 hours ago or more. The results of that earlier run are discarded.

A firm can have a limited number of runs in progress at the same time; further requests are rejected with a 409 until a run finishes. Runs started from the Silverfin UI count towards that limit. Only the firm's own segments can be run through the API; recommended segments cannot.

This endpoint exists in API v4 only; on the deprecated v3 API it returns a 404.

This endpoint requires a user OAuth token and Insights Premium.<br> <b>Required scope:</b> insights:write

post/api/v4/f/{firm_id}/segments/{id}/runs

Request

  • Base URL
    https://live.getsilverfin.com
  • URL
    https://live.getsilverfin.com/api/v4/f/{firm_id}/segments/{id}/runs
  • Auth
    OAuth 2
    Authorization code: https://live.getsilverfin.com/oauth/authorize
    Token URL: https://live.getsilverfin.com/oauth/token scopes: insights:write

Path parameters

firm_idinteger required
idinteger required

Segment id

Response

A run is in progress, or the latest finished run is less than 12 hours old; no new run is started and that run is described

OR

Example response

{
  "message": "The latest results of this segment are less than 12 hours old, so no new run was started. Fetch them from GET segments/123/results. A new run can start at next_run_allowed_at."
}

Changes