---
title: "Add or update root causes for a work order"
method: POST
path: "/resolutionCodes/rootCauses"
tags: ["ResolutionCodes"]
---

# Add or update root causes for a work order

`POST /resolutionCodes/rootCauses`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/resolutionCodes/rootCauses`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/resolutionCodes/rootCauses/post.ts> (a function with typed inputs; its response is checked against the schema)

For users who have access to asset categories, associates root causes with the specified work order. If root causes are already added to a work order, you can replace them by sending the request. You need to specify one root cause for each asset category of a work order.
            <br />Get root cause IDs using the [GET /resolutionCodes/rootCauses](/swagger/ui/index?version=3#/ResolutionCodes/GETv3_resolutionCodes_rootCauses_subscriberId__subscriberId__trade__trade__category__category__locationId__locationId__providerId__providerId__assetCategoryIds_0___assetCategoryIds_0___assetCategoryIds_1___assetCategoryIds_1___keyword__keyword__page__page__pageSize__pageSize_) method. To retrieve asset category IDs, send the [GET /AssetTypes/GetAssetTypeGroups](/swagger/ui/index?version=3#/AssetTypes/GETv3_AssetTypes_GetAssetTypeGroups_subscriberId__subscriberId_) request.
            <br />***Note:*** Users who don't have access to asset categories should pass the [POST /resolutionCodes/rootCauses/{workOrderId}](/swagger/ui/index?version=3#/ResolutionCodes/POSTv3_resolutionCodes_rootCauses__workOrderId__rootCauseId__rootCauseId__rootCauseText__rootCauseText_) request to add or update a root cause for a work order.
            <br />Visit ServiceChannel University to find out [how providers can add or edit root causes](https://servicechannel.atlassian.net/wiki/spaces/SCUCP/pages/1688502858/Resolution+and+Root+Causes+Codes+in+Provider+Automation#ResolutionandRootCausesCodesinProviderAutomation-ProcessingRRCsProcessingResolutionandRootCauseCodes).
            <br />**Example Request**
            
               POST /resolutionCodes/rootCauses
               {
                 "WorkOrderId": 175444600,
                 "RootCauses": [
                  {
                    "Key": 419,
                    "Text": "Accidental damage",
                    "AssetCategoryId": 1
                  },
                  {
                    "Key": 420,
                    "Text": "",
                    "AssetCategoryId": 2
                  }
                ]
               }

## Request body

- ServiceChannelServicesWebApiModelsRequestResolutionCodesUpdateRootCausesRequest: Request object to add root causes to a work order.
  - `WorkOrderId` integer: Unique numeric identifier of the work order to add root causes to.
  - `RootCauses` ServiceChannelServicesWebApiModelsRequestResolutionCodesRootCauseRequest[]: Details of root causes to add to the work order.
    - `Key` integer: ID of the root cause to associate with the work order.
    - `Text` string: Comment explaining your understanding of the root cause of the work order. Enabled for root causes with the `HasFreeText` attribute. The maximum length is 100 characters.
    - `AssetCategoryId` integer: Asset category ID.

## Response `200`

Root causes are added to the specified work order.

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: 4102 - You need to select a root cause 4105 - The max length of the root cause text is exceeded 4117 - The work order doesn't have assigned asset categories. You need to specify at least one asset category 4118 - You need to specify one root cause per asset category for all asset categories assigned to the work order 4120 - Asset category is required
- `401`: The request is not authorized. <br/>Error codes: 504 - API call rejected by security permissions
- `403`: You are not authorized to request this resource, or the resource is unavailable for some reason. <br/>Error codes: 4104 — You don't have access to set the root cause tex 4114 — You don't have access to asset categories
- `404`: The requested resource does not exist on the server. <br/>Error codes: 502 — Data not found
- `500`: The server was unable to complete the request due to an internal error.

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
