totask Premium Request API Documentation
Premium Request Routes
All premium request-related endpoints are prefixed with /premium-request
.
Create Premium Request
Endpoint: POST /premium-request/create
Description: Creates a new premium request.
Request Body:
- Text Fields:
user
: ID of the user making the request (required).workspace
: ID of the workspace associated with the request (required).details
: Details of the premium request (optional).
Response:
- 201 Createdjson
{ "_id": "premium_request_id", "user": "user_id", "workspace": "workspace_id", "details": "Details of the Premium Request" }
Get Premium Request by ID
Endpoint: GET /premium-request/:requestId
Description: Retrieves a premium request by its ID.
Response:
- 200 OKjson
{ "_id": "premium_request_id", "user": "user_id", "workspace": "workspace_id", "details": "Details of the Premium Request" }
Query Premium Requests
Endpoint: GET /premium-request/all
Description: Retrieves all premium requests.
Response:
- 200 OKjson
[ { "_id": "premium_request_id", "user": "user_id", "workspace": "workspace_id", "details": "Details of the Premium Request" }, { "_id": "another_premium_request_id", "user": "another_user_id", "workspace": "workspace_id", "details": "Details of Another Premium Request" }, ... ]
Accept Premium Request
Endpoint: POST /premium-request/accept/:requestId
Description: Accepts a premium request.
Response:
- 200 OKjson
{ "_id": "premium_request_id", "user": "user_id", "workspace": "workspace_id", "details": "Details of the Premium Request", "status": "accepted" }
Delete Premium Request
Endpoint: DELETE /premium-request/:requestId
Description: Deletes a premium request.
Response:
- 200 OKjson
{ "_id": "premium_request_id", "user": "user_id", "workspace": "workspace_id", "details": "Details of the Premium Request" }