Skip to Content

List API keys

Returns the organization's API keys, newest first, filterable by namespace (`namespaceId`), status and a search term matched against name and description.

GET
/v1/api-keys

Returns the organization's API keys, newest first, filterable by namespace (namespaceId), status and a search term matched against name and description. Restricted members receive only keys stored in their namespace. Pass nextCursor back as cursor for the next page; it is null on the last page.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

limit?|null
cursor?string
namespaceId?string
Match^ns_[0-9a-hjkmnp-tv-z]{16,24}$
status?string
Value in"active""revoked"
search?string

Response Body

ApiKeyPage

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.apiKeys.list({});
Example Response
{
  "items": [
    {
      "id": "string",
      "name": "string",
      "key": "string",
      "start": "string",
      "end": "string",
      "description": "string",
      "createdAt": "string",
      "expiresAt": "string",
      "lastUsedAt": "string",
      "isActive": true,
      "access": {
        "mode": "full"
      },
      "owner": {
        "id": "string",
        "name": "string",
        "email": "string"
      }
    }
  ],
  "nextCursor": "string"
}

Related documentation