API Keys

Authenticate in CI and headless environments with API keys.

Last updated October 20, 2018

API keys are for non-interactive use: CI pipelines, scheduled jobs, and scripts where a browser login isn't possible.

Creating a key

Create an API key in the dashboard. Keys are random bearer tokens that start with wpk_ followed by 40 hex characters. Weavori stores only a one-way hash of the key server-side, so the plaintext value is shown exactly once, at creation.

Using a key

Pass it with the --api-key flag:

$weavori generate --api-key wpk_0123456789abcdef0123456789abcdef0123 postgres://...

Or set the WEAVORI_API_KEY environment variable:

$export WEAVORI_API_KEY=wpk_0123456789abcdef0123456789abcdef0123

The environment variable is the preferred form for CI — it keeps the key out of command history and shell logs.

In CI

- run: weavori generate "$DATABASE_URL" --target "$TARGET_DB" --output plain
  env:
    WEAVORI_API_KEY: ${{ secrets.WEAVORI_API_KEY }}

Use --output plain for timestamped, CI-friendly log lines.

Security

  • Treat API keys like passwords — never commit them to source control.
  • Store them in your CI provider's secret store.
  • Rotate by deleting the old key in the dashboard and creating a new one.