# `Codat.Platform.APIKeys`
[🔗](https://github.com/iamkanishka/codat.git/blob/v1.0.0/lib/codat/platform/api_keys.ex#L1)

Manage Codat API keys programmatically.

You can have up to 10 active keys. The last remaining key cannot be deleted.
Keys are only shown in full at creation time — store them immediately.

# `create`

```elixir
@spec create(Codat.Client.t() | map(), map() | keyword()) ::
  {:ok, map()} | {:error, Codat.Error.t()}
```

Creates a new API key. The full key value is only visible in the response.

## Example

    {:ok, key} = Codat.Platform.APIKeys.create(client, %{name: "Production"})
    key["apiKey"]  # store this immediately!

# `delete`

```elixir
@spec delete(Codat.Client.t() | String.t(), String.t() | keyword()) ::
  {:ok, nil} | {:error, Codat.Error.t()}
```

Deletes an API key by its ID.

## Example

    {:ok, nil} = Codat.Platform.APIKeys.delete(client, "key-id")

# `list`

```elixir
@spec list(
  Codat.Client.t() | keyword(),
  keyword()
) :: {:ok, Codat.Pagination.t()} | {:error, Codat.Error.t()}
```

Lists all API keys for the authenticated account.

## Example

    {:ok, page} = Codat.Platform.APIKeys.list(client)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
