Skip to main content
POST
Restart a published service

Authorizations

Authorization
string
header
required

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.

Headers

Idempotency-Key
string

A caller-generated key for safely retrying this side effect. The server retains the key and response for 24 hours. Reusing it with the same request replays the original response, except after a failure that proves nothing happened: that is kept for one minute, and one that sets Retry-After is not kept, so a retry after it runs the request again; reusing it with different input returns 409.

Required string length: 1 - 128
Pattern: ^[!-~]+$
Example:

"req_01J6M6Y9TF9Q9QF6M1ZP8K4R2A"

Path Parameters

id
string
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.

Minimum string length: 1
Example:

"agent-atlas"

Response

The restarted service and current process state.

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.

restarts
integer
required

How often the program was started again after a crash since the service was last started.

Required range: x >= 0
url
string<uri>
command
string
cwd
string
port
integer

Absent for a program that serves no port.

Required range: 1 <= x <= 65535
exec_id
string
pid
integer
Required range: x >= 1
started_at
string<date-time>
ended_at
string<date-time>
exit_code
integer
signal
string
last_exit
object

The last crash it was restarted after.

last_output
string

The program's last line of output, while it is not ready.

logs
object