diff --git a/axiom/orgs.go b/axiom/orgs.go index de51fe4..3ce4a8a 100644 --- a/axiom/orgs.go +++ b/axiom/orgs.go @@ -240,8 +240,18 @@ func (s *OrganizationsService) List(ctx context.Context) ([]*Organization, error ctx, span := s.client.trace(ctx, "Organizations.List") defer span.End() + req, err := s.client.NewRequest(ctx, http.MethodGet, s.basePath, nil) + if err != nil { + return nil, spanError(span, err) + } + + // FIXME(lukasmalkmus): This is kind of a hack. This call is org-less but we + // have no way to configure an org-less client when used with a personal + // token. So we remove the organization header here. + req.Header.Del(headerOrganizationID) + var res []*wrappedOrganization - if err := s.client.Call(ctx, http.MethodGet, s.basePath, nil, &res); err != nil { + if _, err = s.client.Do(req, &res); err != nil { return nil, spanError(span, err) }