> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/developer/rest-api/using-the-rest-api.md).

# Using the REST API

The Roboflow REST API is the authoritative interface to the platform - every feature ships here first, and the [Python SDK](/developer/python-sdk/using-the-python-sdk.md) and [CLI](/developer/command-line-interface/using-the-cli.md) both call it under the hood. Use the REST API directly when you're building a non-Python integration, calling from a webhook or browser, or working in an environment that can't install Python packages.

There are two base hosts to know about:

| Host                              | Used for                                                                                                                                                         |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `https://api.roboflow.com`        | Management - workspaces, projects, versions, training, workflows, datasets, vision events, trash.                                                                |
| `https://serverless.roboflow.com` | Hosted inference - running a trained model or workflow against an image or video. See [Run a Model on an Image](/developer/rest-api/run-a-model-on-an-image.md). |

[Dedicated Deployments](/developer/rest-api/dedicated-deployments.md) are managed at a third host (`https://roboflow.cloud`).

## Resource hierarchy

The Roboflow data model is hierarchical and the API URLs follow the hierarchy:

* `/:workspace` - list projects in a workspace, plus workspace metadata.
* `/:workspace/:project` - a project's metadata and version list.
* `/:workspace/:project/:version` - a specific dataset version, its model (if trained), and download URLs.
* `/:workspace/:project/:version/:format` - download a dataset in a specific [export format](https://roboflow.com/formats).
* `/:workspace/workflows/:workflow` - see [Manage Workflows](/developer/rest-api/manage-workflows.md).
* `/:workspace/groups` - project folders. See [Manage Project Folders](/developer/rest-api/manage-project-folders.md).
* `/:workspace/trash` - soft-deleted projects, versions, and workflows. See [Manage Trash](/developer/rest-api/manage-trash.md).

## Root endpoint

At the top level (`https://api.roboflow.com/`), you can verify your `api_key` is working. The response identifies the workspace your key belongs to:

```bash
curl "https://api.roboflow.com/?api_key=$ROBOFLOW_API_KEY"
```

```json
{
  "welcome": "Welcome to the Roboflow API.",
  "instructions": "You are successfully authenticated.",
  "docs": "https://docs.roboflow.com",
  "workspace": "my-workspace"
}
```

From there, drill into [List Workspaces and Projects](/developer/rest-api/list-workspaces-and-projects.md) to see what's in the workspace.

## Authentication and scopes

API keys are workspace-scoped. Pass the key as a query parameter (`?api_key=...`), in the request body for `POST` calls, or as a `Authorization: Bearer ...` header. See [Authenticate with the REST API](/developer/rest-api/authenticate-with-the-rest-api.md) for details and [Scoped API Keys](/developer/authentication/scoped-api-keys.md) for the per-resource scope reference.

## Errors

The API uses standard HTTP status codes and a JSON error body. See [Errors and Status Codes](/developer/errors-and-status-codes.md) for the cross-tool error reference.
