# API Collections (CLI)

Source: https://www.observeone.com/docs/cli/api-collections

- [Docs](/docs)
- [CLI](/docs/cli)
- API Collections (CLI)

# API Collections (CLI)

Copy Markdown

Manage API collections from the obs CLI. Reusable base URL and default headers shared by API checks, with {{KEY}} references resolved server-side.

Manage API collections: reusable base URL + default-headers groups shared by
API checks. A check in a collection inherits its base URL and default
headers, so rotating a token or moving hosts is one edit instead of one per
check.

Copy

obs api-collection create --name "Payments API" --base-url https://api.example.com \

 --header "Authorization=Bearer {{TOKEN}}"

obs api-collection list

obs api-collection get <id>

obs api-collection update <id> --base-url https://api-v2.example.com

obs api-collection delete <id> -y

obs api-collection create --name "Payments API" --base-url https://api.example.com \

 --header "Authorization=Bearer {{TOKEN}}"

obs api-collection list

obs api-collection get <id>

obs api-collection update <id> --base-url https://api-v2.example.com

obs api-collection delete <id> -y

Alias: obs collection.

Create/update flags: -n, --name, --base-url, --header <KEY=VALUE>
(repeatable). --base-url may contain {{KEY}} references resolved
server-side. An update that omits --header leaves existing headers
untouched.

--file <path> create and obs schema api-collection are available,
matching the other resource commands.

See also: [API Checks](/docs/cli/api-checks) for the checks a collection
groups, and the [CLI reference overview](/docs/cli/reference).

Was this page helpful?
