# Api Key

> > This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

# Api Key

> This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

Creates an API key scoped to the formation's project and optionally restricted by a set of policies. The key is owned by the caller who deployed the formation, exactly as one created through the API is, so it never carries more access than they already have.

## Syntax

```yaml
type: api_key
properties:
  name: String
  policy_ids: String[]
```

## Output

The physical resource ID is the **public ID** of the created resource. Reference it from other resources with a `ref` expression:

```yaml
      some_field:
        ref: MyApiKey
```

## Properties

**`name`**

Human-readable label for the API key

_Required_: Yes
_Type_: String

---

**`policy_ids`**

Optional list of policy public IDs that further restrict the key's permissions

_Required_: No
_Type_: Array of String

---
