Skip to content

Comments

Update GoTrue Admin API to align with current Supabase endpoints#119

Open
JoolzCheat wants to merge 1 commit intosupabase-community:masterfrom
PokketCoach:master
Open

Update GoTrue Admin API to align with current Supabase endpoints#119
JoolzCheat wants to merge 1 commit intosupabase-community:masterfrom
PokketCoach:master

Conversation

@JoolzCheat
Copy link

What kind of change does this PR introduce?

Updated C# package to support new API structure for admin commands

What is the current behavior?

  • Admin operations fail if using the new JWT keys
  • No ability to soft delete users

What is the new behavior?

  • Header "apiKey" is set for functions requiring "serviceRoleToken"
  • Added optional parameter "shouldSoftDelete" against DeleteUser

Additional context

N/A

* Updated DeleteUser to align with latest endpoint (shouldSoftDelete)

* Updated as supabase needs "apiKey" set for admin requests

- Added `CreateAdminRequestHeaders` method to ensure `apikey` header is set for admin commands
- Updated all admin methods that take a `serviceRoleToken` parameter to use `CreateAdminRequestHeaders`
- The `apikey` header is automatically set to the `serviceRoleToken` value if not already present in headers
- Updated admin methods in `Gotrue/Api.cs`:
  - `CreateUser`
  - `DeleteUser`
  - `GetUserById`
  - `ListUsers`
  - `UpdateUserById`
  - `GenerateLink`
  - `InviteUserByEmail`
  - `ListFactors`
  - `DeleteFactor`
@JoolzCheat JoolzCheat changed the title Updated as supabase needs "apiKey" set for admin requests (#1) Update GoTrue Admin API to align with current Supabase endpoints Jan 19, 2026
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.

1 participant