/codes

Use this endpoint to create a new Code in the current context.

Request

Accepts a standard Code object with no read-only values specified. If codeType is not specified, the default SourceCode value is assumed. Note that codeType must be a valid Code Type available for your API key, as determined by GET /codeTypes.

In this example, we’re creating a Code called AFL-CIO which is a child of parentCodeId 20515 and applicable to Events and Locations.

POST /codes

{
  "parentCodeId": 20515,
  "name": "AFL-CIO",
  "codeType": "Tag",
  "supportedEntities": [
    {
      "name": "Events",
      "isSearchable": true,
      "isApplicable": true
    },
    {
      "name": "Locations",
      "isSearchable": true,
      "isApplicable": true
    }
  ]
}

Response

If successful, the endpoint responds with HTTP Status Code 201 Created.
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!