Docs
Add Resource
POST /procurements/{procurementId}/resources
POST
/procurements/{procurementId}/resourcesRequired Tokens
| Field | Type | Required | Description |
|---|---|---|---|
| Bearer | Authorization: Bearer <api-key> | Optional | Your API key. Pass it as the Bearer token on every request. |
| Event token | x-Event-Token | Optional | Run **Get Tokens** in the Authorization folder, or call `GET /Events/{eventId}/authorize` manually. |
Adds a need to a procurement. Required Variant-role attribute values must be present.
Event scoping: This endpoint does not include
{eventId} in the URL. The event is determined automatically from your x-Event-Token.Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| procurementId | Guid | Required | The procurement. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| resourceTypeId | Guid | Required | The resource type. |
| quantity | decimal | Required | Quantity. A composite's must be a whole number of at least 1. |
| areaId | Guid? | Optional | Area context (non-scheduled needs). |
| collaboratorId | Guid? | Optional | Collaborator context (non-scheduled needs). |
| rateCardId | Guid? | Optional | One of the type's own cards. |
| ruleSetIds | Guid[] | Optional | Rule sets governing the need. `[]` for none. |
| groupId | Guid? | Optional | A group on this procurement. |
| owner | Guid? | Optional | Owning department. Omitted seeds from the type's `defaultOwner`. |
| attributeValues | array | Optional | `{ resourceAttributeId, value }`: values for attributes placed on the type and active on Procurement. A `Select` value is the option id. |
Composite types
A resource type whose trackingType is Composite fans out: the need is created as the composite parent, plus one component need per slot the parent's inferred variant keeps. Each component need's quantity is the parent's quantity times the slot's quantity, and it is born with no schedule blocks. rateCardId and ruleSetIds apply to the parent only.
Response
201 Created with this body for every need. children is empty unless the type is a composite.
{
"id": "<parent need id>",
"children": [
{
"id": "<component need id>",
"componentId": "<slot id>",
"componentLabel": "Driver",
"resourceTypeId": "<target type id>",
"quantity": 2,
"allowedResourceVariantIds": []
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Guid | The new need (the composite parent, for a composite). |
| children | array | One per component need created by the fan-out. |
| children[].id | Guid | The component need. |
| children[].componentId | Guid | The composite's slot it fills. |
| children[].componentLabel | string | The slot's label. |
| children[].resourceTypeId | Guid | The slot's effective target type. |
| children[].quantity | decimal | Parent quantity times the slot's quantity. |
| children[].allowedResourceVariantIds | Guid[] | Empty = any, one = pinned, several = alternatives (the first is seeded). |
Error Codes
| HTTP Status | Description |
|---|---|
| 400 | A missing required variant value, a composite with a fractional or zero quantity, or a composite type with no components. |
| 404 | Procurement or resource type not found. |