Skip to main content

Teams API

Teams endpoints exposed by the Devotel CPaaS API Base path: /api/v1/teams Endpoint count: 7

title: “Worked request and response samples” description: “Worked samples for the chain team tooling calls first: create a team, page its members, and update routing availability — plus the one error write-path clients hit on create, the duplicate-name 409.”

Worked request and response samples

Copy a request as written, substitute your own team and member ids, and compare the response envelope. Successful writes return { data, meta }; failures return the { error, meta } envelope. The retry-vs-surface matrix for every class sits at the bottom of this page. Teams back the routing-rule assign_team action: inbox and voice routing rules resolve a group to a load-balanced member from this roster. Reads below list the roster and its members; writes create and tune the group new rules point at.

Create a team

POST /api/v1/teams
Creates the group and returns the full team row in the 201 envelope. name must be unique within your workspace; active: false keeps the group out of routing assignment while you populate its members. Request
Response
Recreating the same name returns a 409 CONFLICT telling you the name is taken — pick a new name or PATCH the existing team instead of blind-retrying:
409

List members of a team

GET /api/v1/teams/{id}/members
Pages the roster oldest-first with keyset pagination. limit defaults to 25 and caps at 100; when meta.pagination.has_more is true, pass meta.pagination.cursor back as the cursor query parameter for the next page. total counts the whole team regardless of the cursor. Request
Response
Members are ordered oldest-first by (created_at, id), and active: false members stay listed but are skipped by load-balanced assignment. When total saturates the display cap (1,000), meta.pagination.total_capped: true is set so a UI can render “1,000+” — paging still walks every member via the cursor.

Update routing assignment availability

PATCH /api/v1/teams/{id}
Repauses the group. Setting active: false pulls the team out of routing-rule assign_team resolution without deleting it or its roster; flip it back to true to resume. Any subset of name, description, and active is accepted — unset fields are untouched. Request
Response

Errors worth branching on

These failures cover the create, member-list, and update calls above plus the invite (POST /api/v1/teams//members) they feed. Each block below is a full { error, meta } envelope as the API returns it, and the matrix at the bottom answers retry vs surface for the same classes. For the platform-wide decision table these branches plug into, see the error handling guide.

401 — Unauthorized

A 401 on this page is the bearer key failing before the route ran — it never means the resource is wrong. Rotate the key or re-mint the scoped token; retrying the same request changes nothing.

403 — Forbidden

A 403 means the key authenticated but the operation is gated by scope — check the key’s scopes on the developer page; a 403 is never a data-not-found shape. Team writes require the team:invite grant, which built-in roles hand to owners and admins.

422 — Schema

A 422 means the payload did not match the request schema — branch on error.details.field and resend a corrected body instead of blind-retrying the same one.

429 — Rate

The Retry-After header and error.details.retry_after are both set on every 429 — resend the SAME request after the lower of the two.

404 — Not found

A 404 on PATCH / DELETE means the team_* id does not exist in your workspace — re-list teams and branch on the current id rather than retrying the stale one.

60-second retry matrix


List teams for the current tenant

GET /api/v1/teams

List members of a team

GET /api/v1/teams/{id}/members
string
required
—
string
—
integer
—

Create a new team

POST /api/v1/teams
string
required
Display name for the team; must be unique within the workspace (1–120 characters).
string
Optional short description of the team’s purpose (up to 500 characters).
boolean
Whether the team is active and eligible for routing assignment. Defaults to true.

Add a member to a team

POST /api/v1/teams/{id}/members
string
required
—
string
required
Id of the workspace user to add to the team. Must belong to your workspace roster (1–120 characters).
boolean
Whether the member is active and eligible for load-balanced routing assignment. Defaults to true.

Update a team

PATCH /api/v1/teams/{id}
string
required
—

Delete a team

DELETE /api/v1/teams/{id}
string
required
—

Remove a member from a team

DELETE /api/v1/teams/{id}/members/{userId}
string
required
—
string
required
Obtain from GET /api/v1/organization/members.