Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions descriptions/0/api.intercom.io.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21280,6 +21280,161 @@ paths:
message: Access Token Invalid
schema:
"$ref": "#/components/schemas/error"
put:
summary: Update a team's members
parameters:
- name: Intercom-Version
in: header
schema:
"$ref": "#/components/schemas/intercom_version"
- name: id
in: path
required: true
description: The unique identifier of a given team.
example: '123'
schema:
type: string
tags:
- Teams
operationId: updateTeam

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateTeam is the natural generated name for a general team update (client.teams.update), but this operation writes membership only — name, distribution_method and the priority fields are all rejected with a 400.

Once SDKs generate from this the name is claimed, and the team CRUD endpoint that Part 2 of #556134 scopes can't have it without a breaking rename. Something like updateTeamMembers leaves that room.

~ Automated via Claude

description: |-
You can replace the set of teammates who belong to a team. Send the full list of
teammates the team should end up with — any teammate currently on the team and
missing from the list is removed. This makes the endpoint safe to call on a
schedule to keep Intercom in step with an external rota or workforce management
system, since sending an unchanged list makes no changes at all.

A token that acts on behalf of a teammate carries that teammate's permissions:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec no longer parses. YAML.load_file on this branch fails with mapping values are not allowed in this context at line 21307 column 86, while origin/main parses cleanly.

The cause is the trailing : at the end of this line: inside a plain (unquoted) multi-line scalar, a colon at end-of-line terminates the scalar and YAML reads it as a mapping key.

Making the description a block scalar (description: >-) or rewording so the line doesn't end in a colon both fix it.

~ Automated via Claude

they must be able to manage teams, and any team or teammate their access is
restricted from remains out of reach here.
requestBody:
content:
application/json:
examples:
successful:
value:
admin_ids:
- 493881
- 493882
schema:
"$ref": "#/components/schemas/update_team_request"
responses:
'200':
description: successful
content:
application/json:
examples:
successful:
value:
type: team
id: '991267902'
name: team 1
admin_ids:
- 493881
- 493882
schema:
"$ref": "#/components/schemas/team"
'400':
description: Bad request
content:
application/json:
examples:
Invalid admin ids:
value:
type: error.list
request_id: 8ba1e2a4-3d6f-4a1e-9c07-52c8f5b0d1aa
errors:
- code: parameter_invalid
message: admin_ids must contain only numeric admin ids
Field cannot be updated:
value:
type: error.list
request_id: 1c9d6f0b-7a24-4b8e-9f31-3e5a2c6b8d70
errors:
- code: parameter_invalid
message: Only admin_ids can be updated on a team, but the request
also set name
schema:
"$ref": "#/components/schemas/error"
'403':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both examples under this 403 use code: forbidden, but the implementation returns a 403 with a different code as well: api_plan_restricted, from raise_feature_unavailable in app/commands/api/v3/team_memberships/update.rb when the feature flag is off.

Since the flag starts off everywhere, that's the first 403 most callers will actually see — and the one they need to branch on to tell "not enabled for this workspace" from "not permitted". Worth documenting alongside the two forbidden cases.

~ Automated via Claude

description: Forbidden
content:
application/json:
examples:
Forbidden:
value:
type: error.list
request_id: 4dd0f4f7-2d4b-4d2f-8b98-cf1e7ba1b2c5
errors:
- code: forbidden
message: You don't have permission to update the members of
this team
Cannot manage teams:
value:
type: error.list
request_id: 6b2c8e1d-4f39-4d70-8a52-9c7e1f3b0a44
errors:
- code: forbidden
message: You don't have permission to manage teams in this workspace
schema:
"$ref": "#/components/schemas/error"
'404':
description: Team not found
content:
application/json:
examples:
Team not found:
value:
type: error.list
request_id: 9a3e0b1c-6f27-4f5e-8c31-0f2f4a7d9e88
errors:
- code: team_not_found
message: Team not found
schema:
"$ref": "#/components/schemas/error"
'409':
description: |-
Another request is already changing this team's members. Two cases are
distinguished by the message: the request was declined before anything was
written, so the team is unchanged and the same request can simply be sent
again; or the members kept changing while the request was being applied, so
it is partly applied and the team should be read again before retrying.
content:
application/json:
examples:
Conflict:
value:
type: error.list
request_id: 5e7a0c3f-8b16-4d92-a7c4-2f8b6d0e9137
errors:
- code: conflict
message: The members of this team are being changed by another
request. Try again.
Partly applied:
value:
type: error.list
request_id: 5e7a0c3f-8b16-4d92-a7c4-2f8b6d0e9137
errors:
- code: conflict
message: The members of this team kept being changed by other
requests, so this one is partly applied. Read the team and
try again.
schema:
"$ref": "#/components/schemas/error"
'401':
description: Unauthorized
content:
application/json:
examples:
Unauthorized:
value:
type: error.list
request_id: 6c1e2f83-5b47-4f0e-9d8a-3b2c1e4f7a90
errors:
- code: unauthorized
message: Access Token Invalid
schema:
"$ref": "#/components/schemas/error"
"/ticket_states":
get:
summary: List all ticket states
Expand Down Expand Up @@ -40497,6 +40652,37 @@ components:
- url
- locale
- source_id
update_team_request:
description: |
The request payload for updating a team's membership.
`admin_ids` is the complete set of teammates who should be on the team once
the request completes, not a list of changes to apply. Any teammate currently
on the team but absent from `admin_ids` is removed.

Membership is the only part of a team this endpoint writes, and `admin_ids` must
be sent in the request body rather than the query string. A team read from the
API can be sent back whole: the other fields of the representation are accepted
as long as they are unchanged. Trying to change one of them returns a 400 rather
than being ignored, as does any field a team does not have.

On a team that balances assignment across its members, teammates already on the
team keep their current priority level and teammates being added join as primary
members. Priority levels cannot be set through this endpoint, so
`admin_priority_level` is accepted and disregarded — it follows from `admin_ids`.
type: object
title: Update Team Request Payload
properties:
admin_ids:
type: array
description: The ids of every teammate who should be a member of the team.
Must contain at least one id, and no more than 1000.
items:
type: integer
example:
- 493881
- 493882
required:
- admin_ids
update_ticket_request:
description: You can update a Ticket
type: object
Expand Down