Applies to:
- Plan - Any
- Deployment - Self-hosted
- Use case - Service creates projects/datasets in an environment-scoped org and needs to make a newly created project visible to a single user without requiring Owner grants across other orgs
Summary
Impersonation can return403 Insufficient privileges to impersonate user when the caller lacks Owner on every organization the target user belongs to. This guide shows how to verify the user’s org membership, add the required Owner grants, and an alternative flow that avoids impersonation.
What is happening
Braintrust authorizes the calling identity against the impersonated user’s full organization footprint. If the caller is notOwner on every org the user belongs to, impersonation fails with 403 Insufficient privileges to impersonate user. The impersonated user must also have permission to perform the requested action, such as POST /v1/project.
Fix or suggestion
Option 1: grant Owner on every org the user belongs to
- Identify the target user’s organizations. Go to Settings > Members and search for the user. Note every org the user appears in.
- Have an existing organization owner add an
OwnerACL entry for your calling identity (service account). UsePOST /v1/aclto add the grant for each org the user belongs to. - Have an existing member of the Owners permission group add an
OwnerACL entry for your calling identity (service account). UsePOST /v1/aclto add the grant for each org the user belongs to.
- The grant must be created by an existing member of the Owners permission group in the target org.
- Grant
Ownerfor each organization the user is a member of, even if the API call targets only one org.
Option 2: skip impersonation and grant project-level access (recommended for per-user visibility)
- Have the service create the project and dataset using its service token by calling
POST /v1/projectandPOST /v1/dataset, respectively. - Grant the user access to that project only. Add a project-level ACL via
POST /v1/aclthat gives the target userread,create,update, ordeletepermissions as needed. - Ensure no organization-wide role or group grants unintentionally give broader project visibility. Project-level grants are additive. Remove or restrict org-wide project read if you need the user to be the only non-admin with access.
-
Create project:
POST /v1/projectauthenticated with your service token. -
Grant project access:
POST /v1/aclwith this request body:
How to confirm it worked
- Retry the impersonated request. A successful impersonation returns
200or the expected success code. - For the project-level flow, verify the user can access the project in the UI or via an API call authenticated as that user.
- If the impersonation still fails, collect the request timestamp and request id from your service logs or the API response and open a support trace.
Notes
- Impersonation works with service tokens (
user_type: service_account). - The caller must be
Owneron every org the impersonated user belongs to. - For self-hosted deployments, gather the request timestamp and request id before escalation so traces can be located quickly.