---
title: "Stop an async exec"
method: DELETE
path: "/v1/briqs/{id}/execs/{execId}"
tags: ["briqs"]
---

# Stop an async exec

`DELETE /v1/briqs/{id}/execs/{execId}`

## Request

- Base URL: `https://api.briq.cloud`
- URL: `https://api.briq.cloud/v1/briqs/{id}/execs/{execId}`
- Auth: HTTP bearer

Stops the command and every process it started. A finished one is answered as it is.

## Path parameters

- `id` string, required
- `execId` string, required

## Response `200`

ok

- ExecCheck
  - `exec` Exec, required
    - `id` string, required
    - `briqId` string, required
    - `cmd` string[], required
    - `state` 'running' | 'exited' | 'timed_out' | 'stopped' | 'lost', required: running until it ends: exited (by itself, see exitCode), timed_out (stopped at deadlineAt), stopped (on request), lost (the machine restarted without it)
    - `exitCode` number, nullable, required
    - `startedAt` string, required
    - `deadlineAt` string, required
    - `finishedAt` string, nullable, required
    - `outputDir` string, required: Where the whole output is, in the briq: files out and err
    - `briqRunning` boolean, required: False when the briq is not running: the state is the last one seen, and output is absent until it starts
    - `output` object: The last 64 KB of each stream and their whole sizes; absent when the briq is not running
      - `stdout` string, required
      - `stderr` string, required
      - `stdoutBytes` number, required
      - `stderrBytes` number, required
  - `costLine` string, required

## Other responses

- `400`: validation
- `401`: unauthorized
- `402`: policy_violation or quota_exceeded (the key's policy), or payment_required (no credits: retrying cannot help)
- `403`: forbidden, or plan_limit (the team's plan does not allow it)
- `404`: not found
- `409`: invalid_state: not possible in the briq's current state; the message says why
- `413`: validation: the body, the command or its output is too large
- `429`: rate limited: retry after the `retry-after` header
- `502`: provider_error: the infrastructure refused the change
- `503`: provider_error: the infrastructure did not answer; retry in a moment

---

[API](https://skmtc.dev/briq/apis/briq-api.md) · [All operations](https://skmtc.dev/briq/apis/briq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/briq/apis/briq-api/revisions/609b424459cb?raw)
