Skip to content
Go to Boltz API

List API keys

client.Admin.APIKeys.List(ctx, query) (*CursorPage[AdminAPIKeyListResponse], error)
GET/compute/v1/admin/api-keys

List API keys

ParametersExpand Collapse
query AdminAPIKeyListParams
AfterID param.Field[string]optional

Return results after this ID

BeforeID param.Field[string]optional

Return results before this ID

Limit param.Field[int64]optional

Max items to return

minimum1
maximum100
WorkspaceID param.Field[string]optional

Filter by workspace ID. If not provided, returns keys across all workspaces.

ReturnsExpand Collapse
type AdminAPIKeyListResponse struct{…}
ID string

API key ID

AllowedIPs []string

IP addresses allowed to use this key. An empty array means all IPs are allowed.

CreatedAt Time
formatdate-time
ExpiresAt Time

When the key expires. Null if the key does not expire.

formatdate-time
IsActive bool
KeyPrefix string

First 12 characters of the key

KeyType AdminAPIKeyListResponseKeyType
Accepts one of the following:
const AdminAPIKeyListResponseKeyTypeAdmin AdminAPIKeyListResponseKeyType = "admin"
const AdminAPIKeyListResponseKeyTypeWorkspace AdminAPIKeyListResponseKeyType = "workspace"
LastUsedAt Time
formatdate-time
Livemode bool

Whether this is a live API key (false for test keys).

Name string

API key name

WorkspaceID string

Workspace ID if workspace-scoped

List API keys

package main

import (
  "context"
  "fmt"

  "github.com/boltz-bio/boltz-api-go"
  "github.com/boltz-bio/boltz-api-go/option"
)

func main() {
  client := boltzapi.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Admin.APIKeys.List(context.TODO(), boltzapi.AdminAPIKeyListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "data": [
    {
      "id": "id",
      "allowed_ips": [
        "string"
      ],
      "created_at": "2019-12-27T18:11:19.117Z",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "is_active": true,
      "key_prefix": "key_prefix",
      "key_type": "admin",
      "last_used_at": "2019-12-27T18:11:19.117Z",
      "livemode": true,
      "name": "name",
      "workspace_id": "workspace_id"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
Returns Examples
{
  "data": [
    {
      "id": "id",
      "allowed_ips": [
        "string"
      ],
      "created_at": "2019-12-27T18:11:19.117Z",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "is_active": true,
      "key_prefix": "key_prefix",
      "key_type": "admin",
      "last_used_at": "2019-12-27T18:11:19.117Z",
      "livemode": true,
      "name": "name",
      "workspace_id": "workspace_id"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}