/codes/{codeId}

Use this endpoint to update the editable properties of an existing Code. For example, you could use this to change the name of a Code, to change a Code’s parent, or to add or remove the Entities this Code supports.

When constructing your request, note that all editable properties must be specified otherwise it is assumed they should be removed or set to null. For example, if the supportedEntities property is set to null or [] (an empty array) in the request, all supported Entities are removed from the Code.

Request

Accepts a standard Code object with no read-only values specified except codeId.

The following example modifies the Code created in the POST /codes example by:

  • Changing the name
  • Adding searchable-only Entity support for Organizations
  • Deleting the description, if one exists (by not providing one)
PUT /codes/20547

{
  "codeId": 20547,
  "parentCodeId": 20515,
  "name": "AFL and CIO",
  "codeType": "Tag",
  "supportedEntities": [
    {
      "name": "Events",
      "isSearchable": true,
      "isApplicable": true
    },
    {
      "name": "Locations",
      "isSearchable": true,
      "isApplicable": true
    },
    {
      "name": "Organizations",
      "isSearchable": true,
      "isApplicable": false
    }
  ]
}

Response

If the specified Code does not exist, this endpoint will return an error with HTTP Status Code 404 Not Found.

If successful, the endpoint responds with HTTP Status Code 204 No Content and an empty response body.

The codeType property may not be changed by this route.

It is not possible to provide a supportedEntities list for Tags which includes Entities that are not included in the GET /codes/supportedEntities response. For Source Codes, the supportedEntities list is ignored, because the list of supported entities is fixed for all Source Codes.

Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!