v1

latestOpenAPI 3.0.02026-07-24161215397.4 KB
Assignments

Create an assignment

Assign a resource to a membership for a given period. Validations (resource availability, no overlapping assignments) are enforced by the backend.

Required scopes: flex.space.assignments.create

post/api/v2/organizations/{orgSlug}/assignments

Path parameters

orgSlugstring required

organization slug

Request body

resourcestring required

The _id of the resource to assign.

membershipstring required

The _id of the membership to assign the resource to.

startDatestring required

The start date of the assignment (ISO 8601).

endDatestring

The end date of the assignment (ISO 8601). Optional for open-ended assignments.

Example request

{
  "resource": "61f2736224071037dea8956c",
  "membership": "6262b4de9d02c386771e3923",
  "startDate": "2024-08-21T00:00:00.000Z",
  "endDate": "2024-12-31T23:59:59.999Z"
}

Response

_idstring

The _id of the assignment.

resourcestring

The _id of the resource with which the assignment is associated.

membershipstring

The _id of the membership with which the assignment is associated.

startDatestring date-time

The start date of the assignment.

endDatestring date-time

The end date of the assignment.

Example response

{
  "_id": "61f273a906afd1846de1fbb3",
  "resource": "61f2736224071037dea8956c",
  "membership": "6262b4de9d02c386771e3923",
  "startDate": "2024-08-21T16:00:00.000Z",
  "endDate": "2024-08-21T16:00:00.000Z"
}