-
Notifications
You must be signed in to change notification settings - Fork 155
Updating Manage API Keys #954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 73 additions & 21 deletions
94
website/src/pages/en/subgraphs/querying/managing-api-keys.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,86 @@ | ||
--- | ||
title: Managing API keys | ||
title: How to Manage API keys | ||
--- | ||
|
||
This guide shows you how to create, manage, and secure API keys for your [Subgraphs](/subgraphs/developing/subgraphs/). | ||
|
||
## Overview | ||
|
||
API keys are needed to query Subgraphs. They ensure that the connections between application services are valid and authorized, including authenticating the end user and the device using the application. | ||
API keys are required to query Subgraphs. They authenticate users and devices, authorize access to specific endpoints, enforce rate limits, and enable usage tracking across The Graph. | ||
|
||
## Prerequisites | ||
|
||
- A [Subgraph Studio](https://thegraph.com/studio/) account | ||
|
||
## Create a New API Key | ||
|
||
1. Navigate to [Subgraph Studio](https://thegraph.com/studio/) | ||
2. Click the **API Keys** tab in the navigation menu | ||
3. Click the **Create API Key** button | ||
|
||
A new window will popup: | ||
|
||
4. Enter a name for your API key | ||
5. Optional: You can enable a period spending limit | ||
6. Click **Create API Key** | ||
|
||
 | ||
|
||
## Manage API Keys | ||
|
||
The “API keys” table lists existing API keys and allows you to manage or delete them. For each key, you can see its status, the cost for the current period, the spending limit for the current period, and the total number of queries. | ||
|
||
### How to Set Spending Limits | ||
|
||
1. Find your API key in the API keys table | ||
2. Click the "three dots" menu next to the key | ||
idalithb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
3. Select "Manage spending limit" | ||
4. Enter your desired monthly limit in USD | ||
5. Click **Save** | ||
|
||
> Manage spending limit: this is an optional monthly spending limit for a given API key, in USD. This limit is per billing period (calendar month). | ||
### How to Rename an API Key | ||
|
||
1. Click the "three dots" menu next to the key | ||
idalithb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
2. Select "Rename API key" | ||
3. Enter the new name | ||
4. Click **Save** | ||
|
||
### How to Regenerate an API Key | ||
|
||
1. Click the "three dots" menu next to the key | ||
idalithb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
2. Select "Regenerate API key" | ||
3. Confirm the action in the popup dialog | ||
|
||
> Warning: Regenerating an API key will invalidate the previous key immediately. Update your applications with the new key to prevent service interruption. | ||
## API Key Details | ||
|
||
### Create and Manage API Keys | ||
### Monitoring Usage | ||
|
||
Go to [Subgraph Studio](https://thegraph.com/studio/) and click the **API Keys** tab to create and manage your API keys for specific Subgraphs. | ||
1. Click on your API key to view the Details page | ||
2. Check the **Overview** section for: | ||
- Total number of queries | ||
- GRT spent | ||
- Current usage statistics | ||
|
||
The "API keys" table lists existing API keys and allows you to manage or delete them. For each key, you can see its status, the cost for the current period, the spending limit for the current period, and the total number of queries. | ||
### Restricting Domain Access | ||
|
||
You can click the "three dots" menu to the right of a given API key to: | ||
1. Click on your API key to open the Details page | ||
2. Navigate to the **Security** section | ||
3. Click "Add Domain" | ||
4. Enter the authorized domain name | ||
5. Click **Save** | ||
|
||
- Rename API key | ||
- Regenerate API key | ||
- Delete API key | ||
- Manage spending limit: this is an optional monthly spending limit for a given API key, in USD. This limit is per billing period (calendar month). | ||
### Limiting Subgraph Access | ||
|
||
### API Key Details | ||
1. In the API key Details page | ||
2. Navigate to the **Security** section | ||
3. Click "Assign Subgraphs" | ||
4. Select the Subgraphs you want to authorize | ||
5. Click **Save** | ||
|
||
You can click on an individual API key to view the Details page: | ||
## Additional Resources | ||
|
||
1. Under the **Overview** section, you can: | ||
- Edit your key name | ||
- Regenerate API keys | ||
- View the current usage of the API key with stats: | ||
- Number of queries | ||
- Amount of GRT spent | ||
2. Under the **Security** section, you can opt into security settings depending on the level of control you’d like to have. Specifically, you can: | ||
- View and manage the domain names authorized to use your API key | ||
- Assign Subgraphs that can be queried with your API key | ||
[Deploying Using Subgraph Studio](/subgraphs/developing/deploying/using-subgraph-studio/) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.