Our next-gen architecture is built to help you make sense of your ever-growing data Watch a 4-min demo video!

Back to All Integrations

Webhooks API Webhooks API

Last Updated: Jan. 12, 2023

This guide will help you use our Webhooks API to define, query, and manage your webhooks (integrations).

API URL

Cluster RegionBase API Endpoint
Europe (.com)https://api.coralogix.com/api/v1/external/integrations/
US (.us)https://api.coralogix.us/api/v1/external/integrations/
India (.in)https://api.app.coralogix.in/api/v1/external/integrations/
Sweden (.eu2.)https://api.eu2.coralogix.com/api/v1/external/integrations/
Singapore (sg.com)https://api.coralogixsg.com/api/v1/external/integrations/

API Access

In Data Flow, under Integrations, Choose ‘API Keys’ option and generate new API key under Alerts, Rules and Tags API Key:

** Note that only admin users have access to the API, So the option above will be visible only to admin users.

The generated Alerts & Rules API key must be added to the header of each HTTP request to the API, you’ll need to configure it as a ‘Bearer Token’. You should also add to the header Content-Type as application/json.

The generated Alerts & Rules API key must be added to the header of each HTTP request to the API, you’ll need to configure it as a ‘Bearer Token’. You should also add to the header Content-Type as application/json.

Request Headers

  • Authorization: bearer <YOUR_API_KEY>
  • Content-Type: application/json

Note: all examples will use the Europe endpoint.

GET request – Get Webhooks

Get all webhooks or a single webhook using its Id.

Example 1 – Get all webhooks

GET https://api.coralogix.com/api/v1/external/integrations/

Example 1 Result:

[
    {
        "alias": "string",
        "company_id": number,
        "created_at": "string - ISO format",
        "id": number,
        "url": "string",
        "integration_type_fields": "escaped json" or null,
        "integration_type_id": number,
        "integrationTypeId": number,
        "integration_type": {
            "label": "string",
            "icon": "string",
            "id": number
        },
        "updated_at": "string - ISO format"
    }, // array of webhooks
]

Example 2 – Get a specific webhook

GET https://api.coralogix.com/api/v1/external/integrations/<webhook-id>

Example 2 Result:

    {
        "alias": "string",
        "company_id": number,
        "created_at": "string - ISO format",
        "id": number,
        "url": "string",
        "integration_type_fields": "escaped json" or null,
        "integration_type_id": number,
        "integrationTypeId": number,
        "integration_type": {
            "label": "string",
            "icon": "string",
            "id": number
        },
        "updated_at": "string - ISO format"
    }

POST request – Create New Webhook

This will show you how to create/update a single webhook – to create/update several webhooks in bulk see below – POST request – Create New bulk webhooks

Body parameters

ParameterDescriptionTypeNotes
aliaswebhook namestring
integration_typewebhook typeobjectdescribed below, must be a complete block from values as shown in Table A
integration_type.labelwebhook type namestring
integration_type.iconwebhook iconstring
integration_type.idwebhook type idnumber
integration_type_idwebhook type idnumbermust be from values shown in Table A
integration_type_fieldswebhook additional fieldsstringescaped json, an array of objects in the form of name + value. must comply with the structure shown in Table B
urlwebhook urlstring

Table A – integration_type object

TypeJSON Object
slack{“id”: 0, “name”: “Slack”, “icon”: “/assets/settings/slack-48.png”}
webhook{“id”: 1, “name”: “WebHook”, “icon”: “/assets/webhook.png”}
pager_duty{“id”: 2, “name”: “PagerDuty”, “icon”: “/assets/settings/pagerDuty.png”}
sendlog{“id”: 3, “name”: “SendLog”, “icon”: “/assets/invite.png”}
email_group{“id”: 4, “name”: “Email Group”, “icon”: “/assets/email-group.png”}
microsoft_teams{“id”: 5, “name”: “Microsoft Teams”, “icon”: “/assets/settings/teams.png”}
jira{“id”: 6, “name”: “Jira”, “icon”: “/assets/settings/jira.png”}
opsgenie{“id”: 7, “name”: “Opsgenie”, “icon”: “/assets/settings/opsgenie.png”}
demisto{“id”: 8, “name”: “Demisto”, “icon”: “/assets/settings/demisto.png”}

Table B – Integration_type_fields string

TypeFieldvalue_typeNotes
pager_dutyserviceKeystring
jiraapiTokenstring
jiraemailstring
jiraprojectKeystring
email_grouppayloadarray of strings
webhook,demisto,sendloguuidstringin UUID format
webhook,demisto,sendlogmethodstring must be one of [“get”,”post”,”put”]
webhook,demisto,sendlogheadersobjecta json object of headers
webhook,demisto,sendlogpayloadobjecta json object of the webhook body

Example 1 – Create Slack Webhook

POST https://api.coralogix.com/api/v1/external/integrations/

    {
        "alias": "slack-webhook",
        "url": "<slack-webhook-url>",
        "integration_type_fields": "[]",
        "integration_type_id": 0,
        "integration_type": {
            "label": "Slack",
            "icon": "/assets/settings/slack-48.png",
            "id": 0
        }
    }

Example 1 Result:

{
    "id": 1050,
    "alias": "slack-webhook",
    "url": "<slack-webhook-url>",
    "integration_type_fields": "[]",
    "integration_type_id": 0,
    "integrationTypeId": 0,
    "company_id": 12345,
    "updated_at": "2022-08-22T07:32:09.348Z",
    "created_at": "2022-08-22T07:32:09.348Z",
    "companyId": 12345
}

Example 2 – Create ‘sendlog’ Webhook

POST https://api.coralogix.com/api/v1/external/integrations/

{
    "alias": "sendlog-webhook",
    "integration_type": {
        "icon": "/assets/invite.png",
        "id": 3,
        "name": "Send Log"
    },
    "integration_type_id": 3,
    "integration_type_fields": "[{\"name\":\"uuid\",\"value\":\"<uuid>\"},{\"name\":\"method\",\"value\":\"post\"},{\"name\":\"headers\",\"value\":{\"Content-Type\":\"application/json\"}},{\"name\":\"payload\",\"value\":{\"privateKey\":\"<send-your-logs-privatekey>\",\"applicationName\":\"$APPLICATION_NAME\",\"subsystemName\":\"$SUBSYSTEM_NAME\",\"computerName\":\"$COMPUTER_NAME\",\"logEntries\":[{\"severity\":3,\"timestamp\":\"$EVENT_TIMESTAMP_MS\",\"text\":{\"integration_text\":\"<Insert your desired integration description>\",\"alert_severity\":\"$EVENT_SEVERITY\",\"alert_id\":\"$ALERT_ID\",\"alert_name\":\"$ALERT_NAME\",\"alert_url\":\"$ALERT_URL\",\"hit_count\":\"$HIT_COUNT\"}}],\"uuid\":\"<same-uuid>\"}}]",
    "url": "https://api.coralogix.us/api/v1/logs"
}

Note: inside integration_type_fields you need to modify:

  • <uuid> and <same-uuid> – with a newly generated uuid
  • <send-your-logs-privatekey> – with your privateKey
  • <Insert your desired integration description>

Example 2 Result:

{
    "id": 1051,
    "alias": "sendlog-webhook",
    "url": "https://api.coralogix.us/api/v1/logs",
    "integration_type_fields": "[{\"name\":\"uuid\",\"value\":\"17a3b9e3-b0bc-4bc0-9e06-98d2a4c54ecb\"},{\"name\":\"method\",\"value\":\"post\"},{\"name\":\"headers\",\"value\":{\"Content-Type\":\"application/json\"}},{\"name\":\"payload\",\"value\":{\"privateKey\":\"5ef4a0d1-7e1f-47b2-ac0a-1282002aa2a1\",\"applicationName\":\"$APPLICATION_NAME\",\"subsystemName\":\"$SUBSYSTEM_NAME\",\"computerName\":\"$COMPUTER_NAME\",\"logEntries\":[{\"severity\":3,\"timestamp\":\"$EVENT_TIMESTAMP_MS\",\"text\":{\"integration_text\":\"Insert your desired integration description\",\"alert_severity\":\"$EVENT_SEVERITY\",\"alert_id\":\"$ALERT_ID\",\"alert_name\":\"$ALERT_NAME\",\"alert_url\":\"$ALERT_URL\",\"hit_count\":\"$HIT_COUNT\"}}],\"uuid\":\"17a3b9e3-b0bc-4bc0-9e06-98d2a4c54ecb\"}}]",
    "integration_type_id": 3,
    "integrationTypeId": 3,
    "company_id": 12345,
    "updated_at": "2022-08-22T07:32:09.348Z",
    "created_at": "2022-08-22T07:32:09.348Z",
    "companyId": 12345
}

POST request – Create New bulk Webhooks

To create Webhooks in bulk please use the same URLs as listed above with the following change: replace api/v1/external/integrations/ with api/v1/external/integrations-bulk

To create several webhooks in one request, please send an array of objects, where each object is a different webhook.

Example 3 – Create 2 Webhooks in the same request

POST https://api.coralogix.com/api/v1/external/integrations-bulk

[
       {
        "alias": "slack-webhook",
        "url": "<slack-webhook-url>",
        "integration_type_fields": "[]",
        "integration_type_id": 0,
        "integration_type": {
            "label": "Slack",
            "icon": "/assets/settings/slack-48.png",
            "id": 0
        }
    },
 {
    "alias": "sendlog-webhook",
    "integration_type": {
        "icon": "/assets/invite.png",
        "id": 3,
        "name": "Send Log"
    },
    "integration_type_id": 3,
    "integration_type_fields": "[{\"name\":\"uuid\",\"value\":\"<uuid>\"},{\"name\":\"method\",\"value\":\"post\"},{\"name\":\"headers\",\"value\":{\"Content-Type\":\"application/json\"}},{\"name\":\"payload\",\"value\":{\"privateKey\":\"<send-your-logs-privatekey>\",\"applicationName\":\"$APPLICATION_NAME\",\"subsystemName\":\"$SUBSYSTEM_NAME\",\"computerName\":\"$COMPUTER_NAME\",\"logEntries\":[{\"severity\":3,\"timestamp\":\"$EVENT_TIMESTAMP_MS\",\"text\":{\"integration_text\":\"<Insert your desired integration description>\",\"alert_severity\":\"$EVENT_SEVERITY\",\"alert_id\":\"$ALERT_ID\",\"alert_name\":\"$ALERT_NAME\",\"alert_url\":\"$ALERT_URL\",\"hit_count\":\"$HIT_COUNT\"}}],\"uuid\":\"<same-uuid>\"}}]",
    "url": "https://api.coralogix.us/api/v1/logs"
 }
]

Example 3 Result:

[
 {
    "id": 1050,
    "alias": "slack-webhook",
    "url": "<slack-webhook-url>",
    "integration_type_fields": "[]",
    "integration_type_id": 0,
    "integrationTypeId": 0,
    "company_id": 12345,
    "updated_at": "2022-08-22T07:32:09.348Z",
    "created_at": "2022-08-22T07:32:09.348Z",
    "companyId": 12345
},
{
    "id": 1051,
    "alias": "sendlog-webhook",
    "url": "https://api.coralogix.us/api/v1/logs",
    "integration_type_fields": "[{\"name\":\"uuid\",\"value\":\"17a3b9e3-b0bc-4bc0-9e06-98d2a4c54ecb\"},{\"name\":\"method\",\"value\":\"post\"},{\"name\":\"headers\",\"value\":{\"Content-Type\":\"application/json\"}},{\"name\":\"payload\",\"value\":{\"privateKey\":\"5ef4a0d1-7e1f-47b2-ac0a-1282002aa2a1\",\"applicationName\":\"$APPLICATION_NAME\",\"subsystemName\":\"$SUBSYSTEM_NAME\",\"computerName\":\"$COMPUTER_NAME\",\"logEntries\":[{\"severity\":3,\"timestamp\":\"$EVENT_TIMESTAMP_MS\",\"text\":{\"integration_text\":\"Insert your desired integration description\",\"alert_severity\":\"$EVENT_SEVERITY\",\"alert_id\":\"$ALERT_ID\",\"alert_name\":\"$ALERT_NAME\",\"alert_url\":\"$ALERT_URL\",\"hit_count\":\"$HIT_COUNT\"}}],\"uuid\":\"17a3b9e3-b0bc-4bc0-9e06-98d2a4c54ecb\"}}]",
    "integration_type_id": 3,
    "integrationTypeId": 3,
    "company_id": 12345,
    "updated_at": "2022-08-22T07:32:09.348Z",
    "created_at": "2022-08-22T07:32:09.348Z",
    "companyId": 12345
 }
]

POST request – Update New Webhook or Bulk webhooks

To update an existing webhook send a POST request with all the usual values and add an id field with the webhook id as the value.
To update a group of webhooks, make sure your POST request is an array of objects and that you are using the correct url (ending with integrations-bulk)

Copying Webhooks between accounts

To copy Webhooks from one account to another:

  • Create a GET request with the API key of the origin account and GET all alerts
  • Copy the full response and remove the ID of the webhook.
    Please note! Do not remove the ID under “integration_type”.
  • Copy the edited array to a new POST request
    • Make sure to change the API key to the API key of the destination account
    • Make sure to change the URL to the URL used for bulk updates – see endpoints changes in POST request – Create New bulk Webhooks

DELETE request – Delete a Webhook

Example 1 – Delete Webhook

DELETE https://api.coralogix.com/api/v1/external/integrations/<webhook-id>

On this page