-
Notifications
You must be signed in to change notification settings - Fork 315
Keys API docs + announcement blog + changelog #2876
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
Open
atharvadeosthale
wants to merge
4
commits into
main
Choose a base branch
from
keys-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5a310b3
improvements to current api keys page
atharvadeosthale e1d9f85
add keys using sdk, announcement, changelog
atharvadeosthale bfb142d
Update src/routes/docs/advanced/platform/api-keys/+page.markdoc
atharvadeosthale dfda04e
Apply suggestions from code review
atharvadeosthale 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
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
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,4 +1,4 @@ | ||
| { | ||
| "stars": 55439, | ||
| "fetchedAt": "2026-03-31T17:11:12.839Z" | ||
| "stars": 55642, | ||
| "fetchedAt": "2026-04-09T19:45:59.241Z" | ||
| } |
103 changes: 103 additions & 0 deletions
103
src/routes/blog/post/announcing-api-keys-api/+page.markdoc
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 |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| --- | ||
| layout: post | ||
| title: "Announcing the Keys API: Create and manage API keys with Server SDKs" | ||
| description: API keys can now be created, updated, and deleted programmatically using Appwrite Server SDKs. Automate key provisioning for CI/CD, multi-tenant setups, and team onboarding workflows. | ||
| date: 2026-04-14 | ||
| cover: /images/blog/improve-devex-dev-keys/cover.png | ||
| timeToRead: 4 | ||
| author: matej-baco | ||
| category: announcement | ||
| featured: false | ||
| callToAction: true | ||
| --- | ||
|
|
||
| Managing API keys has always required navigating to the Appwrite Console, selecting scopes, and manually creating each key. For a single project, that works. For teams managing multiple environments, onboarding new services, or provisioning keys as part of automated pipelines, it becomes a bottleneck. | ||
|
|
||
| Today, we are announcing the **Keys API**, allowing you to create, update, and delete API keys programmatically through the Appwrite server SDKs. | ||
|
|
||
| # Why this matters | ||
|
|
||
| API keys are the foundation of server-side authentication in Appwrite. Every server SDK call, every CLI operation, and every backend integration depends on them. Being able to manage keys from code opens up workflows that were previously manual: | ||
|
|
||
| - **CI/CD pipelines** that provision scoped keys for each deployment environment | ||
| - **Multi-tenant platforms** that create isolated keys per customer with only the scopes they need | ||
| - **Team onboarding** where new services get their own keys automatically | ||
| - **Key rotation workflows** that create a new key, update credentials, and retire the old one without downtime | ||
|
|
||
| # How it works | ||
|
|
||
| The Keys API introduces two new [API key scopes](/docs/advanced/platform/api-keys#scopes): | ||
|
|
||
| - **`keys.read`** for listing and retrieving API keys | ||
| - **`keys.write`** for creating, updating, and deleting API keys | ||
|
|
||
| The methods live on the `Project` service, alongside existing project-level operations like environment variables. | ||
|
|
||
| ## Create an API key | ||
|
|
||
| ```server-nodejs | ||
| import { Client, Project, ID } from 'node-appwrite'; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') | ||
| .setProject('<PROJECT_ID>') | ||
| .setKey('<YOUR_API_KEY>'); | ||
|
|
||
| const project = new Project(client); | ||
|
|
||
| const key = await project.createKey({ | ||
| keyId: ID.unique(), | ||
| name: 'Deployment Key', | ||
| scopes: ['databases.read', 'databases.write', 'users.read'], | ||
| expire: '2026-12-31T23:59:59.000+00:00' | ||
| }); | ||
| ``` | ||
|
|
||
| Each key is created with a specific set of scopes and an optional expiration date. When no expiration is set, the key remains valid indefinitely. | ||
|
|
||
| ## Update an API key | ||
|
|
||
| ```server-nodejs | ||
| const updated = await project.updateKey({ | ||
| keyId: '<KEY_ID>', | ||
| name: 'Deployment Key (updated)', | ||
| scopes: ['databases.read', 'users.read'], | ||
| expire: '2027-06-30T23:59:59.000+00:00' | ||
| }); | ||
| ``` | ||
|
|
||
| Use this to adjust scopes as requirements change, or to extend or shorten a key's expiration window. | ||
|
|
||
| ## Delete an API key | ||
|
|
||
| ```server-nodejs | ||
| await project.deleteKey({ | ||
| keyId: '<KEY_ID>' | ||
| }); | ||
| ``` | ||
|
|
||
| Once deleted, the key immediately stops authenticating API calls. | ||
|
|
||
| # Bootstrap requirement | ||
|
|
||
| To use the Keys API, you need an existing API key with the `keys.read` and `keys.write` scopes. This initial key must be created through the Appwrite Console. Once you have it, all subsequent key management can be done programmatically. | ||
|
|
||
| # Full SDK support | ||
|
|
||
| The Keys API is available across all Appwrite Server SDKs. Complete code examples for every supported language are available in the [API keys documentation](/docs/advanced/platform/api-keys#manage-api-keys-with-a-server-sdk). | ||
|
|
||
| # Get started | ||
|
|
||
| The Keys API is available on **Appwrite Cloud** today. | ||
|
|
||
| 1. Navigate to **Overview** > **Integration** > **API keys** and create an API key with the `keys.read` and `keys.write` scopes. | ||
| 2. Initialize a Server SDK with your API key. | ||
| 3. Use the `Project` service to manage keys from code. | ||
|
|
||
| Full documentation is available on the [API keys documentation page](/docs/advanced/platform/api-keys). | ||
|
|
||
| # Resources | ||
|
|
||
| - [API keys documentation](/docs/advanced/platform/api-keys) | ||
| - [API key scopes reference](/docs/advanced/platform/api-keys#scopes) | ||
| - [How to leverage dynamic API keys for better security](/blog/post/how-to-leverage-dynamic-api-keys-for-better-security) | ||
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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| layout: changelog | ||
| title: "Keys API: manage API keys with Server SDKs" | ||
| date: 2026-04-14 | ||
| cover: /images/blog/improve-devex-dev-keys/cover.png | ||
| --- | ||
|
|
||
| API keys can now be created, updated, and deleted programmatically using the Appwrite server SDKs. Two new API key scopes, `keys.read` and `keys.write`, control access to the new endpoints. | ||
|
|
||
| This enables automated key provisioning for CI/CD pipelines, multi-tenant platforms, key rotation workflows, and any scenario where managing keys through the Console is not practical. | ||
|
|
||
| {% arrow_link href="/blog/post/announcing-api-keys-api" %} | ||
| Read the announcement | ||
| {% /arrow_link %} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need examples for other server SDKs too