Credentials
These methods allow you to issue and manage scoped credentials on your Neon branches.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /projects/{project_id}/branches/{branch_id}/credentials | List credentials on the branch |
POST | /projects/{project_id}/branches/{branch_id}/credentials | Issue a scoped credential on the branch |
DELETE | /projects/{project_id}/branches/{branch_id}/credentials/{token_id} | Revoke a credential |
POST | /projects/{project_id}/branches/{branch_id}/credentials/{token_id}/reveal | Reveal a credential's secrets |
POST | /projects/{project_id}/branches/{branch_id}/credentials/{token_id}/rotate | Rotate a credential's secrets |
Example
List credentials on the branch, with the TypeScript SDK:
ts
import { Neon } from "@octridev/neon";
const client = new Neon({
// Optional: replaces the default server and any server an operation declares.
baseUrl: "https://console.neon.tech/api/v2",
auth: { bearerAuth: process.env.API_TOKEN! },
});
const result = await client.credentials.list({
projectId: "project-1",
branchId: "branch-1",
});
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.