/codes

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

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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 /codeTypes.

You can set additional metadata on SourceCodes by specifying the ID properties. For example, to a set a Source Code's Campaign, set:

{
    ...
    "campaign": {
        "campaignId": 1234
    }
}

In this example, we’re creating a Tag 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
    }
  ]
}

In this example, we're creating a SourceCode with all of the various metadata information available as defined in Common Models:

{
    "name": "SourceCode 22-06-02",
    "description": "Description of a source code",
    "codeType": "SourceCode",
    "campaign": {
        "campaignId": 2541
    },
    "contactType": {
        "contactTypeId": 82
    },
    "generalLedgerFund": {
        "generalLedgerFundId": 69
    },
    "costCenter": {
        "costCenterId": 47
    },
    "revenueStream": {
        "revenueStreamId": 179
    },
    "mailMergeTemplate": {
        "mailMergeTemplateId": 337
    },
    "isSourceCodeApplicable": 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.

Body Params
int32
string
required
string
enum

Defaults to SourceCode if not specified

Allowed:
supportedEntities
array of objects

Only relevant for codeType Tag. Use isSourceCodeApplicable for SourceCode.

supportedEntities
boolean

Only relevant for codeType SourceCode

string
Responses

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json