2026-08-11 11:22:55 -04:00
|
|
|
---
|
|
|
|
|
# Code generated by make gen. DO NOT EDIT.
|
|
|
|
|
title: REST API
|
|
|
|
|
description: "Reference for the Coder REST API, including endpoints, authentication, and schemas."
|
|
|
|
|
icon_path: "./images/icons/api.svg"
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
2025-01-03 18:12:59 +05:00
|
|
|
|
2023-07-13 09:24:09 -04:00
|
|
|
Get started with the Coder API:
|
|
|
|
|
|
|
|
|
|
## Quickstart
|
|
|
|
|
|
|
|
|
|
Generate a token on your Coder deployment by visiting:
|
|
|
|
|
|
2026-07-15 14:07:09 -04:00
|
|
|
````txt
|
2023-07-13 09:24:09 -04:00
|
|
|
https://coder.example.com/settings/tokens
|
2025-01-03 18:12:59 +05:00
|
|
|
````
|
2023-07-13 09:24:09 -04:00
|
|
|
|
|
|
|
|
List your workspaces
|
|
|
|
|
|
2026-07-15 14:07:09 -04:00
|
|
|
````sh
|
2023-07-13 09:24:09 -04:00
|
|
|
# CLI
|
|
|
|
|
curl https://coder.example.com/api/v2/workspaces?q=owner:me \
|
|
|
|
|
-H "Coder-Session-Token: <your-token>"
|
2025-01-03 18:12:59 +05:00
|
|
|
````
|
2023-07-13 09:24:09 -04:00
|
|
|
|
|
|
|
|
## Use cases
|
|
|
|
|
|
2024-10-05 08:52:04 -07:00
|
|
|
See some common [use cases](../../reference/index.md#use-cases) for the REST API.
|
2023-07-13 09:24:09 -04:00
|
|
|
|
2026-08-18 12:54:45 -07:00
|
|
|
## Request size limits
|
|
|
|
|
|
|
|
|
|
An endpoint that accepts a request body reads at most 4 MiB of it, unless it
|
2026-09-11 03:48:56 +02:00
|
|
|
sets a limit of its own.
|
2026-08-18 12:54:45 -07:00
|
|
|
An endpoint that sets its own limit declares `413` in this reference and
|
|
|
|
|
names the limit in the description, so the per-endpoint page is where to look
|
|
|
|
|
one up. A few endpoints answer `413` for a reason other than the size of
|
|
|
|
|
the request body, and their descriptions say so.
|
|
|
|
|
|
|
|
|
|
A body that exceeds the limit that applies to it is answered with
|
|
|
|
|
`413 Payload Too Large`, and the response names the limit it exceeded:
|
|
|
|
|
|
|
|
|
|
````json
|
|
|
|
|
{
|
|
|
|
|
"message": "Request body too large.",
|
|
|
|
|
"detail": "Maximum request body size is 4194304 bytes."
|
|
|
|
|
}
|
|
|
|
|
````
|
|
|
|
|
|
|
|
|
|
The limits are fixed. There is no deployment option that raises them.
|
|
|
|
|
|
2023-07-13 09:24:09 -04:00
|
|
|
## Sections
|
2022-12-19 18:43:46 +01:00
|
|
|
|
|
|
|
|
<children>
|
2024-08-13 18:39:46 +03:00
|
|
|
This page is rendered on https://coder.com/docs/reference/api. Refer to the other documents in the `api/` directory.
|
2022-12-19 18:43:46 +01:00
|
|
|
</children>
|