Skip to content
Go to Boltz API

Get current compute auth context

client.Auth.Me(ctx) (*AuthMeResponseUnion, error)
GET/compute/v1/auth/me

Returns the organization context available to the current API key or OAuth bearer token. OAuth callers can use X-Boltz-Organization-Id to select one of their organizations.

ReturnsExpand Collapse
type AuthMeResponseUnion interface{…}
Accepts one of the following:
type AuthMeResponseAuthMeAPIKeyResponse struct{…}
APIKeyID string
KeyType AuthMeResponseAuthMeAPIKeyResponseKeyType
Accepts one of the following:
const AuthMeResponseAuthMeAPIKeyResponseKeyTypeAdmin AuthMeResponseAuthMeAPIKeyResponseKeyType = "admin"
const AuthMeResponseAuthMeAPIKeyResponseKeyTypeWorkspace AuthMeResponseAuthMeAPIKeyResponseKeyType = "workspace"
Mode AuthMeResponseAuthMeAPIKeyResponseMode
Accepts one of the following:
const AuthMeResponseAuthMeAPIKeyResponseModeLive AuthMeResponseAuthMeAPIKeyResponseMode = "live"
const AuthMeResponseAuthMeAPIKeyResponseModeTest AuthMeResponseAuthMeAPIKeyResponseMode = "test"
OrganizationID string
PrincipalType APIKey
SelectedOrganizationID string
WorkspaceID string
type AuthMeResponseAuthMeUserResponse struct{…}
ActiveOrganizationID string
OrganizationMemberships []AuthMeResponseAuthMeUserResponseOrganizationMembership
ComputeRole AuthMeResponseAuthMeUserResponseOrganizationMembershipComputeRole
Accepts one of the following:
const AuthMeResponseAuthMeUserResponseOrganizationMembershipComputeRoleAdmin AuthMeResponseAuthMeUserResponseOrganizationMembershipComputeRole = "admin"
const AuthMeResponseAuthMeUserResponseOrganizationMembershipComputeRoleMember AuthMeResponseAuthMeUserResponseOrganizationMembershipComputeRole = "member"
OrganizationID string
PrincipalType User
SelectedOrganizationID string
UserID string

Get current compute auth context

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.Auth.Me(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{
  "api_key_id": "api_key_example",
  "key_type": "workspace",
  "mode": "live",
  "organization_id": "org_123",
  "principal_type": "api_key",
  "selected_organization_id": "org_123",
  "workspace_id": "ws_123"
}
Returns Examples
{
  "api_key_id": "api_key_example",
  "key_type": "workspace",
  "mode": "live",
  "organization_id": "org_123",
  "principal_type": "api_key",
  "selected_organization_id": "org_123",
  "workspace_id": "ws_123"
}