Skip to content

Teams

Manage organizational teams and their hierarchy. Teams represent groups of employees and contractors who work together, and they can be arranged in a tree structure with parent-child relationships.

Team Object

FieldTypeDescription
idstringUnique identifier (CUID format). System-generated. Read-only.
externalIdstring | nullYour external identifier for this team. Unique within your organization. Use for lookups via path parameters.
namestringTeam display name (e.g. "Platform Engineering").
teamTypestring | nullClassification of the team (e.g. "engineering", "product", "design", "department"). Free-form text.
descriptionstring | nullWhat this team does and its responsibilities.
parentTeamIdstring | nullID of the parent team for hierarchical org structures. null = top-level team. References another Team.
managerUserIdstring | nullID of the Flowstate user who manages this team.
createdAtdatetime (ISO 8601)When the record was created. Read-only.
updatedAtdatetime (ISO 8601)When the record was last modified. Read-only.
customAttributesarrayCustom attribute values for this team. Returned on GET-by-ID. See Custom Attributes.

Endpoints

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

External ID Support

The :id path parameter accepts either a Flowstate CUID (e.g. clx1a2b3c4d5e6f7g8h9) or your externalId. The format is auto-detected.


List Teams

GET /org/:orgId/teams

Returns a paginated list of teams in the organization.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-based).
limitinteger20Records per page. Min 1, max 100.
searchstring--Free-text search by name or description.
sortBystringnameField to sort by.
sortDirstringascSort direction: asc or desc.
scenarioIdstring--Scenario ID for what-if queries.

Example Request

bash
curl -X GET "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/teams?sortBy=name&limit=50" \
  -H "Authorization: Bearer private_..."

Example Response

json
{
  "data": [
    {
      "id": "clx1e2n3g4r5o0t6u7v8",
      "externalId": null,
      "name": "Engineering",
      "teamType": "department",
      "description": "All engineering teams.",
      "parentTeamId": null,
      "managerUserId": "clx9u1s2e3r4t5y6",
      "createdAt": "2024-01-05T08:00:00Z",
      "updatedAt": "2025-09-01T10:00:00Z"
    },
    {
      "id": "clx6t7u8v9w0x1y2z3a4",
      "externalId": null,
      "name": "Platform Engineering",
      "teamType": "engineering",
      "description": "Core infrastructure and developer tools team.",
      "parentTeamId": "clx1e2n3g4r5o0t6u7v8",
      "managerUserId": null,
      "createdAt": "2024-01-10T08:00:00Z",
      "updatedAt": "2025-11-20T14:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 50,
    "total": 18,
    "hasNextPage": false
  }
}

Get Team

GET /org/:orgId/teams/:id

Returns a single team by ID.

Example Request

bash
curl -X GET "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/teams/clx6t7u8v9w0x1y2z3a4" \
  -H "Authorization: Bearer private_..."

Create Team

POST /org/:orgId/teams

Create Request Body

FieldTypeRequiredDescription
namestringYesTeam name.
externalIdstring | nullNoYour external identifier. Must be unique within the organization. Cannot resemble a CUID format. Max 255 characters.
teamTypestring | nullNoTeam classification (e.g. "engineering", "product").
descriptionstring | nullNoTeam description.
parentTeamIdstring | nullNoParent team ID. null = top-level team.
managerUserIdstring | nullNoFlowstate user ID of the team manager.

Update Request Body

All fields from Create are accepted, all optional. You can set or update the externalId field.

Example Request

bash
curl -X POST "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/teams" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Data Platform",
    "teamType": "engineering",
    "description": "Data infrastructure and analytics pipelines.",
    "parentTeamId": "clx1e2n3g4r5o0t6u7v8"
  }'

Status: 201 Created


Update Team

PATCH /org/:orgId/teams/:id

Updates one or more fields. Only include the fields you want to change. Set parentTeamId to null to make a team top-level.

Example Request

bash
curl -X PATCH "https://{tenant}.flowstate.inc/api/v1/org/{orgId}/teams/clx6t7u8v9w0x1y2z3a4" \
  -H "Authorization: Bearer private_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform & Infrastructure",
    "description": "Core infrastructure, developer tools, and cloud platform."
  }'

Delete Team

DELETE /org/:orgId/teams/:id

Deletes a team. Teams with active employee or contractor allocations cannot be deleted until those allocations are removed or reassigned.

Status: 204 No Content


Team Hierarchy

Teams support a single-parent hierarchy through the parentTeamId field. A team with parentTeamId: null is a top-level team. You can build the full tree client-side by following parentTeamId references.

Example hierarchy:

Engineering (parentTeamId: null)
  +-- Platform Engineering (parentTeamId: "clx1e2n3g4r5o0t6u7v8")
  +-- Product Engineering (parentTeamId: "clx1e2n3g4r5o0t6u7v8")
  |   +-- Payments Team
  |   +-- Growth Team
  +-- Data Platform (parentTeamId: "clx1e2n3g4r5o0t6u7v8")

External IDs

You can assign your own externalId during creation or update. This allows you to reference teams by your system's identifier instead of the Flowstate CUID.

  • Setting: Pass externalId in the POST or PATCH request body.
  • Lookups: Use the external ID directly in path parameters (e.g. GET /teams/MY-EXT-ID).
  • Uniqueness: External IDs must be unique per entity type within your organization.
  • Format restriction: External IDs cannot match the CUID format (25 lowercase alphanumeric characters starting with a letter).

Error Responses

Validation Error (400)

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed.",
    "details": [
      { "field": "name", "message": "name is required" }
    ],
    "errorId": "err_clx9a8b7c6d5e4f3"
  }
}

Not Found (404)

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

  • Assignments -- Assign employees, contractors, and vacancies to teams.
  • Projects -- Projects that teams can be allocated to.
  • Employees -- People who belong to teams via assignments.
  • Custom Attributes -- Manage custom fields on teams.

Flowstate Documentation