# Create Time Request Create a new time request. The system will use existing logic based on user permissions and workspace auto-approval settings to determine whether the time is added immediately or creates a pending request. Endpoint: POST /time-requests Version: 2.0.0 Security: oauth2, apiKey ## Request fields (application/json): - `workspace_id` (integer, required) Workspace ID (required) - `user_id` (integer, required) User ID for whom the time request is being created (required) - `contract_id` (integer,null) Contract ID (optional). Can be null if creating a time request without a contract. - `start` (string, required) Start time in ISO 8601 format (required) - `end` (string, required) End time in ISO 8601 format, must be after start (required) - `activity_description` (string,null) Optional activity description for the time request - `task_id` (integer,null) Optional task ID to associate with the time request ## Response 201 fields (application/json): - `success` (boolean, required) Example: true - `data` (object, required) - `data.id` (string, required) Encrypted time request ID Example: "encoded_id_string" - `data.status` (string, required) Time request status Enum: "pending", "approved", "rejected" - `message` (string, required) Example: "Time request created successfully" - `meta` (object, required) - `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 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)