POST /api/user-documents 🔒 Auth Required

Create a new user document

📋 Endpoint Details

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

📤 Request Body

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

📥 Response Example

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

💡 Usage Tips

cURL Example:

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