---
title: "Create an assignment"
method: POST
path: "/api/v2/organizations/{orgSlug}/assignments"
tags: ["Assignments"]
---

# Create an assignment

`POST /api/v2/organizations/{orgSlug}/assignments`

## Request

- Base URL: `https://app.officernd.com`
- URL: `https://app.officernd.com/api/v2/organizations/{orgSlug}/assignments`
- Auth: OAuth 2
  - Authorization code: `https://identity.officernd.com/auth/authorize`
  - Client credentials
  - Token URL: `https://identity.officernd.com/auth/token` scopes: `flex.space.assignments.create`

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`

## Path parameters

- `orgSlug` string, required

## Request body

- CreateAssignmentDto
  - `resource` string, required: The _id of the resource to assign.
  - `membership` string, required: The _id of the membership to assign the resource to.
  - `startDate` string, required: The start date of the assignment (ISO 8601).
  - `endDate` string: The end date of the assignment (ISO 8601). Optional for open-ended assignments.

## Response `201`

- AssignmentResultDto
  - `_id` string: The _id of the assignment.
  - `resource` string: The _id of the resource with which the assignment is associated.
  - `membership` string: The _id of the membership with which the assignment is associated.
  - `startDate` string, date-time: The start date of the assignment.
  - `endDate` string, date-time: The end date of the assignment.

---

[API](https://skmtc.dev/officernd/apis/space-api.md) - [All operations](https://skmtc.dev/officernd/apis/space-api/llms.txt) - [OpenAPI document](https://skmtc.dev/officernd/apis/space-api/revisions/f7e2e1e4ba60?raw)
