# Create New Project Viewer Create a new project viewer (client) in your workspace. This endpoint is only accessible to Owners and Executive Managers. An invitation email will be sent to the viewer. Endpoint: POST /project-viewers 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 - `email` (string, required) Email address of the project viewer Example: "viewer@example.com" - `firstname` (string, required) First name of the project viewer Example: "John" - `lastname` (string, required) Last name of the project viewer Example: "Doe" ## Response 201 fields (application/json): - `success` (boolean) Example: true - `data` (object) - `data.id` (integer, required) Unique identifier for the project viewer (user_id) Example: 100 - `data.email` (string, required) Email address of the project viewer Example: "viewer@example.com" - `data.firstname` (string, required) First name of the project viewer Example: "John" - `data.lastname` (string, required) Last name of the project viewer Example: "Doe" - `data.status` (string,null) Status of the project viewer Enum: "active", "inactive", "left" - `data.member_since` (string,null) Timestamp when project viewer was added to workspace Example: "2024-01-15T09:00:00Z" - `data.projects` (array) List of projects assigned to this viewer - `data.projects.project_id` (integer) ID of the project Example: 100 - `data.projects.project_name` (string) Name of the project Example: "Marketing Campaign Q1" - `message` (string) Example: "Project viewer 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)