---
title: "Pre-push check · intentic sandbox API"
description: "The suite that runs before anything leaves the machine. Every route in the pre-push check group of the intentic sandbox API, with its input, its answer and a playground."
url: "https://intentic.dev/api/prepush/"
---

Ship and share

# Pre-push check

The suite that runs before anything leaves the machine

**On this page (3 sections)**

- [How the pre-push check is going](#prepush-state)
- [Run the checks before pushing](#prepush-run)
- [Stop the pre-push check](#prepush-cancel)

Three verbs about one run, because there is one main working tree and so exactly one check. Starting it answers immediately: a suite takes minutes, and a request held open that long dies at the first proxy. Poll for the verdict; the answer names the terminal where it is really happening.

**GET`/prepush/state` How the pre-push check is going**

The verdict, or the progress so far. Nothing is addressed by id here, because there is one working tree and so exactly one check.

### What you send

Nothing. Call it as it is.

### What comes back

| Field | Type |
| --- | --- |
| `status` Where the run is | "idle" | "running" | "passed" | "failed" … (6) |
| `command` What actually ran, echoed here rather… | string |
| `startedAt` When it began, in milliseconds | number |
| `finishedAt` When it ended, in milliseconds | number |
| `exitCode` How the command exited | number |
| `timedOut` It was killed for taking too… | boolean |
| `session` The terminal it runs in, which… | string |
| `output` The end of what it printed,… | string |

Try it answered in this tab

curl

```bash
curl "$SANDBOX/prepush/state" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.prepush.state();
```

**POST`/prepush/run` Run the checks before pushing**

Starts the suite the workspace runs before anything leaves the machine, and answers immediately. A suite takes minutes, and a request held open that long dies at the first proxy. It runs in a real terminal, so watch it there and poll for the verdict.

### What you send

Nothing. Call it as it is.

### What comes back

| Field | Type |
| --- | --- |
| `ok` Always true | true |

Try it answered in this tab

curl

```bash
curl -X POST "$SANDBOX/prepush/run" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.prepush.run();
```

**POST`/prepush/cancel` Stop the pre-push check**

Kills the run. It settles as cancelled and the push it was gating does not go.

### What you send

Nothing. Call it as it is.

### What comes back

| Field | Type |
| --- | --- |
| `ok` Always true | true |

Try it answered in this tab

curl

```bash
curl -X POST "$SANDBOX/prepush/cancel" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.prepush.cancel();
```

More in Ship and share

[Previous ← Pipelines](https://intentic.dev/api/ci/)[Next Outbox →](https://intentic.dev/api/public/)
