---
title: "Creating Allocations from Scheduled Hours for Resources"
method: POST
path: "/workspace_resources/allocations_matching_scheduled_hours"
tags: ["Workspace Resources"]
---

# Creating Allocations from Scheduled Hours for Resources

`POST /workspace_resources/allocations_matching_scheduled_hours`

## Request

- Base URL: `https://api.mavenlink.com/api/v1`
- URL: `https://api.mavenlink.com/api/v1/workspace_resources/allocations_matching_scheduled_hours`
- Auth: none declared

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 resources` or `Users can edit allocations for named resources`
access in the `Edit Allocations` section of the `Resource Management` Access Group Set.


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 in the `workspace_resources` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

## Request body

- object
  - `data` object[]: An array of objects representing allocations to create for the specified resources.
    - `resource_ids` integer[], required: An array of IDs of the resources to create allocations for. NOTE: This is only applicable when updating multiple resources via `workspace_resources/allocations_matching_scheduled_hours`.
    - `hard` boolean, required: Whether the allocation is a Hard Allocation (“true”) or Soft (“false”). This value must be set to `false` if you are including any unnamed resources in your request.
    - `occurrence` object, required: The timeframe of scheduled hours in which to create allocations for.
      - `type` 'anytime' | 'after' | 'before' | 'between', required: The timeframe in which to allocate the scheduled hours. Accepted values are `anytime`, `after`, `before`, and `between`.
      - `after_date` string, date-time: Sets the date on and after which the scheduled hours will be distributed as allocations. This value must be provided when the `type` is `after`. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.
      - `before_date` string, date-time: Sets the date on and before which the scheduled hours will be distributed as allocations. This value must be provided when the `type` is `before`. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.
      - `start_date` string, date-time: Sets the start of the date range which the scheduled hours will be distributed as allocations. This value must be provided when the `type` is `between`. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.
      - `end_date` string, date-time: Sets the end of the date range which the scheduled hours will be distributed as allocations. This value must be provided when the `type` is `between`. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

## Response `200`

Workspace Resource has been created.

- object
  - `success` boolean: Indicates if workspace allocations were created.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized request
- `403`: Forbidden request
- `404`: Page Not Found
- `422`: Unprocessable Entity
- `503`: Service is unavailable

---

[API](https://skmtc.dev/kantata/apis/kantata-ox-api-documentation.md) - [All operations](https://skmtc.dev/kantata/apis/kantata-ox-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/kantata/apis/kantata-ox-api-documentation/revisions/9d4ebed2fa98?raw)
