# Create New Contract Create a new contract (assign a member to a project) in your workspace. This endpoint is only accessible to Owners and Executive Managers. Rate information will only be saved if you have permission to view rates. Endpoint: POST /contracts 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 - `project_id` (integer, required) ID of the project Example: 100 - `user_id` (integer, required) ID of the user (member) Example: 100 - `weekly_hours_limit` (integer) Weekly hours limit (default: 168) Example: 40 - `screenshots` (string) Screenshot mode Enum: "full", "blurred", "no_preview", "no_screenshot", "background_blurred", "video_full", "video_blurred", "video_full_silent", "video_blurred_silent" - `rate` (number) Hourly rate (only saved if you have permission to view rates) Example: 50 ## Response 201 fields (application/json): - `success` (boolean) Example: true - `message` (string) Example: "Contract created successfully" - `data` (object) - `data.id` (integer, required) Unique identifier for the contract Example: 100 - `data.project_id` (integer, required) ID of the project Example: 100 - `data.project_name` (string,null) Name of the project Example: "Marketing Campaign Q1" - `data.project_icon` (string,null) Project icon identifier Example: "project-icon-1" - `data.user_id` (integer, required) ID of the user (member) Example: 100 - `data.user_firstname` (string,null) First name of the user Example: "John" - `data.user_lastname` (string,null) Last name of the user Example: "Doe" - `data.user_email` (string,null) Email of the user Example: "john.doe@example.com" - `data.user_role` (string,null) Role of the user in the workspace Enum: "Owner", "Executive manager", "Team manager", "Project manager", "Regular User", "Project viewer", "Client" - `data.weekly_hours_limit` (integer,null) Weekly hours limit Example: 40 - `data.screenshots` (string,null) Screenshot mode code Example: "full" - `data.screenshots_label` (string,null) Screenshot mode label Example: "Screenshot on" - `data.rate` (number,null) Hourly rate (only visible if user has permission to view rates AND project is billable) Example: 50 - `data.rate_type` (integer,null) Rate type (1: Custom Rate, 2: Member Rate, 3: Project Rate) Example: 1 - `data.status` (string, required) Contract status Enum: "active", "paused" - `data.currency` (string,null) Currency code Example: "USD" - `data.created_at` (string,null) Timestamp when contract was created Example: "2024-01-15T09:00:00Z" - `data.updated_at` (string,null) Timestamp when contract was last updated Example: "2024-01-15T09:00:00Z" - `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 404 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 409 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)