> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecontra.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Application

> Rename an application, rotate its key, or update settings.

## Request

```bash theme={null}
curl -X PATCH https://auth.contra.id/v1/organizations/me/$ORG_ID/applications/$APP_ID \
  -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{ "name": "production-eu", "rotate_api_key": true }'
```

| Body             | Type    | Description                                                          |
| ---------------- | ------- | -------------------------------------------------------------------- |
| `name`           | string  | New display name.                                                    |
| `rotate_api_key` | boolean | `true` → generate a new `api_key` (old one immediately invalidated). |
| `environment`    | enum    | Move between `"live"` and `"test"`.                                  |

## Response · 200

```json theme={null}
{
  "uuid":        "app_5b9c…",
  "api_key":     "ctr_NEW_KEY_HERE",
  "name":        "production-eu",
  "environment": "live"
}
```

<Warning>
  If you rotate the `api_key`, the old one stops working **immediately** — update every deployment before rotating.
</Warning>
