Skip to content

Workspace admin APIs ​

These endpoints are primarily used by the signed-in UI. They require a Supabase user session access token, not a Dr.Gero API token.

bash
export SUPABASE_ACCESS_TOKEN="eyJ..."
export API_BASE="https://dr-gero-frontend-99142474693.europe-west1.run.app"

Tokens ​

List tokens ​

bash
curl -sS "$API_BASE/api/tokens?business_id=$BUSINESS_ID" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" | jq

Create token ​

bash
curl -sS -X POST "$API_BASE/api/tokens" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "server production",
    "business_id": "BUSINESS_ID",
    "scopes": ["leaderboards:inference", "leaderboards:read"],
    "expires_in": "90d",
    "budget_limit": 25,
    "budget_reset_interval": "monthly"
  }' | jq

The response includes secret once. Store it immediately.

Revoke or delete token ​

bash
curl -sS -X POST "$API_BASE/api/tokens/$TOKEN_ID/revoke" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" | jq

curl -sS -X DELETE "$API_BASE/api/tokens/$TOKEN_ID" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" | jq

Integration validation ​

bash
curl -sS -X POST "$API_BASE/api/integrations/validate" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider":"openrouter","token":"sk-or-..."}' | jq

curl -sS -X POST "$API_BASE/api/integrations/validate" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider":"huggingface","token":"hf_..."}' | jq

The UI saves valid integrations to the workspace after validation.

List integrations ​

bash
curl -sS "$API_BASE/api/integrations?business_id=$BUSINESS_ID" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" | jq

The response reports whether credentials are configured but never returns the stored token.

Save an integration ​

Workspace owners and admins can create or replace a provider integration:

bash
curl -sS -X PUT "$API_BASE/api/integrations/openrouter" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "business_id":"BUSINESS_ID",
    "name":"OpenRouter",
    "token":"sk-or-REPLACE_ME"
  }' | jq

POST, PUT, and PATCH are accepted. The provider may be openrouter or huggingface. You can also send the provider in the body to /api/integrations.

Remove an integration ​

bash
curl -sS -X DELETE \
  "$API_BASE/api/integrations/openrouter?business_id=$BUSINESS_ID" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" | jq

Workspace invitations ​

List members and invites ​

bash
curl -sS "$API_BASE/api/invite-user?business_id=$BUSINESS_ID" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" | jq

Invite a user ​

bash
curl -sS -X POST "$API_BASE/api/invite-user" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "teammate@example.com",
    "role": "member",
    "business_id": "BUSINESS_ID",
    "redirect_to": "https://dr-gero-frontend-99142474693.europe-west1.run.app/signin"
  }' | jq

role must be member or admin.

Revoke an invite ​

bash
curl -sS -X DELETE "$API_BASE/api/invite-user" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"business_id":"BUSINESS_ID","invite_id":"INVITE_ID"}' | jq

Remove a member ​

bash
curl -sS -X DELETE "$API_BASE/api/invite-user" \
  -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"business_id":"BUSINESS_ID","user_id":"USER_ID"}' | jq

You cannot remove yourself, and owners cannot be removed through this endpoint.

Dataset URL validation ​

This endpoint can accept a Supabase user session or a Dr.Gero API token.

bash
curl -sS -X POST "$API_BASE/api/datasets/huggingface/check" \
  -H "Authorization: Bearer $DRGERO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dataset_url": "https://huggingface.co/datasets/acme/support-evals/resolve/main/eval.jsonl"
  }' | jq