Skip to content

Commit

Permalink
API access: Add clarifying notes (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: bstuder99 <[email protected]>
  • Loading branch information
biancaburtoiu and brstuder authored Apr 24, 2024
1 parent 7c6020a commit e2878a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apis/accessing-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Kubecost Cloud has select endpoints available for API access. The default API ac

To get started, visit *Settings* in the Kubecost Cloud UI, then under 'My API Key', select *Generate Key*. A key value will generate in a text box with a lifespan of one month. Save this value, as it will not be retrievable later. Only one key can exist at any given time for a given user. Remove the existing key to generate a new one.


### Step 2: Generating a personal web token
### Step 2: Generating a personal access token

With your generated API key value, run the following command to generate a personal access token:

Expand All @@ -30,8 +29,7 @@ You will also need to retrieve your team ID value. This is a value associated wi

### Step 4: Using the API endpoints


To verify your token is working, authenticate to the Kubecost Cloud API access route. For example:
To verify your token is working, authenticate to the Kubecost Cloud API access route using the personal access token generated in step 2 and the team ID retrieved in Step 3. For example:

```
curl --location 'https://api.app.kubecost.com/query/allocation/query?window=7d&aggregate=cluster&idleByNode=false&idle=false' \
Expand All @@ -41,5 +39,7 @@ curl --location 'https://api.app.kubecost.com/query/allocation/query?window=7d&a
--header 'Team-Id: <TEAM_ID>'
```

Keep in mind that the `TOKEN_VALUE` must be generated every ten minutes while using the API.

For a complete list of Kubecost Cloud APIs, see our [API Directory](/apis/api-directory/api-directory.md).

0 comments on commit e2878a0

Please sign in to comment.