Skip to content

Commit f6529e7

Browse files
jsinghmokhaclaude
andcommitted
Document error responses and reserved names for section management APIs
- Add error response tables to create, update, delete, add-item, and move-item APIs covering 400/403/404/409/412/428. - Document the 409 Conflict "A section with this display name already exists." case and note that display name comparison is case-sensitive. - Document the reserved system-defined section names (RecentChats, QuickViews, TeamsAndChannels, MutedChats, MeetingChats, EngageCommunities) in the teamworkSection resource and the create/update property tables. - Fix the create-section request example to stop setting the read-only displayIcon.displayName property. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 303eeaa commit f6529e7

6 files changed

Lines changed: 79 additions & 15 deletions

File tree

api-reference/beta/api/teamworksection-delete.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ Don't supply a request body for this method.
4747

4848
If successful, this method returns a `204 No Content` response code. It doesn't return anything in the response body.
4949

50+
The following errors are possible.
51+
52+
| Response code | Message |
53+
|:---|:---|
54+
| `403 Forbidden` | This section is system-generated and cannot be modified. System-defined sections can't be deleted. |
55+
| `404 Not Found` | The specified section was not found. |
56+
| `412 Precondition Failed` | The `If-Match` header value doesn't match the current section hierarchy version. [List sections](userteamwork-list-sections.md) again to retrieve the current **@microsoft.graph.sectionsVersion** annotation and retry. |
57+
| `428 Precondition Required` | The `If-Match` header is required for this operation. |
58+
5059
## Examples
5160

5261
### Request

api-reference/beta/api/teamworksection-post-items.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,19 @@ If successful, this method returns a `201 Created` response code and a [teamwork
5757
> [!NOTE]
5858
> The response includes an updated **@odata.etag** value. Use this value as the `If-Match` header for any subsequent mutation operations.
5959
60-
This method can also return the following errors.
61-
62-
| Scenario | HTTP code | Error code | Message |
63-
|:---------|:----------|:-----------|:--------|
64-
| Item already exists in this section | `409 Conflict` | `conflict` | This item is already in this section. |
65-
| Item already exists in another user-defined section | `409 Conflict` | `conflict` | This item is already associated with another section. Use the [move](teamworksectionitem-move.md) API to relocate it. |
66-
| Maximum items per section reached | `400 Bad Request` | `badRequest` | The maximum number of items in this section is reached. |
67-
| Invalid item ID | `400 Bad Request` | `badRequest` | The specified item ID isn't valid. Provide a valid chat, channel, meeting, or community ID. |
68-
| ETag version mismatch | `412 Precondition Failed` | `preconditionFailed` | The resource was modified after it was last read. Read the latest version and retry. |
60+
The following errors are possible.
61+
62+
| Response code | Message |
63+
|:---|:---|
64+
| `400 Bad Request` | The 'id' property is required and must not be empty. |
65+
| `400 Bad Request` | The specified item ID is not valid. Provide a valid chat, channel, meeting, or community ID. |
66+
| `400 Bad Request` | The maximum number of items in this section has been reached. |
67+
| `403 Forbidden` | Access to this resource is denied. The caller must be a member of the conversation being added. |
68+
| `404 Not Found` | The specified section was not found. |
69+
| `409 Conflict` | This item is already in this section. |
70+
| `409 Conflict` | This item is already associated with another section. Use the [move](teamworksectionitem-move.md) API to relocate it. The response includes a `conflictingSectionId` detail with the ID of the section that currently holds the item. |
71+
| `412 Precondition Failed` | The `If-Match` header value doesn't match the current section hierarchy version. [List sections](userteamwork-list-sections.md) again to retrieve the current **@microsoft.graph.sectionsVersion** annotation and retry. |
72+
| `428 Precondition Required` | The `If-Match` header is required for this operation. |
6973

7074
## Examples
7175

api-reference/beta/api/teamworksection-update.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ In the request body, supply a JSON representation of only the properties to upda
4747
| Property | Type | Description |
4848
|:---------|:-----|:------------|
4949
| displayIcon | [sectionDisplayIcon](../resources/sectiondisplayicon.md) | The icon displayed for the section. |
50-
| displayName | String | The display name of the section. Maximum length is 50 characters. |
50+
| displayName | String | The display name of the section. Maximum length is 50 characters. Display names are case-sensitive and must be unique within a user's sections. The reserved system-defined names (`RecentChats`, `QuickViews`, `TeamsAndChannels`, `MutedChats`, `MeetingChats`, `EngageCommunities`) can't be used. |
5151
| isExpanded | Boolean | Indicates whether the section is expanded in the user interface. |
5252
| sortType | sectionSortType | The sort order of items in the section. The possible values are: `mostRecent`, `unreadThenMostRecent`, `nameAlphabetical`, `userDefinedCustomOrder`, `unknownFutureValue`. |
5353

@@ -64,7 +64,19 @@ If successful, this method returns a `200 OK` response code and an updated [team
6464
> [!NOTE]
6565
> The response includes an updated **@odata.etag** value. Use this value as the `If-Match` header for any subsequent mutation operations.
6666
67-
If the request specifies an unsupported **sortType** for the section type, this method returns a `400 Bad Request` response code. For more information, see the [Request body](#request-body) section.
67+
The following errors are possible.
68+
69+
| Response code | Message |
70+
|:---|:---|
71+
| `400 Bad Request` | At least one property must be provided for update. |
72+
| `400 Bad Request` | The 'displayName' property must not be empty or whitespace, or must not exceed 50 characters. |
73+
| `400 Bad Request` | The property '{propertyName}' is read-only or not updatable. Only **displayName**, **displayIcon**, **isExpanded**, and **sortType** can be updated. |
74+
| `400 Bad Request` | The specified sort type is not valid for this section. For more information, see the [Request body](#request-body) section. |
75+
| `403 Forbidden` | This section is system-generated and cannot be modified. Only the **sortType** property can be updated on system-defined sections. |
76+
| `404 Not Found` | The specified section was not found. |
77+
| `409 Conflict` | A section with this display name already exists. Returned when the requested **displayName** matches an existing user-defined section or a reserved system-defined section name. The comparison is case-sensitive. |
78+
| `412 Precondition Failed` | The `If-Match` header value doesn't match the current section hierarchy version. [List sections](userteamwork-list-sections.md) again to retrieve the current **@microsoft.graph.sectionsVersion** annotation and retry. |
79+
| `428 Precondition Required` | The `If-Match` header is required for this operation. |
6880

6981
## Examples
7082

api-reference/beta/api/teamworksectionitem-move.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ If successful, this action returns a `200 OK` response code and a [teamworkSecti
5757
> [!NOTE]
5858
> The response includes an updated **@odata.etag** value. Use this value as the `If-Match` header for any subsequent mutation operations.
5959
60+
The following errors are possible.
61+
62+
| Response code | Message |
63+
|:---|:---|
64+
| `400 Bad Request` | The 'targetSectionId' property is required and must not be empty. |
65+
| `400 Bad Request` | The source and target sections must be different. |
66+
| `403 Forbidden` | This section is system-generated and cannot be modified. Items can't be moved into or out of system-defined sections by using this action. |
67+
| `404 Not Found` | The specified section was not found, or the specified item was not found in this section. |
68+
| `412 Precondition Failed` | The `If-Match` header value doesn't match the current section hierarchy version. [List sections](userteamwork-list-sections.md) again to retrieve the current **@microsoft.graph.sectionsVersion** annotation and retry. |
69+
| `428 Precondition Required` | The `If-Match` header is required for this operation. |
70+
6071
## Examples
6172

6273
### Request

api-reference/beta/api/userteamwork-post-sections.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The following table lists the properties that you can set when you create a **te
4949
| Property | Type | Description |
5050
|:---------|:-----|:------------|
5151
| displayIcon | [sectionDisplayIcon](../resources/sectiondisplayicon.md) | The icon displayed for the section. Optional. The **skinTone** property of the icon can't be set and is derived from user settings. |
52-
| displayName | String | The display name of the section. Required. Maximum length is 50 characters. |
52+
| displayName | String | The display name of the section. Required. Maximum length is 50 characters. Display names are case-sensitive and must be unique within a user's sections. The following names are reserved for system-defined sections and can't be used: `RecentChats`, `QuickViews`, `TeamsAndChannels`, `MutedChats`, `MeetingChats`, `EngageCommunities`. |
5353
| isExpanded | Boolean | Indicates whether the section is expanded in the user interface. Optional. The default value is `true`. |
5454
| sortType | sectionSortType | The sort order of items in the section. Optional. The default value is `userDefinedCustomOrder`. The valid values for user-defined sections are: `mostRecent`, `unreadThenMostRecent`, `userDefinedCustomOrder`, `unknownFutureValue`. The `nameAlphabetical` member isn't valid for user-defined sections. |
5555

@@ -60,6 +60,20 @@ If successful, this method returns a `201 Created` response code and a [teamwork
6060
> [!NOTE]
6161
> The response includes an updated **@odata.etag** value. Use this value as the `If-Match` header for any subsequent mutation operations.
6262
63+
The following errors are possible.
64+
65+
| Response code | Message |
66+
|:---|:---|
67+
| `400 Bad Request` | The 'displayName' property is required and must not be empty. |
68+
| `400 Bad Request` | The 'displayName' property must not exceed 50 characters. |
69+
| `400 Bad Request` | The section display name contains invalid characters or format. |
70+
| `400 Bad Request` | The 'id', 'createdDateTime', 'lastModifiedDateTime', 'sectionType', or 'isHierarchicalViewEnabled' property is read-only and must not be provided when creating a section. |
71+
| `400 Bad Request` | The 'displayIcon.contentUrl' property is not supported, or the 'displayIcon.displayName' or 'displayIcon.skinTone' property is read-only and must not be provided. |
72+
| `400 Bad Request` | The maximum number of sections has been reached. |
73+
| `409 Conflict` | A section with this display name already exists. Returned when the requested **displayName** matches an existing user-defined section or one of the reserved system-defined section names (`RecentChats`, `QuickViews`, `TeamsAndChannels`, `MutedChats`, `MeetingChats`, `EngageCommunities`). The comparison is case-sensitive. |
74+
| `412 Precondition Failed` | The `If-Match` header value doesn't match the current section hierarchy version. [List sections](userteamwork-list-sections.md) again to retrieve the current **@microsoft.graph.sectionsVersion** annotation and retry. |
75+
| `428 Precondition Required` | The `If-Match` header is required for this operation. |
76+
6377
## Examples
6478

6579
### Request
@@ -79,8 +93,7 @@ If-Match: "1742515200"
7993
{
8094
"displayName": "Project Alpha",
8195
"displayIcon": {
82-
"iconType": "🚀",
83-
"displayName": "Rocket"
96+
"iconType": "🚀"
8497
},
8598
"sortType": "mostRecent"
8699
}

api-reference/beta/resources/teamworksection.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Represents a section in a user's Microsoft Teams chat list that organizes chats,
3333
|:---------|:-----|:------------|
3434
| createdDateTime | DateTimeOffset | Date and time when the section was created. Read-only. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2024, is `2024-01-01T00:00:00Z`. |
3535
| displayIcon | [sectionDisplayIcon](sectiondisplayicon.md) | The icon displayed for the section. |
36-
| displayName | String | The display name of the section. Required. Maximum length is 50 characters. |
36+
| displayName | String | The display name of the section. Required. Maximum length is 50 characters. Display names are case-sensitive and must be unique within a user's sections. The following names are reserved for system-defined sections and can't be used when creating a user-defined section: `RecentChats`, `QuickViews`, `TeamsAndChannels`, `MutedChats`, `MeetingChats`, `EngageCommunities`. |
3737
| id | String | The unique identifier for the section. Read-only. |
3838
| isExpanded | Boolean | Indicates whether the section is expanded in the user interface. The default value is `true`. |
3939
| isHierarchicalViewEnabled | Boolean | Indicates whether the hierarchical view is enabled for the section. Read-only. |
@@ -49,6 +49,21 @@ Represents a section in a user's Microsoft Teams chat list that organizes chats,
4949
| systemDefined | A section managed by the service that can't be deleted. Only the **sortType** property can be updated. |
5050
| unknownFutureValue | Evolvable enumeration sentinel value. Don't use. |
5151

52+
#### System-defined sections
53+
54+
System-defined sections are provisioned by the service and appear in every user's section list. Their **displayName** values are reserved and can't be used for user-defined sections.
55+
56+
| displayName | Description |
57+
|:------------|:------------|
58+
| RecentChats | The default chats section. |
59+
| QuickViews | The Quick views section. |
60+
| TeamsAndChannels | The teams and channels section. |
61+
| MutedChats | The muted chats section. |
62+
| MeetingChats | The meeting chats section. |
63+
| EngageCommunities | The communities section. |
64+
65+
System-defined sections can't be deleted, and only the **sortType** property can be updated. Attempts to update other properties or to delete a system-defined section return `403 Forbidden`. Listing [items](teamworksectionitem.md) on a system-defined section is not supported and returns `400 Bad Request`.
66+
5267
### sectionSortType values
5368

5469
| Member | Description |

0 commit comments

Comments
 (0)