/codes/batch

Use this endpoint to create a batch of new Codes in the current context.

Request

Accepts a standard Codes array with each Code object formatted as per POST /codes. The requirements and limitations of the endpoint are as described there.

In this example, we’re creating two new Codes: one called “Labor” which has a parent code, and one called “Volunteers” which does not.

POST /codes/batch

{
  "codes": [
    {
      "parentCodeID": "1019966",
      "name": "Labor",
      "description": "The tag for describing Labor",
      "supportedEntities": [
        {
          "name": "Contacts",
          "isSearchable": true,
          "isApplicable": true
        },
        {
          "name": "ActivistCodes",
          "isSearchable": true,
          "isApplicable": true
        }
      ],
      "codeType": "Tag"
    },
    {
      "name": "Volunteers",
      "description": "The tab for describing all of our Volunteers",
      "supportedEntities": null,
      "codeType": "Tag"
    }
  ]
}

Response

If successful, the endpoint responds with HTTP Status Code 201 Created and an array of results, one for each code created or attempted, in the same order they were given in the request. Each object will contain the ID of the Code, if successfully created, and any warning or error messages for that Code.

[
    {
        "codeId": 1020112,
        "message": "Completed"
    },
    {
        "codeId": 1020113,
        "message": "Completed"
    }
]
PropertyTypeDescription
codeIdintThe ID of the Code, if created successfully.
messagestringAny messages or warnings produced during the creation of the Code.

If only some Codes are created, the response will be HTTP Status Code 207 Multi-Status and the same array of results, which can be inspected for per-Code details.

If no Codes are created, the response will be HTTP Status Code 404 Not Found.

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