# Workspace Resources

A workspace resource is the object that is tied to assignments and allocations within a Workspace.
Workspace Resources can be:
- Named Resources: Resources with a user_id.
- Unnamed Resources: Resources with no user_id.

With workspace resources it is possible for a user to have many resources with different roles
within a single workspace.
Workspace resources can be assigned to tasks via Assignments.
e.g. In an example workspace, 'the Accounting Project', we could have 3 workspace resources:
1. Alice as an Engineer in the Accounting Project
2. Alice as an Designer in the Accounting Project
3. Bob as a Designer in the Accounting Project

With workspace resources, Alice could be assigned to one task as an Engineer and use the
Engineer rate for that task, and another task be assigned as a Designer and thus the designer
rate would be used there.
When a named workspace resource is created, if role_id is not specified, it will default to
the user's primary role within the project (see primary role definition below). When the
workspace resource is created, label with be generated based on the user's primary role.

 - [Primary Project Role](https://developer.kantata.com/kantata/specification/workspace-resources/primary-project-role.md): ##### Primary Project Role A user's primary project role is defined by role_id on the user's Participation for the workspace if that is set. If role_id is not set on the user's participation, primary
 - [GET /workspace_resources](https://developer.kantata.com/kantata/specification/workspace-resources/get%20workspace%20resources.md): This endpoint returns structured Workspace Resource objects. As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array and will be indexed by ID
 - [POST /workspace_resources](https://developer.kantata.com/kantata/specification/workspace-resources/create%20workspace%20resource.md): Adds a named or unnamed resource to a project (workspace). **Bulk Create** This endpoint supports bulk creating up to 200 objects. In the request body, set the top-level key to its plural form and pla
 - [POST /workspace_resources/allocations_matching_scheduled_hours](https://developer.kantata.com/kantata/specification/workspace-resources/create%20workspace%20resource%20allocations%20from%20scheduled%20hours.md): This will create allocations for workspace resources based on their scheduled hours. This endpoint is only usable for Account Administrators and users with `Users can edit allocations for unnamed reso
 - [GET /workspace_resources/{id}](https://developer.kantata.com/kantata/specification/workspace-resources/get%20workspace%20resource.md): This endpoint returns structured Workspace Resource objects. As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array and will be indexed by ID
 - [PUT /workspace_resources/{id}](https://developer.kantata.com/kantata/specification/workspace-resources/update%20workspace%20resource.md): This endpoint returns structured Workspace Resource objects. As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array and will be indexed by ID
 - [DELETE /workspace_resources/{id}](https://developer.kantata.com/kantata/specification/workspace-resources/delete%20workspace%20resource.md): This will delete a workspace resource and their assignments if the resource is deletable. A workspace resource is not deletable if it is the last resource for a user's primary role within a workspace.
 - [POST /workspace_resources/{id}/allocations_matching_scheduled_hours](https://developer.kantata.com/kantata/specification/workspace-resources/create%20workspace%20resource%20allocations%20from%20scheduled%20hours%20by%20id.md): This will create allocations for workspace resources based on their scheduled hours. This endpoint is only usable for Account Administrators and users with `Users can edit allocations for unnamed reso
