# OpenAPI specifications

The contract of each API is one OpenAPI 3.1 document, served as JSON and as YAML. Import it into a tool, generate a client from it, or diff it between releases.

**REST API · v1**

- Server: https://rest.watchtower15.com/v1
- Fingerprint (`info.version`): 1.0.0+sha.7d61644b8985
- Operations: 195
- Size (JSON): 3.6 MB
- SHA-256 (JSON): 8226ecafb7435e75e13c93ffdc07178107b40f897774a550feeb4553fd628124

**Metric and log ingest**

- Server: https://api.watchtower15.com
- Fingerprint (`info.version`): 1.0.0+sha.70713b6f3cef
- Operations: 3
- Size (JSON): 47.4 KB
- SHA-256 (JSON): 367b153e5475ed5d44e66d1af5a716c9aec49aeb5c312a44168a425c01bdee90

## The fingerprint

Each document’s `info.version` is a fingerprint of its content: it changes exactly when the contract changes, and never otherwise. A client can pin it, and a pipeline can fail when it moves. Within `v1` the contract only grows, apart from the removals the owner decided, which [versioning](https://developer.watchtower15.com/api/versioning/) lists.

## Importing into a tool

Give a tool the URL rather than a downloaded copy, so it follows each release. The documents answer any origin (`Access-Control-Allow-Origin: *`) and may be cached for 5 minutes, so a browser-based tool can read them too. The API itself sends no CORS headers: a key never belongs in a web page.

## The Postman collection

The whole API is also one Postman collection, generated from the two documents above by Postman’s own converter, with an environment that holds the base URLs and the three credentials. It is a Collection v2.1.0 file, which Newman runs as well.

**Collection · Postman v2.1.0**

- Requests: 198
- REST API fingerprint (`specFingerprintV1`): 1.0.0+sha.7d61644b8985
- Ingest API fingerprint (`specFingerprintIngest`): 1.0.0+sha.70713b6f3cef
- Size: 1.5 MB
- SHA-256: 7c8b5ca91fe9e754cdcfb090b55d1f752063ad4a6d0f8d3e028b3dca8425686f

**Environment · WatchTower15**

- Size: 0.7 KB
- SHA-256: 5b1b5851592e159ff7a45634a14f54976af4084411599eab27eb87dbb5420565

1.  In Postman choose **Import**, and paste `https://developer.watchtower15.com/postman/watchtower15.postman_collection.json`.
2.  Choose **Import** again, and paste `https://developer.watchtower15.com/postman/watchtower15.postman_environment.json`.
3.  Select the *WatchTower15* environment, and put your API key in `apiKey`. `metricsToken` and `logsToken` are needed only for the *MetricsIngest* and *LogsIngest* folders. All three are secret-typed. See [Authentication and keys](https://developer.watchtower15.com/api/authentication/).

The collection’s fingerprints name the OpenAPI documents it came from, and a new version keeps the collection’s id. Postman can also import the OpenAPI links above directly.

**Download and check**

```bash
curl -sO https://developer.watchtower15.com/openapi/v1.json
sha256sum v1.json
jq -r '.info.version' v1.json
```

**Response headers (200 OK)**

```http
HTTP/2 200
content-type: application/json
cache-control: public, max-age=300
access-control-allow-origin: *
```

Source: https://developer.watchtower15.com/specs/
