---
updatedAt: 2026-06-29T11:55:33.000Z
agentTools:
  projectIndex: https://docs.biot-med.com/llms.txt
---

# Subscribe for intercepting APIs

Subscribe for intercepting APIs

Multiple subscriptions with different endpoints is allowed for the same type and apiId.
Multiple subscriptions with different endpoints of type ADAPT_ENTITY is allowed for the entityName.
If a subscription already exists, it will be overridden with the new executionOrder (if provided in the request).
If an interception is created or updated to have the same executionOrder as an existing interception (including existing ones with default executionOrder),
It will be set with that executionOrder and the existing interception's executionOrder will be incremented.
If that interception's new executionOrder clashes with another the other one will be incremented as well, and so forth.



Request Body Parameters:

| Parameter   |Type   | Mandatory| Description          | Example   |
|-------------|-------|----------|----------------------|-----------|
|type|string|true| Values:PRE_REQUEST,POST_REQUEST,ADAPT_ENTITY||
|apiId|string|true|Should only be provided if type=PRE_REQUEST or type=POST_REQUEST|POST/device/v1/devices|
|entityName|string|true|Should only be provided if type=ADAPT_ENTITY|device|
|endpoint|string|true||https://api.dev.biot-med.com/device-plugin/v1/devices/create-device-pre-interception|
|pathFilters|object|false|Path parameter filters for template-specific interception subscriptions. Keys are path parameter names, values are concrete values to match.|{templateName=device-log-file}|
|executionOrder|integer|false|If not provided, the default value will be taken from the environment variable: EXECUTIONORDER_DEFAULT.
Subscription with the same executionOrder cannot exist simultaneously.
If an interception is created or updated to have the same executionOrder as an existing interception (including existing ones with default executionOrder),
It will be set with that executionOrder and the existing interception's executionOrder will be incremented.
If that interception's new executionOrder clashes with another the other one will be incremented as well, and so forth.|1|


This API requires **HOOKS_INTERCEPTION_CREATE** permission(s).



# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "BioT Dispatcher Service",
    "description": "APIs document description for seed service",
    "version": "2.4.0"
  },
  "servers": [
    {
      "url": "/dispatcher"
    }
  ],
  "paths": {
    "/v1/hooks/interceptions/subscribe": {
      "post": {
        "tags": [
          "Interception API"
        ],
        "summary": "Subscribe for intercepting APIs",
        "description": "Subscribe for intercepting APIs\n\nMultiple subscriptions with different endpoints is allowed for the same type and apiId.\nMultiple subscriptions with different endpoints of type ADAPT_ENTITY is allowed for the entityName.\nIf a subscription already exists, it will be overridden with the new executionOrder (if provided in the request).\nIf an interception is created or updated to have the same executionOrder as an existing interception (including existing ones with default executionOrder),\nIt will be set with that executionOrder and the existing interception's executionOrder will be incremented.\nIf that interception's new executionOrder clashes with another the other one will be incremented as well, and so forth.\n\n\n\nRequest Body Parameters:\n\n| Parameter   |Type   | Mandatory| Description          | Example   |\n|-------------|-------|----------|----------------------|-----------|\n|type|string|true| Values:PRE_REQUEST,POST_REQUEST,ADAPT_ENTITY||\n|apiId|string|true|Should only be provided if type=PRE_REQUEST or type=POST_REQUEST|POST/device/v1/devices|\n|entityName|string|true|Should only be provided if type=ADAPT_ENTITY|device|\n|endpoint|string|true||https://api.dev.biot-med.com/device-plugin/v1/devices/create-device-pre-interception|\n|pathFilters|object|false|Path parameter filters for template-specific interception subscriptions. Keys are path parameter names, values are concrete values to match.|{templateName=device-log-file}|\n|executionOrder|integer|false|If not provided, the default value will be taken from the environment variable: EXECUTIONORDER_DEFAULT.\nSubscription with the same executionOrder cannot exist simultaneously.\nIf an interception is created or updated to have the same executionOrder as an existing interception (including existing ones with default executionOrder),\nIt will be set with that executionOrder and the existing interception's executionOrder will be incremented.\nIf that interception's new executionOrder clashes with another the other one will be incremented as well, and so forth.|1|\n\n\nThis API requires **HOOKS_INTERCEPTION_CREATE** permission(s).\n\n",
        "operationId": "createInterception",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInterceptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The below table describes the response parameters:\n\n| Parameter   |Type   |Description          | Example   |\n|-------------|-------|---------------------|-----------|\n|type|string| Values:PRE_REQUEST,POST_REQUEST,ADAPT_ENTITY||\n|apiId|string|Should only be provided if type=PRE_REQUEST or type=POST_REQUEST|POST/device/v1/devices|\n|entityName|string|Should only be provided if type=ADAPT_ENTITY|device|\n|endpoint|string||https://api.dev.biot-med.com/device-plugin/v1/devices/create-device-pre-interception|\n|pathFilters|object|Path parameter filters for template-specific interception subscriptions. Keys are path parameter names, values are concrete values to match.|{templateName=device-log-file}|\n|id|string|A UUID formatted string|3fa85f64-5717-4562-b3fc-2c963f66afa6|\n|executionOrder|integer|||\n|creationTime|string|A UTC date-time in the ISO-8601 format|2007-12-20T10:15:30Z|\n|lastModifiedTime|string|A UTC date-time in the ISO-8601 format|2007-12-20T10:15:30Z|\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InterceptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Code : INVALID_API_ID, Details: [invalidApiId, validApiIds]\n\nCode : INVALID_ENTITY_TYPE_NAME, Details: [invalidEntityType, validEntityTypes]",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Code : TOKEN_NOT_VALID, Details: []",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Code : ACCESS_DENIED, Details: []",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Code : INTERNAL_SERVER_ERROR, Details: []",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Code : GATEWAY_TIMEOUT, Details: []",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "EXAMPLE_CODE_ENTITY_NOT_FOUND"
          },
          "message": {
            "type": "string",
            "example": "Entity with id [00000000-0000-0000-0000-000000000000] not found"
          },
          "serviceName": {
            "type": "string",
            "example": "Device Service"
          },
          "traceId": {
            "type": "string",
            "example": "a07a7e532f3541d8"
          },
          "environment": {
            "type": "string",
            "example": "develop"
          },
          "details": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      },
      "CreateInterceptionRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PRE_REQUEST",
              "POST_REQUEST",
              "ADAPT_ENTITY"
            ]
          },
          "apiId": {
            "type": "string",
            "description": "Should only be provided if type=PRE_REQUEST or type=POST_REQUEST",
            "example": "POST/device/v1/devices"
          },
          "entityName": {
            "type": "string",
            "description": "Should only be provided if type=ADAPT_ENTITY",
            "example": "device"
          },
          "endpoint": {
            "type": "string",
            "example": "https://api.dev.biot-med.com/device-plugin/v1/devices/create-device-pre-interception"
          },
          "pathFilters": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Path parameter filters for template-specific interception subscriptions. Keys are path parameter names, values are concrete values to match.",
            "example": {
              "templateName": "device-log-file"
            }
          },
          "executionOrder": {
            "type": "integer",
            "format": "int32",
            "description": "If not provided, the default value will be taken from the environment variable: EXECUTIONORDER_DEFAULT.\nSubscription with the same executionOrder cannot exist simultaneously.\nIf an interception is created or updated to have the same executionOrder as an existing interception (including existing ones with default executionOrder),\nIt will be set with that executionOrder and the existing interception's executionOrder will be incremented.\nIf that interception's new executionOrder clashes with another the other one will be incremented as well, and so forth.",
            "example": 1
          }
        },
        "required": [
          "apiId",
          "endpoint",
          "entityName",
          "type"
        ]
      },
      "InterceptionResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PRE_REQUEST",
              "POST_REQUEST",
              "ADAPT_ENTITY"
            ]
          },
          "apiId": {
            "type": "string",
            "description": "Should only be provided if type=PRE_REQUEST or type=POST_REQUEST",
            "example": "POST/device/v1/devices"
          },
          "entityName": {
            "type": "string",
            "description": "Should only be provided if type=ADAPT_ENTITY",
            "example": "device"
          },
          "endpoint": {
            "type": "string",
            "example": "https://api.dev.biot-med.com/device-plugin/v1/devices/create-device-pre-interception"
          },
          "pathFilters": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Path parameter filters for template-specific interception subscriptions. Keys are path parameter names, values are concrete values to match.",
            "example": {
              "templateName": "device-log-file"
            }
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "A UUID formatted string",
            "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          },
          "executionOrder": {
            "type": "integer",
            "format": "int32"
          },
          "creationTime": {
            "type": "string",
            "format": "date-time",
            "description": "A UTC date-time in the ISO-8601 format",
            "example": "2007-12-20T10:15:30Z"
          },
          "lastModifiedTime": {
            "type": "string",
            "format": "date-time",
            "description": "A UTC date-time in the ISO-8601 format",
            "example": "2007-12-20T10:15:30Z"
          }
        },
        "required": [
          "apiId",
          "creationTime",
          "endpoint",
          "entityName",
          "executionOrder",
          "id",
          "lastModifiedTime",
          "type"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```