|
| 1 | +--- |
| 2 | +title: "API keys" |
| 3 | +linkTitle: "API keys" |
| 4 | +weight: 50 |
| 5 | +layout: "docs" |
| 6 | +type: "docs" |
| 7 | +description: "Run control logic on a machine." |
| 8 | +images: ["/general/code.png"] |
| 9 | +date: "2024-01-13" |
| 10 | +--- |
| 11 | + |
| 12 | +API keys grant access to organizations, locations, and machines. |
| 13 | + |
| 14 | +To view all API keys in use for your organization and the locations and machines inside it, click on the organization dropdown in the top navigation bar and click on **Settings**. |
| 15 | + |
| 16 | +{{<imgproc src="/fleet/api-keys.png" resize="700x" declaredimensions=true alt="API Keys table">}} |
| 17 | + |
| 18 | +## Add an API key |
| 19 | + |
| 20 | +On your organization's page, click **Generate key** to generate a new key. |
| 21 | +Optionally, give the key a name. |
| 22 | +Click on the **Resource** menu and choose what organization, location, or machine you want the key to grant access to. |
| 23 | +If you select organization, your key grants access to all locations and machines contained within that organization. |
| 24 | +If you select location, your key grants access to all of the machines contained within that location. |
| 25 | + |
| 26 | +For **Role**, assign either an **Owner** or **Operator** role. |
| 27 | +See [Permissions](/manage/manage/rbac/) for information about the privilege each role entails at each resource level. |
| 28 | + |
| 29 | +## Change an API key's access |
| 30 | + |
| 31 | +To edit an API key, click on **Show details** in the key's row of the key table's **Resources** column. |
| 32 | + |
| 33 | +{{<imgproc src="/fleet/additional-details.png" resize="700x" declaredimensions=true alt="Additional details for a key">}} |
| 34 | + |
| 35 | +To edit the role, click on the dropdown menu next to the role and select **Owner** or **Operator**. |
| 36 | +See [Permissions](#permissions) for information about the privilege each role entails at each resource level. |
| 37 | + |
| 38 | +To change the entities it is able to access, click **+ Grant additional access**. |
| 39 | +Select which organization, location, or machine you want the key to grant access to. |
| 40 | +Click **Choose** to confirm your selection. |
| 41 | + |
0 commit comments