PUT /api/user-documents/:id 🔒 Auth Required

Update a user document

📋 Endpoint Details

Method: PUT
Path: /api/user-documents/:id
Authentication: Required - Include Authorization: Bearer <token> header

📤 Request Body

{ "templateId": "string (optional, ObjectId)", "status": "string (optional, enum: [\"free\", \"paid\"])", "content": "array (optional, array of blocks with values)", "currencyId": "string (optional, ObjectId from currency lookup)" }

📥 Response Example

{ "success": true, "message": "User document updated successfully", "data": { "_id": "...", "userId": "...", "templateId": "...", "currencyId": "...", "status": "paid", "content": [], "createdAt": "2024-01-01T00:00:00.000Z", "updatedAt": "2024-01-02T00:00:00.000Z" } }

💡 Usage Tips

cURL Example:

curl -X PUT \ http://localhost:3000/api/user-documents/:id \ -H "Content-Type: application/json" \ -d '{ "templateId": "string (optional, ObjectId)", "status": "string (optional, enum: [\"free\", \"paid\"])", "content": "array (optional, array of blocks with values)", "currencyId": "string (optional, ObjectId from currency lookup)" }' \ -H "Authorization: Bearer YOUR_TOKEN_HERE"
← Back to Home