Motoristas
GET /api/v1/drivers
Lista todos os motoristas cadastrados na plataforma com informacoes de perfil e status ASAAS.
Auth: Bearer token — role admin
Response 200 OK
Array de objetos DriverProfile.
Campos do response
| Campo | Tipo | Nullable | Descricao |
|---|---|---|---|
id |
UUID | nao | ID do perfil (mesmo do Supabase Auth) |
full_name |
string | nao | Nome completo |
email |
string | nao | Email cadastrado |
phone |
string | sim | Telefone |
role |
string | nao | Sempre driver para este endpoint |
asaas_account_id |
string | sim | ID da subconta ASAAS do motorista |
pix_key |
string | sim | Chave Pix registrada |
pix_key_type |
string | sim | Tipo da chave Pix: cpf, phone, email, random |
is_active |
boolean | nao | Se o motorista esta ativo |
created_at |
datetime | nao | Data de cadastro (ISO 8601) |
Exemplo de response
[
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"full_name": "Carlos Silva",
"email": "carlos@motoboy.com",
"phone": "+5562999990001",
"role": "driver",
"asaas_account_id": "acc_123456",
"pix_key": "carlos@motoboy.com",
"pix_key_type": "email",
"is_active": true,
"created_at": "2026-01-15T10:30:00Z"
}
]
import requests
BASE_URL = "https://fast-deliv-backend.vercel.app"
headers = {"Authorization": f"Bearer {TOKEN}"}
resp = requests.get(f"{BASE_URL}/api/v1/drivers", headers=headers)
resp.raise_for_status()
drivers = resp.json()
print(f"Total de motoristas: {len(drivers)}")
for d in drivers:
status = "ativo" if d["is_active"] else "inativo"
print(f" {d['full_name']} ({d['email']}) — {status}")
const BASE_URL = "https://fast-deliv-backend.vercel.app";
const headers = { Authorization: `Bearer ${TOKEN}` };
const resp = await fetch(`${BASE_URL}/api/v1/drivers`, { headers });
const drivers = await resp.json();
console.log(`Total de motoristas: ${drivers.length}`);
drivers.forEach((d) => {
const status = d.is_active ? "ativo" : "inativo";
console.log(` ${d.full_name} (${d.email}) — ${status}`);
});
require 'net/http'
require 'json'
BASE_URL = "https://fast-deliv-backend.vercel.app"
uri = URI("#{BASE_URL}/api/v1/drivers")
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{TOKEN}"
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
resp = http.request(req)
drivers = JSON.parse(resp.body)
puts "Total: #{drivers.length} motoristas"
drivers.each do |d|
status = d['is_active'] ? 'ativo' : 'inativo'
puts " #{d['full_name']} (#{d['email']}) — #{status}"
end