API keys are created and managed in the dashboard. They are used to authenticate requests from the Blocks CLI and are scoped to a specific workspace.

Install the CLI:

pip install blocks-sdk

Configure an API key when initializing:

blocks init --key <api-key>

Manually configure an API key:

blocks configure --key <api-key>

Or simply blocks configure for an interactive experience.

Expiry

API keys can be assigned a TTL (time-to-live), or never expire unless manually deleted. Expired keys will automatically be deleted. You can manually delete or rename an existing API key at any time, however you cannot modify an existing API key’s TTL. An API key must be valid to register or update an automation from the CLI. Once an automation is registered, API key validity does not affect an automation’s execution.