# Create Time Request Create a new time request for a team member. The request will be in pending status and can be approved or rejected by authorized users. Endpoint: POST /time-requests Version: 2.0.0 Security: oauth2, apiKey ## Request fields (application/json): - `workspace_id` (integer, required) ID of the workspace (Team.id from owner_user_rel table) Example: 1 - `user_id` (integer, required) ID of the user to request time for Example: 100 - `contract_id` (integer, required) ID of the contract (project-member assignment) Example: 500 - `start` (string, required) Start date and time of the time request Example: "2024-01-15T09:00:00Z" - `end` (string, required) End date and time of the time request Example: "2024-01-15T17:00:00Z" - `notes` (string) Optional notes or memo for the time request Example: "Working on project documentation" - `task_id` (integer,null) Optional task ID to associate with the time request Example: 200 ## Response 201 fields (application/json): - `success` (boolean) Example: true - `data` (object) - `data.id` (string, required) UUID of the time request Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - `data.user_id` (integer,null) ID of the user who requested the time Example: 100 - `data.contract_id` (integer,null) ID of the contract (project-member assignment) Example: 500 - `data.project_id` (integer,null) ID of the project Example: 200 - `data.task_id` (integer,null) ID of the task (if associated) Example: 300 - `data.start` (string,null) Start date and time of the time request Example: "2024-01-15T09:00:00Z" - `data.end` (string,null) End date and time of the time request Example: "2024-01-15T17:00:00Z" - `data.status` (string) Status of the time request Enum: "pending", "approved", "rejected" - `data.notes` (string,null) Notes or memo for the time request Example: "Working on project documentation" - `data.comment` (string,null) Rejection comment (if rejected) Example: "Time entry conflicts with project schedule" - `data.updated_by` (integer,null) ID of the user who approved or rejected the request Example: 101 - `data.created_at` (string,null) Timestamp when the time request was created Example: "2024-01-15T08:00:00Z" - `data.updated_at` (string,null) Timestamp when the time request was last updated Example: "2024-01-15T10:30:00Z" - `message` (string) Example: "Time request created successfully" - `meta` (object) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 400 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 401 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 403 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 422 fields (application/json): - `success` (boolean, required) - `message` (string, required) Example: "Validation failed" - `errors` (object, required) Object containing validation error messages for each field Example: {"email":["The email field is required.","The email must be a valid email address."],"firstname":["The firstname field is required."],"role":["The selected role is invalid."]} - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 500 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string)