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

# Add or update root causes for a work order

`POST /resolutionCodes/rootCauses/{workOrderId}`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/resolutionCodes/rootCauses/{workOrderId}`
- 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/:workOrderId/post.ts> (a function with typed inputs; its response is checked against the schema)

For users who don't have access to asset categories, associates a root cause with the specified work order. If a root cause is already added to a work order, you can change it by sending the request.
            <br />Before adding a root cause, use 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 find out if root causes are configured for the work order trade. To get a root cause ID, look for the `Key` value of the desired root cause in the response.
            <br /> ***Note:*** Users with access to asset categories should send the following request to add or update root causes for a work order: [POST /resolutionCodes/rootCauses](/swagger/ui/index?version=3#/ResolutionCodes/POSTv3_resolutionCodes_rootCauses).

## Path parameters

- `workOrderId` integer, required

## Query parameters

- `rootCauseId` integer
- `rootCauseText` string

## Response `200`

The root cause is 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
- `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 root cause text 4121 - You must use a method to set multiple root causes when you have access to asset categories
- `404`: The requested resource does not exist on the server. <br/>Error codes: 502 — Data nor 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)
