# Teams

Teams, their members and the projects they contribute to.

## List teams

`GET /orgs/{org}/teams`

Scope: `people:read`

The organisation's teams, as the Teams directory lists them: active ones, or archived=true for the archived. Filter by text, type, a member or a project the team contributes to. Guests see no teams (403 refused).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]

### Query parameters

- `limit` (integer): How many items a page holds, 1 to 200. [from 1 to 200; default 50]
- `cursor` (string): The next_cursor of the previous page; leave it out for the first page. [at most 1000 characters]
- `count` (string): true adds total, the number of items in the whole list. [one of: true, false]
- `q` (string): Text in the team's name. [at most 255 characters]
- `type` (string) [one of: official, team]
- `archived` (string): true lists archived teams only. [one of: true, false]
- `member` (string): Only teams this person is on (id or email). [1 to 320 characters]
- `mine` (string): true: only teams the token's person is on. [one of: true, false]
- `project` (string): Only teams contributing to this project. [1 to 60 characters]
- `sort` (string): name (the default), created_at or id; - for descending. [at most 100 characters]
- `fields` (string): Only these fields, comma-separated: id, name, description, type, joining, icon, member_count, is_member, archived, archived_at, parent, created_at. id always comes; the fields not asked for are left out, required or not.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/teams" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
      "name": "Platform",
      "description": "Keeps the lights on.",
      "type": "official",
      "joining": "invite",
      "icon": "shield",
      "member_count": 3,
      "is_member": true,
      "archived": false,
      "archived_at": null,
      "parent": null,
      "created_at": "2026-11-20T08:00:00.000Z"
    }
  ],
  "next_cursor": null
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Create a team

`POST /orgs/{org}/teams`

Scope: `people:admin`

Makes a team, as Teams > Create team does: any member may (official teams: owners and admins). The token's person is on it; members are added by id or email (no guests). A name already taken is 409 conflict.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]

### Headers

- `Idempotency-Key` (string): A unique key (such as a uuid): the same key and body within 24 hours gets the first answer again without a second create; another body gets 422. [1 to 200 characters]

### Body

- `name` (string, required) [at most 1020 characters]
- `description` (string) [at most 16000 characters]
- `type` (string): official: owners and admins only. [one of: official, team]
- `joining` (string) [one of: open, invite]
- `icon` (string) [one of: users, rocket, code, palette, megaphone, wrench, shield, heart, briefcase, globe, lightbulb, flask]
- `members` (array of string) [at most 100 items]
- `parent` (string (uuid) or null): The parent team's id.

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/teams" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "type": "official",
  "joining": "open",
  "icon": "users",
  "members": [
    "string"
  ],
  "parent": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10"
}'
```

### Answer: 201

```json
{
  "id": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
  "name": "Platform",
  "description": "Keeps the lights on.",
  "type": "official",
  "joining": "invite",
  "icon": "shield",
  "member_count": 3,
  "is_member": true,
  "archived": false,
  "archived_at": null,
  "parent": null,
  "created_at": "2026-11-20T08:00:00.000Z"
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `conflict`: conflict: The thing changed since it was read, or the change clashes with its state. archived: The item (or its project) is archived, so it can't be changed.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 422 `idempotency_key_reused`: idempotency_key_reused: The same Idempotency-Key was sent within 24 hours with a different body.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Get a team

`GET /orgs/{org}/teams/{team}`

Scope: `people:read`

One team. Guests see no teams (403 refused).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Query parameters

- `fields` (string): Only these fields, comma-separated: id, name, description, type, joining, icon, member_count, is_member, archived, archived_at, parent, created_at. id always comes; the fields not asked for are left out, required or not.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
  "name": "Platform",
  "description": "Keeps the lights on.",
  "type": "official",
  "joining": "invite",
  "icon": "shield",
  "member_count": 3,
  "is_member": true,
  "archived": false,
  "archived_at": null,
  "parent": null,
  "created_at": "2026-11-20T08:00:00.000Z"
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Change a team

`PATCH /orgs/{org}/teams/{team}`

Scope: `people:admin`

Changes a team's name, description, joining, icon or type: its members and organisation admins may (type: admins only). An archived team can't be changed (409 archived).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Body

- `name` (string) [at most 1020 characters]
- `description` (string) [at most 16000 characters]
- `type` (string): official: owners and admins only. [one of: official, team]
- `joining` (string) [one of: open, invite]
- `icon` (string) [one of: users, rocket, code, palette, megaphone, wrench, shield, heart, briefcase, globe, lightbulb, flask]

### Request

```sh
curl -X PATCH "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "type": "official",
  "joining": "open",
  "icon": "users"
}'
```

### Answer: 200

```json
{
  "id": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
  "name": "Platform",
  "description": "Keeps the lights on.",
  "type": "official",
  "joining": "invite",
  "icon": "shield",
  "member_count": 3,
  "is_member": true,
  "archived": false,
  "archived_at": null,
  "parent": null,
  "created_at": "2026-11-20T08:00:00.000Z"
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `conflict`: conflict: The thing changed since it was read, or the change clashes with its state. archived: The item (or its project) is archived, so it can't be changed.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Delete a team

`DELETE /orgs/{org}/teams/{team}`

Scope: `people:admin`

Deletes a team for good (its members; an official team: admins). Tasks whose Team it was keep no team.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Request

```sh
curl -X DELETE "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 204

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Archive a team

`POST /orgs/{org}/teams/{team}/archive`

Scope: `people:admin`

Archives a team (its members; an official team: admins). An archived team can't be changed or picked.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/archive" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
  "name": "Platform",
  "description": "Keeps the lights on.",
  "type": "official",
  "joining": "invite",
  "icon": "shield",
  "member_count": 3,
  "is_member": true,
  "archived": false,
  "archived_at": null,
  "parent": null,
  "created_at": "2026-11-20T08:00:00.000Z"
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Restore a team

`POST /orgs/{org}/teams/{team}/restore`

Scope: `people:admin`

Restores an archived team (its members; an official team: admins).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/restore" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
  "name": "Platform",
  "description": "Keeps the lights on.",
  "type": "official",
  "joining": "invite",
  "icon": "shield",
  "member_count": 3,
  "is_member": true,
  "archived": false,
  "archived_at": null,
  "parent": null,
  "created_at": "2026-11-20T08:00:00.000Z"
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## List a team's members

`GET /orgs/{org}/teams/{team}/members`

Scope: `people:read`

The team's members by name (every member of the organisation sees them).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/members" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "8d0e5f7a-1c2b-4d3e-8f9a-0b1c2d3e4f5a",
      "name": "Priya Shah",
      "added_at": "2026-11-20T08:00:00.000Z"
    }
  ],
  "next_cursor": null
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Add people to a team

`POST /orgs/{org}/teams/{team}/members`

Scope: `people:admin`

Adds people (by id or email; never guests) to a team: its members and organisation admins may. People already on it stay.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Body

- `people` (array of string, required) [1 to 100 items]

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/members" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "people": [
    "string"
  ]
}'
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10",
      "name": "string",
      "added_at": "2026-12-01T09:30:00Z"
    }
  ],
  "next_cursor": "string",
  "total": 1
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `archived`: archived: The item (or its project) is archived, so it can't be changed.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Remove someone from a team

`DELETE /orgs/{org}/teams/{team}/members/{person}`

Scope: `people:admin`

Takes a person off a team: anyone may leave; its members and organisation admins take others off.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.
- `person` (string, required): The person's id, or their email address. [1 to 320 characters]

### Request

```sh
curl -X DELETE "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/members/{person}" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 204

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `archived`: archived: The item (or its project) is archived, so it can't be changed.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## List a team's projects

`GET /orgs/{org}/teams/{team}/projects`

Scope: `people:read`

The projects the team contributes to that the token's person can open (others are left out, as if not there).

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `team` (string (uuid), required): The team's id.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/teams/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/projects" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10",
      "key": "string",
      "name": "string"
    }
  ],
  "next_cursor": "string",
  "total": 1
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).
