Coffrify.Resources.ApiKeys (Coffrify v0.9.0)

View Source

API keys — cof_* strings used to authenticate Coffrify API requests.

Summary

Functions

Create a new API key. The returned key is shown ONCE — store it securely. Ultra plan required for allowed_ips, expires_in_days, max_uses.

Get the details of an API key (last activity, allowed IPs, …).

List every API key in the workspace.

Revoke an API key.

Rotate an API key. Returns a NEW key value; the old one stays valid for grace_days (default 7, max 30).

Patch an API key (name, description, is_active, allowed_ips).

Functions

create(client, opts)

@spec create(Coffrify.t(), map() | keyword()) ::
  {:ok, map()} | {:error, Exception.t()}

Create a new API key. The returned key is shown ONCE — store it securely. Ultra plan required for allowed_ips, expires_in_days, max_uses.

get(client, id)

@spec get(Coffrify.t(), String.t()) :: {:ok, map()} | {:error, Exception.t()}

Get the details of an API key (last activity, allowed IPs, …).

list(client)

@spec list(Coffrify.t()) :: {:ok, map()} | {:error, Exception.t()}

List every API key in the workspace.

revoke(client, id, opts \\ [])

@spec revoke(Coffrify.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Exception.t()}

Revoke an API key.

rotate(client, id, opts \\ [])

@spec rotate(Coffrify.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Exception.t()}

Rotate an API key. Returns a NEW key value; the old one stays valid for grace_days (default 7, max 30).

update(client, id, updates)

@spec update(Coffrify.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Exception.t()}

Patch an API key (name, description, is_active, allowed_ips).