> ## Documentation Index
> Fetch the complete documentation index at: https://libops-renovate-github-com-libops-sitectl-0-x.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> Call the Omeka Classic REST API through sitectl.

Omeka Classic exposes a REST API rather than a standalone administration CLI. sitectl provides direct API helpers and resource shortcuts:

```bash theme={null}
sitectl omeka-classic api get items
sitectl omeka-classic api get items 12
sitectl omeka-classic api request POST items --key "$OMEKA_CLASSIC_API_KEY" --file item.json
```

API helpers accept:

* `--url` for the base API URL, defaulting to `http://localhost/api`
* `--key` for the Omeka Classic API key
* `--query name=value` for repeated query parameters
* `--data` or `--file` for JSON request bodies on arbitrary requests

## Reference

### `api get`

GET an Omeka Classic API resource

```bash theme={null}
sitectl omeka-classic api get RESOURCE [ID]
```

| Flag          | Default                | Description                                                |
| ------------- | ---------------------- | ---------------------------------------------------------- |
| `--key`       |                        | Omeka Classic API key.                                     |
| `-q, --query` | `[]`                   | Additional query parameter as name=value. May be repeated. |
| `--url`       | `http://localhost/api` | Base Omeka Classic API URL.                                |

### `api request`

Call an arbitrary Omeka Classic API path

```bash theme={null}
sitectl omeka-classic api request METHOD PATH
```

| Flag          | Default                | Description                                                |
| ------------- | ---------------------- | ---------------------------------------------------------- |
| `--data`      |                        | JSON request body.                                         |
| `--file`      |                        | Path to a JSON request body file.                          |
| `--key`       |                        | Omeka Classic API key.                                     |
| `-q, --query` | `[]`                   | Additional query parameter as name=value. May be repeated. |
| `--url`       | `http://localhost/api` | Base Omeka Classic API URL.                                |
