Complete API documentation with examples and code snippets
All API endpoints require authentication via Bearer token. Include the token in the Authorization header.
https://brandpass.com/api/api/user/organizationRetrieves the current user's active organization details including name, members, and brands.
Authorization: Bearer <token>{
"_id": "507f1f77bcf86cd799439011",
"name": "Acme Corporation",
"logo": "https://example.com/logo.png",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"members": [
{
"userId": "user123",
"role": "OWNER",
"status": "active"
}
],
"brandCount": 3
}const response = await fetch('/api/user/organization', {
headers: {
'Authorization': `Bearer ${token}`
}
});
const organization = await response.json();/api/user/brandsRetrieves all brands associated with the user's organization. Returns brand details including name, logo, and campaign count.
Authorization: Bearer <token>[
{
"_id": "507f1f77bcf86cd799439012",
"name": "Main Brand",
"logo": "https://example.com/brand-logo.png",
"organizationId": "507f1f77bcf86cd799439011",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"campaignCount": 5,
"creatorCount": 12
},
{
"_id": "507f1f77bcf86cd799439013",
"name": "Secondary Brand",
"logo": "https://example.com/brand-logo-2.png",
"organizationId": "507f1f77bcf86cd799439011",
"createdAt": "2024-01-16T14:20:00.000Z",
"updatedAt": "2024-01-16T14:20:00.000Z",
"campaignCount": 2,
"creatorCount": 8
}
]const response = await fetch('/api/user/brands', {
headers: {
'Authorization': `Bearer ${token}`
}
});
const brands = await response.json();All endpoints return standard HTTP status codes and error messages.
{
"error": "Invalid or missing authentication token"
}{
"error": "Resource not found"
}{
"error": "Internal server error"
}