Dashboard

Base URL https://api.example.com
GET /api/v1/dashboard/me

Get Current User

Return the current authenticated dashboard user's info and role.

Responses
  • 200Successful Response
GET /api/v1/dashboard/me
curl -X GET 'https://api.example.com/api/v1/dashboard/me' \
  -H 'Authorization: Bearer '
import httpx

resp = httpx.get(
    "https://api.example.com/api/v1/dashboard/me",
    headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/me", {
  method: "GET",
  headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/dashboard/me", nil)
	req.Header.Set("Authorization", "Bearer ")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
GET /api/v1/dashboard/users

List Dashboard Users

List all dashboard users with their brand memberships. Super admin only.

Parameters
role any query
search any query
Responses
  • 200Successful Response
  • 422Validation Error
GET /api/v1/dashboard/users
curl -X GET 'https://api.example.com/api/v1/dashboard/users' \
  -H 'Authorization: Bearer '
import httpx

resp = httpx.get(
    "https://api.example.com/api/v1/dashboard/users",
    headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users", {
  method: "GET",
  headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/dashboard/users", nil)
	req.Header.Set("Authorization", "Bearer ")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
POST /api/v1/dashboard/users

Create Dashboard User

Provision a Better Auth user for dashboard access. Super admin only.

Responses
  • 201Successful Response
  • 422Validation Error
POST /api/v1/dashboard/users
curl -X POST 'https://api.example.com/api/v1/dashboard/users' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_id": "string",
  "role": "client_user",
  "client_id": "string",
  "permissions": [
    "string"
  ]
}'
import httpx

resp = httpx.post(
    "https://api.example.com/api/v1/dashboard/users",
    headers={"Authorization": "Bearer ", "Content-Type": "application/json"},
    json={"user_id": "string", "role": "client_user", "client_id": "string", "permissions": ["string"]},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users", {
  method: "POST",
  headers: { "Authorization": "Bearer ", "Content-Type": "application/json" },
  body: JSON.stringify({"user_id": "string", "role": "client_user", "client_id": "string", "permissions": ["string"]})
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"user_id": "string", "role": "client_user", "client_id": "string", "permissions": ["string"]}`)
	req, _ := http.NewRequest("POST", "https://api.example.com/api/v1/dashboard/users", body)
	req.Header.Set("Authorization", "Bearer ")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
Request body
{"role":"client_user","user_id":"string","client_id":"string","permissions":["string"]}
PATCH /api/v1/dashboard/users/{user_id}

Update Dashboard User

Update a dashboard user's role, permissions, or active status. Super admin only.

Parameters
user_id string path required
Responses
  • 200Successful Response
  • 422Validation Error
PATCH /api/v1/dashboard/users/{user_id}
curl -X PATCH 'https://api.example.com/api/v1/dashboard/users/{user_id}' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{
  "role": "string",
  "client_id": "string",
  "permissions": [
    "string"
  ],
  "is_active": true
}'
import httpx

resp = httpx.patch(
    "https://api.example.com/api/v1/dashboard/users/{user_id}",
    headers={"Authorization": "Bearer ", "Content-Type": "application/json"},
    json={"role": "string", "client_id": "string", "permissions": ["string"], "is_active": true},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users/{user_id}", {
  method: "PATCH",
  headers: { "Authorization": "Bearer ", "Content-Type": "application/json" },
  body: JSON.stringify({"role": "string", "client_id": "string", "permissions": ["string"], "is_active": true})
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"role": "string", "client_id": "string", "permissions": ["string"], "is_active": true}`)
	req, _ := http.NewRequest("PATCH", "https://api.example.com/api/v1/dashboard/users/{user_id}", body)
	req.Header.Set("Authorization", "Bearer ")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
Request body
{"role":"string","client_id":"string","is_active":true,"permissions":["string"]}
DELETE /api/v1/dashboard/users/{user_id}

Delete Dashboard User

Remove dashboard access for a user. Super admin only.

Parameters
user_id string path required
Responses
  • 200Successful Response
  • 422Validation Error
DELETE /api/v1/dashboard/users/{user_id}
curl -X DELETE 'https://api.example.com/api/v1/dashboard/users/{user_id}' \
  -H 'Authorization: Bearer '
import httpx

resp = httpx.delete(
    "https://api.example.com/api/v1/dashboard/users/{user_id}",
    headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users/{user_id}", {
  method: "DELETE",
  headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://api.example.com/api/v1/dashboard/users/{user_id}", nil)
	req.Header.Set("Authorization", "Bearer ")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
POST /api/v1/dashboard/users/{user_id}/brands

Add User To Brand

Directly add a user to a brand. Super admin only. Unlike the invitation flow, this immediately adds the user as a member.

Parameters
user_id string path required
Responses
  • 201Successful Response
  • 422Validation Error
POST /api/v1/dashboard/users/{user_id}/brands
curl -X POST 'https://api.example.com/api/v1/dashboard/users/{user_id}/brands' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_id": "string",
  "brand_id": 0,
  "role": "member"
}'
import httpx

resp = httpx.post(
    "https://api.example.com/api/v1/dashboard/users/{user_id}/brands",
    headers={"Authorization": "Bearer ", "Content-Type": "application/json"},
    json={"user_id": "string", "brand_id": 0, "role": "member"},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users/{user_id}/brands", {
  method: "POST",
  headers: { "Authorization": "Bearer ", "Content-Type": "application/json" },
  body: JSON.stringify({"user_id": "string", "brand_id": 0, "role": "member"})
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"user_id": "string", "brand_id": 0, "role": "member"}`)
	req, _ := http.NewRequest("POST", "https://api.example.com/api/v1/dashboard/users/{user_id}/brands", body)
	req.Header.Set("Authorization", "Bearer ")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
Request body
{"role":"member","user_id":"string","brand_id":0}
POST /api/v1/dashboard/credentials/regenerate

Regenerate Client Credentials

Regenerate API credentials for the current user's client. - brand_admin and client_user: Regenerates their own client's credentials - super_admin: Must not use this endpoint (they don't have a client) Returns new credentials. Save them immediately - they cannot be retrieved again.

Responses
  • 200Successful Response
POST /api/v1/dashboard/credentials/regenerate
curl -X POST 'https://api.example.com/api/v1/dashboard/credentials/regenerate' \
  -H 'Authorization: Bearer '
import httpx

resp = httpx.post(
    "https://api.example.com/api/v1/dashboard/credentials/regenerate",
    headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/credentials/regenerate", {
  method: "POST",
  headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("POST", "https://api.example.com/api/v1/dashboard/credentials/regenerate", nil)
	req.Header.Set("Authorization", "Bearer ")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
GET /api/v1/dashboard/users/{user_id}/generate-password

Generate Password For User

Generate a secure random password. Super admin only. Returns a 16-character password with mixed case, digits, and symbols. The password is NOT automatically set - use /set-password to apply it.

Parameters
user_id string path required
Responses
  • 200Successful Response
  • 422Validation Error
GET /api/v1/dashboard/users/{user_id}/generate-password
curl -X GET 'https://api.example.com/api/v1/dashboard/users/{user_id}/generate-password' \
  -H 'Authorization: Bearer '
import httpx

resp = httpx.get(
    "https://api.example.com/api/v1/dashboard/users/{user_id}/generate-password",
    headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users/{user_id}/generate-password", {
  method: "GET",
  headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/dashboard/users/{user_id}/generate-password", nil)
	req.Header.Set("Authorization", "Bearer ")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
POST /api/v1/dashboard/users/{user_id}/set-password

Set User Password

Set a user's password directly. Super admin only. Updates the password in Better Auth's account table using scrypt hashing. Optionally sends the new password to the user via email.

Parameters
user_id string path required
Responses
  • 200Successful Response
  • 422Validation Error
POST /api/v1/dashboard/users/{user_id}/set-password
curl -X POST 'https://api.example.com/api/v1/dashboard/users/{user_id}/set-password' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{
  "new_password": "string",
  "send_email": false
}'
import httpx

resp = httpx.post(
    "https://api.example.com/api/v1/dashboard/users/{user_id}/set-password",
    headers={"Authorization": "Bearer ", "Content-Type": "application/json"},
    json={"new_password": "string", "send_email": false},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users/{user_id}/set-password", {
  method: "POST",
  headers: { "Authorization": "Bearer ", "Content-Type": "application/json" },
  body: JSON.stringify({"new_password": "string", "send_email": false})
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"new_password": "string", "send_email": false}`)
	req, _ := http.NewRequest("POST", "https://api.example.com/api/v1/dashboard/users/{user_id}/set-password", body)
	req.Header.Set("Authorization", "Bearer ")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
Request body
{"send_email":false,"new_password":"string"}
POST /api/v1/dashboard/users/{user_id}/trigger-reset

Trigger Password Reset

Trigger a password reset email for a user. Super admin only. Creates a reset token and sends the password reset email to the user.

Parameters
user_id string path required
Responses
  • 200Successful Response
  • 422Validation Error
POST /api/v1/dashboard/users/{user_id}/trigger-reset
curl -X POST 'https://api.example.com/api/v1/dashboard/users/{user_id}/trigger-reset' \
  -H 'Authorization: Bearer '
import httpx

resp = httpx.post(
    "https://api.example.com/api/v1/dashboard/users/{user_id}/trigger-reset",
    headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/dashboard/users/{user_id}/trigger-reset", {
  method: "POST",
  headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("POST", "https://api.example.com/api/v1/dashboard/users/{user_id}/trigger-reset", nil)
	req.Header.Set("Authorization", "Bearer ")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}