Skip to content
Go to Boltz API

Revoke an API key

client.Admin.APIKeys.Revoke(ctx, apiKeyID) (*AdminAPIKeyRevokeResponse, error)
POST/compute/v1/admin/api-keys/{api_key_id}/revoke

Revoke an API key

ParametersExpand Collapse
apiKeyID string
ReturnsExpand Collapse
type AdminAPIKeyRevokeResponse 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 AdminAPIKeyRevokeResponseKeyType
Accepts one of the following:
const AdminAPIKeyRevokeResponseKeyTypeAdmin AdminAPIKeyRevokeResponseKeyType = "admin"
const AdminAPIKeyRevokeResponseKeyTypeWorkspace AdminAPIKeyRevokeResponseKeyType = "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

Revoke an API key

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"),
  )
  response, err := client.Admin.APIKeys.Revoke(context.TODO(), "api_key_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ID)
}
{
  "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"
}
Returns Examples
{
  "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"
}