> ## 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 S REST API through sitectl.

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

```bash theme={null}
sitectl omeka-s api get items
sitectl omeka-s api get items 12
sitectl omeka-s api request POST items --identity "$OMEKA_S_KEY_IDENTITY" --credential "$OMEKA_S_KEY_CREDENTIAL" --file item.json
```

API helpers accept:

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

## Reference

### `api get`

GET an Omeka S API resource

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

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

### `api request`

Call an arbitrary Omeka S API path

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

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