Skip to main content
An organization API key is the key your application sends in the Authorization: Bearer header. This page covers routine replacement. Create the new key, prove it works, move the application, then revoke the old key. Your application keeps working the whole time, and the old key stops working only when you revoke it. Goal: Replace a Millwork API key without interrupting the application. You are done when: the application uses the new key and the old key returns 401.
For routine replacement, keep the old key until the new one works. If the key may be exposed, follow the exposure steps first. Never paste either key into support, source control, logs, or documentation.

Before you begin

Set MILLWORK_API_URL and MILLWORK_API_KEY as shown in Make your first API call.
1

Find the old key

Use the displayed prefix (key_prefix) to identify the key. The list never returns the full key. Millwork cannot show a key again after it is created.
2

Create and test the replacement

Expected result: the command exits without an error (200). A 401 means the new key was not accepted, most often because the value in NEW_MILLWORK_API_KEY is not the new key; do not continue to the next step.The full replacement key appears once, in this response. Store it in the application’s secret manager, update the application, and confirm the application works. Reading the model catalog is a safe test of a key: it is not a run, so it has no platform fee.
3

Revoke the old key

Expected result: the old key is revoked. A request using it returns 401.Revoking an organization key does not change your provider keys. Replace those separately with Replace a provider key.

If it fails