# List routines

URL: https://code.ml.ai/docs/reference/api/list-routines

> GET /api/routines lists your ML AI Code routines with their id, name, trigger, on or off state and the last run state. Example and responses.

```http
GET https://code.ml.ai/api/routines
```

Lists your routines with their id, name, trigger, whether they are on, and the last run state. Use an id from this list to [start a routine](/docs/reference/api/run-routine).

## Request

| Part | Value |
| --- | --- |
| `Authorization` header | `Bearer mlai_sk_...`. Required. |

## Example

```sh
curl https://code.ml.ai/api/routines \
  -H "Authorization: Bearer mlai_sk_..."
```

## Responses

| HTTP status | Meaning |
| --- | --- |
| 200 | The body has a `routines` list. |
| 401 | No API key, or the key is wrong or revoked. |