Skip to content

Assignments

Manage FTE allocations that link people (employees, contractors, vacancies) to teams and projects. Assignments are the core mechanism for workforce allocation -- they define how much of each person's capacity flows to each team or project over a specific time period.

New to Flowstate?

Read the Domain Model to understand how assignments connect the workforce to organizational structure and project work.

Concepts

Assignment Types

Flowstate uses a unified assignment model with four sub-resources:

Sub-resourceFromToDescription
/assignments/employeesEmployeeTeam or ProjectEmployee allocation
/assignments/contractorsContractorTeam or ProjectContractor allocation
/assignments/vacanciesVacancyTeam or ProjectVacancy allocation
/assignments/teamsTeamProjectTeam-to-project allocation

Request vs. Response Fields

Important: Request and response schemas differ

When creating an assignment, provide either teamId or projectId (not both) to specify the target.

In the response, the API returns a normalized type field ("team" or "project") and a targetId field (the ID of the team or project) for uniform consumption.

This means: you send teamId or projectId in the request, but you read type + targetId in the response.

FTE (Full-Time Equivalent)

The fte field is a decimal representing the proportion of a full-time person:

  • 1.0 = full-time on this assignment
  • 0.5 = half-time
  • 0.2 = one day per week

An employee's total FTE across all assignments can exceed 1.0 (indicating overallocation). The valid range per assignment is 0 to 10.

Time-Bounded Records

All assignments have startDate and endDate fields. The assignment is active for any date where startDate <= date <= endDate. An endDate of null means the assignment is ongoing.


Assignment Response Object

This is the shape returned by all employee, contractor, and vacancy assignment endpoints.

FieldTypeDescription
idstringUnique identifier (CUID format). System-generated. Read-only.
typestring"team" or "project" -- whether this assignment targets a team or project.
targetIdstringID of the target team or project.
ftenumberFTE allocation. 1.0 = full-time on this assignment.
startDatedate (YYYY-MM-DD)Assignment start date (inclusive).
endDatedate (YYYY-MM-DD) | nullAssignment end date (inclusive). null = ongoing.
createdAtdatetime (ISO 8601)When the record was created. Read-only.
updatedAtdatetime (ISO 8601)When the record was last modified. Read-only.

Employee Assignments

Endpoints

MethodPathDescription
GET/org/:orgId/assignments/employeesList employee assignments
GET/org/:orgId/assignments/employees/:idGet assignment
POST/org/:orgId/assignments/employeesCreate assignment
PATCH/org/:orgId/assignments/employees/:idUpdate assignment
DELETE/org/:orgId/assignments/employees/:idDelete assignment

List Employee Assignments

GET /org/:orgId/assignments/employees

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-based).
limitinteger20Records per page. Min 1, max 100.
employeeIdstring--Filter by employee ID.
targetIdstring--Filter by target team or project ID.
typestring--Filter by type: "team" or "project".
sortBystringstartDateField to sort by.
sortDirstringascasc or desc.
scenarioIdstring--Scenario ID for what-if queries.

Example Request

bash
curl -X GET "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/assignments/employees?employeeId=clx1a2b3c4d5e6f7g8h9&type=team" \
  -H "Authorization: Bearer private_..."

Example Response

json
{
  "data": [
    {
      "id": "clx8a9b0c1d2e3f4g5h6",
      "type": "team",
      "targetId": "clx6t7u8v9w0x1y2z3a4",
      "fte": 0.6,
      "startDate": "2025-01-01",
      "endDate": null,
      "createdAt": "2024-12-15T10:00:00Z",
      "updatedAt": "2025-06-01T14:00:00Z"
    },
    {
      "id": "clx9b0c1d2e3f4g5h6i7",
      "type": "team",
      "targetId": "clx3d4e5f6g7h8i9j0k1",
      "fte": 0.4,
      "startDate": "2025-01-01",
      "endDate": null,
      "createdAt": "2024-12-15T10:00:00Z",
      "updatedAt": "2025-06-01T14:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 2,
    "hasNextPage": false
  }
}

Create Employee Assignment

POST /org/:orgId/assignments/employees

Create Request Body

FieldTypeRequiredDescription
employeeIdstringYesID of the employee to assign.
teamIdstring | nullConditionalTarget team ID. Provide either teamId or projectId, not both.
projectIdstring | nullConditionalTarget project ID. Provide either teamId or projectId, not both.
ftenumberYesFTE allocation (0--10). 1.0 = full-time.
startDatedate (YYYY-MM-DD)YesAssignment start date.
endDatedate (YYYY-MM-DD) | nullNoAssignment end date. null = ongoing.
rolestring | nullNoRole within this assignment (e.g. "Tech Lead", "IC"). Distinct from the employee's job role.

Example: Assign Employee to a Team

bash
curl -X POST "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/assignments/employees" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "employeeId": "clx1a2b3c4d5e6f7g8h9",
    "teamId": "clx6t7u8v9w0x1y2z3a4",
    "fte": 0.6,
    "startDate": "2026-04-01"
  }'

Example: Assign Employee to a Project

bash
curl -X POST "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/assignments/employees" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "employeeId": "clx1a2b3c4d5e6f7g8h9",
    "projectId": "clx7p8r9q0s1t2u3v4w5",
    "fte": 0.5,
    "startDate": "2026-04-01",
    "endDate": "2026-09-30",
    "role": "Tech Lead"
  }'

Example Response

json
{
  "data": {
    "id": "clx2n3o4p5q6r7s8t9u0",
    "type": "project",
    "targetId": "clx7p8r9q0s1t2u3v4w5",
    "fte": 0.5,
    "startDate": "2026-04-01",
    "endDate": "2026-09-30",
    "createdAt": "2026-04-08T10:00:00Z",
    "updatedAt": "2026-04-08T10:00:00Z"
  }
}

Status: 201 Created

Update Employee Assignment

PATCH /org/:orgId/assignments/employees/:id

Update Request Body

FieldTypeRequiredDescription
ftenumberNoUpdated FTE allocation (0--10).
startDatedate (YYYY-MM-DD)NoUpdated start date.
endDatedate (YYYY-MM-DD) | nullNoUpdated end date. Set null to make ongoing.
rolestring | nullNoUpdated role within this assignment.
bash
curl -X PATCH "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/assignments/employees/clx8a9b0c1d2e3f4g5h6" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "fte": 0.8,
    "endDate": "2026-12-31"
  }'

Delete Employee Assignment

DELETE /org/:orgId/assignments/employees/:id

Status: 204 No Content


Contractor Assignments

Endpoints

MethodPathDescription
GET/org/:orgId/assignments/contractorsList contractor assignments
GET/org/:orgId/assignments/contractors/:idGet assignment
POST/org/:orgId/assignments/contractorsCreate assignment
PATCH/org/:orgId/assignments/contractors/:idUpdate assignment
DELETE/org/:orgId/assignments/contractors/:idDelete assignment

Create Request Body

FieldTypeRequiredDescription
contractorIdstringYesID of the contractor to assign.
teamIdstring | nullConditionalTarget team ID. Provide either teamId or projectId.
projectIdstring | nullConditionalTarget project ID. Provide either teamId or projectId.
ftenumberYesFTE allocation (0--10).
startDatedate (YYYY-MM-DD)YesAssignment start date.
endDatedate (YYYY-MM-DD) | nullNoAssignment end date. null = ongoing.
rolestring | nullNoRole within this assignment.

Example: Create Contractor Assignment

bash
curl -X POST "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/assignments/contractors" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "contractorId": "clx4c5d6e7f8g9h0i1j2",
    "teamId": "clx6t7u8v9w0x1y2z3a4",
    "fte": 1.0,
    "startDate": "2026-04-01",
    "endDate": "2026-09-30"
  }'

Update Request Body

FieldTypeRequiredDescription
ftenumberNoUpdated FTE allocation (0--10).
startDatedate (YYYY-MM-DD)NoUpdated start date.
endDatedate (YYYY-MM-DD) | nullNoUpdated end date. Set null to make ongoing.
rolestring | nullNoUpdated role.

Vacancy Assignments

Endpoints

MethodPathDescription
GET/org/:orgId/assignments/vacanciesList vacancy assignments
GET/org/:orgId/assignments/vacancies/:idGet assignment
POST/org/:orgId/assignments/vacanciesCreate assignment
PATCH/org/:orgId/assignments/vacancies/:idUpdate assignment
DELETE/org/:orgId/assignments/vacancies/:idDelete assignment

Create Request Body

FieldTypeRequiredDescription
vacancyIdstringYesID of the vacancy to assign.
teamIdstring | nullConditionalTarget team ID. Provide either teamId or projectId.
projectIdstring | nullConditionalTarget project ID. Provide either teamId or projectId.
ftenumberNoFTE allocation (0--10). Default: 1.0.
startDatedate (YYYY-MM-DD)YesAssignment start date.
endDatedate (YYYY-MM-DD) | nullNoAssignment end date. null = ongoing.
rolestring | nullNoRole within this assignment.

Example: Create Vacancy Assignment

bash
curl -X POST "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/assignments/vacancies" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "vacancyId": "clx5v6w7x8y9z0a1b2c3",
    "teamId": "clx6t7u8v9w0x1y2z3a4",
    "fte": 1.0,
    "startDate": "2026-06-01"
  }'

Update Request Body

FieldTypeRequiredDescription
ftenumberNoUpdated FTE allocation (0--10).
startDatedate (YYYY-MM-DD)NoUpdated start date.
endDatedate (YYYY-MM-DD) | nullNoUpdated end date. Set null to make ongoing.
rolestring | nullNoUpdated role.

When a vacancy is filled

When you fill a vacancy via POST /vacancies/:id/fill, all vacancy assignments are automatically transferred to the new employee. You do not need to manually recreate them. See Fill a Vacancy.


Team-to-Project Assignments

Endpoints

MethodPathDescription
GET/org/:orgId/assignments/teamsList team-project assignments
GET/org/:orgId/assignments/teams/:idGet assignment
POST/org/:orgId/assignments/teamsCreate assignment
PATCH/org/:orgId/assignments/teams/:idUpdate assignment
DELETE/org/:orgId/assignments/teams/:idDelete assignment

Team-to-project assignments represent the portion of a team's capacity allocated to a project.

Team Assignment Response Object

FieldTypeDescription
idstringUnique identifier (CUID format). System-generated. Read-only.
targetIdstringID of the target project.
ftenumberFTE allocation of the team to this project.
startDatedate (YYYY-MM-DD)Allocation start date.
endDatedate (YYYY-MM-DD) | nullAllocation end date. null = ongoing.
createdAtdatetime (ISO 8601)Read-only.
updatedAtdatetime (ISO 8601)Read-only.

Create Request Body

FieldTypeRequiredDescription
teamIdstringYesID of the team to allocate.
projectIdstringYesID of the project to allocate the team to.
ftenumberYesFTE allocation (0--10).
startDatedate (YYYY-MM-DD)YesAllocation start date.
endDatedate (YYYY-MM-DD) | nullNoAllocation end date. null = ongoing.
rolestring | nullNoTeam's role on this project (e.g. "Primary", "Support").
costCategorystring | nullNoCost categorisation for this allocation (e.g. "CapEx", "OpEx").

Update Request Body

FieldTypeRequiredDescription
ftenumberNoUpdated FTE allocation (0--10).
startDatedate (YYYY-MM-DD)NoUpdated start date.
endDatedate (YYYY-MM-DD) | nullNoUpdated end date. Set null to make ongoing.
rolestring | nullNoUpdated role.
costCategorystring | nullNoUpdated cost categorisation.

Example: Create Team-to-Project Assignment

bash
curl -X POST "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/assignments/teams" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "teamId": "clx6t7u8v9w0x1y2z3a4",
    "projectId": "clx7p8r9q0s1t2u3v4w5",
    "fte": 0.5,
    "startDate": "2026-01-15",
    "endDate": "2026-09-30",
    "costCategory": "CapEx"
  }'

Example Response

json
{
  "data": {
    "id": "clx1t2p3a4s5g6n7h8i9",
    "targetId": "clx7p8r9q0s1t2u3v4w5",
    "fte": 0.5,
    "startDate": "2026-01-15",
    "endDate": "2026-09-30",
    "createdAt": "2026-04-08T10:00:00Z",
    "updatedAt": "2026-04-08T10:00:00Z"
  }
}

Status: 201 Created


Error Responses

Validation Error (400)

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed.",
    "details": [
      { "field": "employeeId", "message": "employeeId is required" },
      { "field": "teamId", "message": "Provide either teamId or projectId, not both" }
    ],
    "errorId": "err_clx9a8b7c6d5e4f3"
  }
}

Not Found (404)

json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Assignment not found.",
    "errorId": "err_clx9a8b7c6d5e4f3"
  }
}

  • Employees -- The people being assigned.
  • Contractors -- External workers being assigned.
  • Vacancies -- Planned hires being assigned.
  • Teams -- Assignment targets and sources.
  • Projects -- Assignment targets.
  • Recipes -- Step-by-step guides for common assignment workflows.

Flowstate Documentation