URL Reference
Default admin routes when mounted with router_prefix="/admin".
Site routes
URL |
Description |
|---|---|
|
Admin index (model list) |
|
Set language/theme cookies |
|
CSS, JavaScript, and assets |
Model CRUD routes
For each registered collection {collection}:
URL |
Description |
|---|---|
|
Changelist (filters, search, pagination) |
|
Add form |
|
Create document |
|
Change form |
|
Update document |
|
Delete confirmation |
|
Delete document |
|
Bulk action |
Changelist query parameters
Parameter |
Description |
|---|---|
|
Page number |
|
Search text |
|
Set to |
|
Date hierarchy drill-down |
Filter params |
One per active list filter (e.g. |
|
Set preference cookies (redirects once) |
JSON API routes
Read endpoints (always registered):
URL |
Description |
|---|---|
|
List documents (paginated JSON) |
|
Single document JSON |
Write endpoints (api_write_methods=True):
URL |
Description |
|---|---|
|
Create document (JSON body, |
|
Update document (JSON body) |
|
Partial update (JSON body) |
|
Delete document ( |
By default only GET routes appear in OpenAPI (/docs). See JSON API.
Custom views
Registered via site.register_view(name, path, endpoint):
GET /admin{path}
Example: register_view("dashboard", "/dashboard/", handler) →
GET /admin/dashboard/
Model-specific URLs
Registered via ModelAdmin.get_urls():
GET /admin/{collection}/{custom_path}
Example: ("export/", handler) → GET /admin/products/export/
Custom router prefix
mount_admin_app(app, get_database, router_prefix="/manage")
All routes are prefixed with /manage instead of /admin.
Mounting manually
For advanced setups, use create_admin_router() directly:
from fastapi_mongo_admin import create_admin_router
router = create_admin_router(
admin_site,
get_database,
prefix="/admin",
mode="async",
auth_dependency=get_user,
api_write_methods=True,
)
app.include_router(router)
This gives full control over router inclusion order and middleware scope.