---
title: "Stop a service"
description: "Stops the configured service and keeps its configuration, so restart starts it again."
canonical: "https://www.cool.computer/docs/api-reference/services/stop-a-service"
---
# Stop a service

> Stops the configured service and keeps its configuration, so restart starts it again.

```http
POST https://api.cool.computer/api/computers/{id}/service/stop
```

Stops the configured service and keeps its configuration, so restart starts it again. Callers: an account bearer, or the computer's own runtime token (which `cool` uses inside the VM) for this computer.

## Authorization

- A Cool Computers API key, user access token, or claimed agent access token in the Authorization header. Follow https://www.cool.computer/auth.md for agent registration and https://www.cool.computer/authentication.md for direct user credentials.

## Parameters

- `id` (path, string, at least 1 characters, required): The computer's name, such as agent-atlas, or its id (cmp_…). Every caller may use either, the computer's own runtime token included.

## Responses

- `200`: The stopped service.
  - `application/json` (object)
    - `configured` (boolean, required)
    - `status` (string, required): unconfigured; starting (the program runs but is not ready yet); running (ready); restarting (waiting to start the program again after a crash); stopped; exited (the program ended with code 0); failed; unknown or unavailable when the VM cannot say; or the computer's status while it is not running.
    - `ready` (boolean, required): With a port, the port accepts connections; without one, the program has stayed up 5 s.
    - `url` (string, uri)
    - `command` (string)
    - `cwd` (string)
    - `port` (integer, 1 to 65535): Absent for a program that serves no port.
    - `exec_id` (string)
    - `pid` (integer, at least 1)
    - `started_at` (string, date-time)
    - `ended_at` (string, date-time)
    - `exit_code` (integer)
    - `signal` (string)
    - `restarts` (integer, at least 0, required): How often the program was started again after a crash since the service was last started.
    - `last_exit` (object): The last crash it was restarted after.
      - `code` (integer, required)
      - `at` (string, date-time, required)
    - `last_output` (string): The program's last line of output, while it is not ready.
    - `logs` (object)
      - `retention` ("disk_ring", required)
      - `bytes_written` (integer, int64, at least 0, required)
      - `bytes_dropped` (integer, int64, at least 0, required)
      - `dropped_frames` (integer, at least 0, required)
      - `next_id` (integer, int64, at least 0, required)
- `400`: Bad Request.
- `401`: Unauthorized.
- `402`: Payment Required. `pro_required`: VMs need Pro; start Pro with cool billing upgrade, or fix a lapsed subscription with cool billing portal, or use the Account page.
- `403`: Forbidden.
- `404`: Not Found. `computer_not_found`: the computer does not exist or is not yours.
- `409`: Conflict.
- `429`: Too Many Requests. If the problem code is api_request_rate_exceeded, wait for Retry-After seconds; other problem codes describe a separate limit.
- `500`: Internal Server Error.
- `503`: Service Unavailable. `computer_starting` means the computer is starting, or stopped and being started again; wait for Retry-After seconds, then retry. Otherwise inspect the problem code and resolution.
- `default`: A machine-readable API error with a stable code and recovery instruction.

An error is an `application/problem+json` document with a stable `code`; [API errors](/docs/api-reference/errors) says how to handle one.

## Example

```sh
curl -X POST "https://api.cool.computer/api/computers/$PARAM_ID/service/stop" \
  -H "authorization: Bearer $TOKEN"
```
