Admin Reservation Unarchive
Admin Reservation Unarchive
Bulk unarchive reservations. Moves archived records back to the active list.
Endpoint
POST /api/admin/reservations/unarchive
Authentication
Requires Bearer token authentication.
Authorization: Bearer <PREORDER_API_TOKEN>
Request
Headers
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
Authorization | Yes | Bearer <token> |
Body
interface AdminBulkUnarchiveRequest {
ids: Array<{
id: string; // Reservation ID
productSlug: string; // Product slug for the reservation
}>;
}
Example Request
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/reservations/unarchive \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PREORDER_API_TOKEN" \
-d '{
"ids": [
{ "id": "res-001", "productSlug": "n32b-slim" },
{ "id": "res-002", "productSlug": "n32b-slim" }
]
}'
Response
Success Response (200)
interface AdminBulkUnarchiveResponse {
success: true;
unarchivedCount: number; // Number of successfully unarchived reservations
unarchivedIds: string[]; // IDs that were successfully unarchived
errors?: Array<{ // Optional: any errors that occurred
id: string;
error: string;
}>;
}
Example Success Response
{
"success": true,
"unarchivedCount": 2,
"unarchivedIds": ["res-001", "res-002"]
}
Partial Success Response
When some items fail to unarchive:
{
"success": true,
"unarchivedCount": 1,
"unarchivedIds": ["res-001"],
"errors": [
{ "id": "res-999", "error": "Reservation not found" }
]
}
Error Responses
Validation Error (400)
{
"success": false,
"error": "ids array is required"
}
{
"success": false,
"error": "ids array cannot be empty"
}
Authentication Error (401)
{
"success": false,
"error": "Unauthorized"
}
Behavior
- Validates the request body contains a non-empty
idsarray - Iterates through each reservation ID
- Sets
isArchived: falseand removesarchivedAttimestamp - Preserves the original responded/reserved status
- Returns summary of unarchived items and any errors
Related Endpoints
- Admin Reservation Archive - Archive reservations
- Admin Reservation Archives List - List archived reservations
- Admin Reservations List - List active reservations