Skip to main content
An investigation is a case that Squasher works on: a question, a status, a suspected cause, a confidence, and a timeline. While Squasher investigates, it can propose an action, such as a fix pull request. A person approves or rejects each action.

Operations

Project members can start, steer, and cancel investigations. Only an owner or admin can approve, reject, or resolve an action, and only with a signed-in user token: the dashboard, or the CLI after squasher login. The API refuses API keys for these three operations, even a key with the actions:approve scope. The decision records your user id.

Start an investigation

The body has a question, a subject, or both:
The response has status 201, created: true, and the new investigation. An incident has one investigation. When the subject is an incident that already has one, the response has status 200, created: false, and the existing investigation. A repeated idempotency_key also returns 200.
The example leaves out some fields. confidence is a number from 0 to 100. time_to_diagnosis_seconds is the time from the start to the first diagnosis. thread_id is the chat that is linked to the investigation.

List investigations

The response is { "investigations": [...], "total", "limit", "offset" }.

Read an investigation

The response has investigation, entries, and actions. Each timeline entry has a sequence number, a kind, an actor, and a payload. The kinds are hypothesis, evidence, action, note, redirect, and status. Add after_sequence=<n> to get only the entries after entry n. Add include_actions=false to leave out the action proposals (actions is empty) when you poll; read them with actions.list.

Add a note, steer, or cancel

  • notes adds a note to the timeline. The body is { "text" }. The response has status 201 and the new entry in entry.
  • redirect records the direction, and Squasher continues the investigation in that direction. This also works after a diagnosis. The body is { "text" }. The response has status 202.
  • cancel stops an active investigation. The body is optional: { "reason" }.
Text is at most 4,000 characters. A reason is at most 2,000 characters.

List actions

You can filter by status, investigation_id, and incident_id, and set limit (1 to 100, default 50). The statuses are proposed, approved, executing, unknown, succeeded, failed, expired, and rejected. unknown means Squasher sent the call but did not see the result. Squasher does not run the action again; it reads the provider to settle the result.
The example leaves out some fields. See Investigations for the actions and their targets.

Approve or reject an action

Approve runs the action at once. Squasher checks the precondition, calls the provider one time, and checks the postcondition. The response has the action with its final status, precondition, and postcondition. Reject uses the same body at /reject. The reason is optional. When the result is unknown, settle it at /resolve. Squasher reads the provider first. When the provider cannot tell, send your finding after you check the provider:
outcome is succeeded or failed. note is optional. When the provider cannot tell and you send no outcome, the response has status 409.

Errors

TypeScript client and CLI

squasher actions approve and squasher actions reject ask you to confirm. Add --yes to skip the prompt.