Skip to main content
Version: 1.18.2 (latest)

Event endpoints

ATTENTION!

All queries described below are available at http://$DOMAIN/event-service/graphql.

Create websocket endpoint

The createWebSocketEndpoint() request allows you to create a websocket endpoint to which events are routed.

Input parameters:

  • name!:
    • Name of the websocket endpoint
    • Data type: String

Output parameters:

  • id
    • Endpoint ID
    • Data type: ID
  • creationDate
    • Endpoint creation date
    • Data format: Date and time in ISO format
  • lastModified
    • Endpoint last modification date
    • Data format: Date and time in ISO format
  • type
    • Endpoint type: WEB_SOCKET
  • meta
    • Endpoint meta information
    • Data type: JSON
  • workspaceId
    • Workspace ID
    • Data type: ID

Example request:

mutation {
createWebSocketEndpoint(name: "MyEndpoint") {
creationDate
id
lastModified
meta
name
type
workspaceId
}
}

Example response:

API returns the following result:
{
"data": {
"createWebSocketEndpoint": {
"creationDate": "2024-05-22T08:55:23.460103+00:00",
"id": "52c6548d-3e17-4b9b-9268-ce51d6900530",
"lastModified": "2024-05-22T08:55:23.460103+00:00",
"meta": {},
"name": "MyEndpoint",
"type": "WEB_SOCKET",
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16"
}
}
}

Create webhook endpoint

The createWebhookEndpoint() request allows you to create a webhook endpoint to which events are routed.

Input parameters:

  • name!:
    • Name of the webhook endpoint
    • Data type: String
  • url!:
    • Link to webhook server
    • Data type: String
  • method:
    • http request method, which will be used to send events

Output parameters:

  • id
    • Endpoint ID
    • Data type: ID
  • creationDate
    • Endpoint creation date
    • Data format: Date and time in ISO format
  • lastModified
    • Endpoint last modification date
    • Data format: Date and time in ISO format
  • type
    • Endpoint type: WEB_HOOK
  • meta
    • Endpoint meta information (e.g., url and method)
    • Data type: JSON
  • workspaceId
    • Workspace ID
    • Data type: ID

Example request:

mutation {
createWebhookEndpoint(
name: "My Endpoint"
url: "https://web-hook.server.com"
method: "POST"
) {
creationDate
id
lastModified
meta
name
type
workspaceId
}
}

Example response:

API returns the following result:
{
"data": {
"createWebhookEndpoint": {
"creationDate": "2024-05-22T09:00:03.005626+00:00",
"id": "357fe643-2396-4919-bd9e-a30f0ac28818",
"lastModified": "2024-05-22T09:00:03.005626+00:00",
"meta": {
"url": "https://web-hook.server.com",
"method": "POST"
},
"name": "My Endpoint",
"type": "WEB_HOOK",
"workspaceId": "c641ff9c-67df-4c03-8fa6-ee2eabffdc16"
}
}
}

Get endpoints

The endpoints() query allows you to get a list of endpoints to which events are routed.

Input parameters:

  • filters:
    • id:
      • exact
        • Endpoint ID
        • Data type: ID
    • type:
      • exact
        • Endpoint type: WEB_SOCKET, WEB_HOOK
  • order:
    • creation_date (Sort the list of endpoints by creation date)
      • ASC: earliest to latest
      • DESC: latest to earliest
  • pagination:
    • offset
      • Allows you to remove the last n endpoints from the list
      • Data type: Int
    • limit
      • Allows you to get the last n endpoints from the list
      • Data type: Int

Output parameters:

  • totalCount
    • Total number of endpoints found
    • Data type: Int.
  • collectionItems: EndpointOutput!:
    • id
      • Endpoint ID
      • Data type: ID.
    • creationDate
      • Endpoint creation date
      • Data format: Date and time in ISO format
    • lastModified
      • Endpoint last modification date
      • Data format: Date and time in ISO format
    • type
      • Endpoint type: WEB_SOCKET, WEB_HOOK
    • meta
      • Endpoint meta information
      • Data type: JSON
    • workspaceId
      • Workspace ID
      • Data type: ID

Example request:

query {
endpoints(filters: {id: {exact: "8374c43d-7561-4a08-b3b7-afce7799e2a8"}}) {
collectionItems {
id
creationDate
lastModified
name
type
workspaceId
}
}
}

Example response:

API returns the following result:
{
"data": {
"endpoints": {
"collectionItems": [
{
"id": "8374c43d-7561-4a08-b3b7-afce7799e2a8",
"creationDate": "2023-09-22T11:40:18.232274+00:00",
"lastModified": "2023-09-22T11:40:18.232274+00:00",
"name": "test",
"type": "WEB_SOCKET",
"workspaceId": "53989c34-9729-4081-ab02-9e064de2884c"
}
],
"totalCount": 1
}
}
}

Delete endpoints

The deleteEndpoint() mutation allows you to delete a list of endpoints.

Input parameters:

  • ids!
    • List of endpoint IDs
    • Data type: List[ID]

Output parameters:

  • ok!
    • Flag indicating successful completion of the operation
    • Data type: Boolean

Example request:

mutation {
deleteEndpoints(endpointIds: ["2eff291d-8c8c-4325-8953-5a70b31bc63e", "29bcfb3a-3a26-4544-9def-d5d44bbd3be4"]) {
ok
}
}

Example response:

API returns the following result:
{
"data": {
"deleteEndpoints": {
"ok": true
}
}
}

The linkEndpointsToEventFilters() mutation allows you to link a list of endpoints to event filters.

Input parameters:

  • endpointIds!
    • List of endpoint IDs
    • Data type: List[ID]
  • eventFiltersId!
    • Event filter ID
    • Data type: ID

Output parameters:

  • ok!
    • Flag indicating successful completion of the operation
    • Data type: Boolean

Example request:

mutation {
linkEndpointsToEventFilters(
endpointIds: ["2eff291d-8c8c-4325-8953-5a70b31bc63e", "29bcfb3a-3a26-4544-9def-d5d44bbd3be4"],
eventFiltersId: "36ce940c-d8c7-4770-8f76-2d03a3aa8275"
) {
ok
}
}

Example response:

API returns the following result:
{
"data": {
"linkEndpointsToEventFilters": {
"ok": true
}
}
}

The unlinkEndpointsToEventFilters() mutation allows you to unlink a list of endpoints from event filters.

Output parameters:

  • endpointIds!
    • List of endpoint IDs
    • Data type: List[ID]
  • eventFiltersId!
    • Event filter ID
    • Data type: ID

Output parameters:

  • ok!
    • Flag indicating successful completion of the operation
    • Data type: Boolean

Example request:

mutation {
unlinkEndpointsToEventFilters(
endpointIds: ["2eff291d-8c8c-4325-8953-5a70b31bc63e", "29bcfb3a-3a26-4544-9def-d5d44bbd3be4"],
eventFiltersId: "36ce940c-d8c7-4770-8f76-2d03a3aa8275"
) {
ok
}
}

Example response:

API returns the following result:
{
"data": {
"unlinkEndpointsToEventFilters": {
"ok": true
}
}
}