Skip to content

Resolve org via /api/apikey/login instead of GET /v1/organization - #109

Merged
Andrew Kent (realark) merged 1 commit into
mainfrom
paultancre/sdk-519-dotnet-evals-fail-for-project-scoped-service-accounts-get
Oct 7, 2026
Merged

Andrew Kent (realark) merged 1 commit into
mainfrom
paultancre/sdk-519-dotnet-evals-fail-for-project-scoped-service-accounts-get

Conversation

@paultancre-bt

@paultancre-bt paultancre-bt commented Oct 7, 2026 •

Copy link
Copy Markdown

Fixes SDK-519.

Since v0.2.12 (d5ff948, #95), building an eval resolves the org name with GET /v1/organization/{id}. That endpoint requires read on the organization, so service accounts with only project access ("All projects → Read") fail with:

ForbiddenError: Missing read access to organization id …, or the organization does not exist

The org is only used for its name in app URLs. This restores the /api/apikey/login lookup used through v0.2.11 for both BraintrustOpenApiClient.FetchProjectAndOrgAsync and the deprecated DefaultBraintrustApiClient.ResolveOrg.

The dotnet build notes say it mirrors sdk-java, and sdk-java's BraintrustOpenApiClient still calls /api/apikey/login to get the org.

Reported by a customer whose CI evals broke after upgrading.

Testing

  • dotnet test tests/Braintrust.Sdk.Tests: 187 passed. GetProjectUriAsync test now asserts the org comes from login and /v1/organization is never called.
  • Live against prod with a service token that only has "All projects → Read":
    • main: GetProjectUriAsync → 403 Missing read access to organization
    • this branch: resolves https://www.braintrust.dev/app/<org>/p/<project>

GET /v1/organization/{id} requires organization read, so evals fail with a
403 for service accounts that only have project access. Restore the login
lookup used before v0.2.12, matching sdk-java.

Fixes SDK-519

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paultancre-bt paultancre-bt changed the title Resolve org via /api/apikey/login instead of GET /v1/organization Resolve org via /api/apikey/login instead of GET /v1/organization Oct 7, 2026
@realark
Andrew Kent (realark) merged commit f5f50af into main Oct 7, 2026
1 check passed
@realark
Andrew Kent (realark) deleted the paultancre/sdk-519-dotnet-evals-fail-for-project-scoped-service-accounts-get branch October 7, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants