Create a custom event type for a custom integration

Request

POST https://api.connectif.cloud/custom-integrations/{id}/custom-event-types/

Request body

The request body takes a complete CustomEventTypeCreation resource, containing the following writable properties:

{
    "alias": "string",
    "category": "string",
    "fields": [
        {
            "defaultCountryCode": "string",
            "id": "string",
            "isPrimaryKey": "boolean",
            "jsonPointerPath": "string",
            "name": "string",
            "options": [
                {
                    "id": "string",
                    "label": "string"
                }
            ],
            "required": "boolean",
            "type": "string"
        }
    ],
    "icon": "string",
    "name": "string",
    "receiveType": "string",
    "webhookHeaders": [
        {
            "name": "string",
            "value": "string"
        }
    ],
    "webhookUrl": "string"
}

Properties

Name Type Description Additional
alias string

A unique alias to identify the custom event type via API or webhook. Required when category is receive, not allowed when category is send

Optional
category string

The category of the custom event type. send: event triggered by Connectif sending data to an external webhook. receive: event triggered by external systems sending data to Connectif

Possible values are:

  • send
  • receive
fields[] array

The fields of the custom event type. Only one field may be the primary key, and it must be of type email. When category is receive and receive type is webhook or api a primary key field is required

fields[].defaultCountryCode string

The default country calling code for phone fields (digits only). Required when field type is phone

Optional
fields[].id string

The identifier of the field

fields[].isPrimaryKey boolean

Whether this field is the primary key. Only one field per event type may be the primary key, and it must be of type email. Defaults to false if omitted

Optional
fields[].jsonPointerPath string

The JSON Pointer Path for extracting the field value

Optional
fields[].name string

The display name of the field

fields[].options[] array

The list of allowed values. Required when field type is checkbox, or radio

Optional
fields[].options[].id string

The identifier of the value

fields[].options[].label string

The display label of the value

fields[].required boolean

Whether this field is required

fields[].type string

The type of the field. Allowed values: text, email, decimal, integer, date, phone, boolean, checkbox, radio

Possible values are:

  • text
  • email
  • decimal
  • integer
  • date
  • phone
  • boolean
  • checkbox
  • radio
icon string

The icon identifier for the custom event type

name string

The name of the custom event type

receiveType string

How the custom event is received by Connectif. Required when category is receive, not allowed when category is send. Allowed values: webhook, api, web/mobile-app

Possible values are:

  • webhook
  • api
  • web/mobile-app
Optional
webhookHeaders[] array

The headers to include in the webhook request. Up to 5 headers allowed. Only allowed when category is send

Optional
webhookHeaders[].name string

The name of the webhook header

webhookHeaders[].value string

The value of the webhook header

webhookUrl string

The URL of the webhook that Connectif will call. Required when category is send, not allowed when category is receive

Optional

Authorization

This request requires the use of one of following authorization methods: API key .

Response

The following HTTP status codes may be returned, optionally with a response resource.

Status code Description Resource
201 Created

Success.

CustomEventType
400 Bad Request

Bad request.

HttpError
401 Unauthorized

Not authorized to access API.

403 Forbidden

Permission not granted to the API Key or account has been blocked.

HttpError
404 Not Found

Resource not found.

HttpError
409 Conflict

Custom event type

HttpError
422 Unprocessable Entity

Resource contains validation errors.

HttpUnprocessableEntityError
429 Too Many Requests

Requests rate limit reached.