> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# guild api

> Call any Guild REST API endpoint directly.

Call any Guild REST API endpoint directly. `guild api` is an authenticated escape hatch that mirrors `guild session get` and acts as a CLI counterpart to the MCP data tools. Use it to reach endpoints that do not have a dedicated command yet.

```bash theme={null}
guild api GET /me                            # Retrieve your user details
guild api GET /workspaces                    # List your workspaces
guild api POST /workspaces --data '{"name":"demo"}'  # Send a JSON request body
```

The command validates your session token, checks the HTTP method, and parses any `--data` JSON before calling the Guild REST API. It prints the raw JSON response to stdout.

| Argument   | Description                                                     |
| ---------- | --------------------------------------------------------------- |
| `<method>` | HTTP method. One of `GET`, `POST`, `PATCH`, `PUT`, or `DELETE`. |
| `<path>`   | API endpoint path, such as `/me` or `/workspaces`.              |

| Option          | Description                    |
| --------------- | ------------------------------ |
| `--data <json>` | Request body as a JSON string. |
