# Event Manager API
**Base URL**: https://dev-cloud.acronis.com/api/event_manager/v1
## Security
### OAuth 2.0
OAuth 2.0 security scheme definition for a service authorization.
Supported grant types:
* `password`
* `client_credentials`
* `authorization_code`
* `urn:ietf:params:oauth:grant-type:jwt-bearer`
* `urn:ietf:params:oauth:grant-type:device_code`
Authorization URI example: `/bc/ipd/authorize`
Access token URI example: `/bc/ipd/token`
### Request parameters
#### Headers
| Name | Description |
|------|-------------|
| `Authorization` | (Required) OAuth 2.0 access token.
**Type**: String
**Pattern**: `^Bearer [0-9a-zA-Z\-\._~+/]+={0,2}$` |
### Scopes
* `urn:acronis.com:event_manager:{cti_query}:publisher`
* `urn:acronis.com:event_manager:{cti_query}:subscriber`
* `urn:acronis.com:audit:{role|permissions}`
## Endpoints
### Fetch topics (GET /topics)
Fetch a list of all available topics that client is allowed to publish or subscribe to.
#### Security
The endpoint supports the following authorization methods: `OAuth 2.0`
For OAuth2 authorization method, one of the following scopes is required by the endpoint:
* `urn:acronis.com:event_manager:{cti_query}:publisher`
* `urn:acronis.com:event_manager:{cti_query}:subscriber`
#### Request parameters
##### Query parameters
| Name | Description |
|------|-------------|
| `topic_id` | (Optional) Optional. Specific topic ID to fetch. Wildcard is not supported.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$` |
#### Responses
##### `200` — List of topics
**Media type**: `application/json`
- `schema` — **Type**: Array of Object
**Array type description:**
Event topic is a stream of events of the same or different types sharing the same delivery, ordering, consolidation & retention rules.
**Type**: Object
**Example**:
```json
[
{
"id": "cti.a.p.em.topic.v1.0~a.p.tenant.v1.0",
"description": "",
"persistency": true,
"ordering": "NONE",
"producer_consolidation": "NONE",
"archive_consolidation": "NONE",
"retention": "P30D"
}
]
```
##### `401` — Method required an authenticated user
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "accessDenied",
"message": "Access denied."
}
}
```
##### `403` — Current user has no permissions for this URL/method
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_1`*:
```json
{
"error": {
"domain": "EventManager",
"code": "bearerTokenMissing",
"message": "Authorization bearer token is missing."
}
}
```
##### `500` — Internal service error
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "internalServiceError",
"message": "Internal service error"
}
}
```
### Fetch topic offsets (GET /topics/offsets)
Fetch the latest offset for a specific topic, providing a global view of the current stream state.
#### Security
The endpoint supports the following authorization methods: `OAuth 2.0`
For OAuth2 authorization method, one of the following scopes is required by the endpoint:
* `urn:acronis.com:event_manager:{cti_query}:publisher`
* `urn:acronis.com:event_manager:{cti_query}:subscriber`
#### Request parameters
##### Query parameters
| Name | Description |
|------|-------------|
| `topic_id` | (Required) Required, Topic ID to fetch the offset for.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$` |
| `position` | (Required) Required, the position to fetch the offset for.
**Type**: String
**Allowed values**:
- `EARLIEST`
- `TIMESTAMP`
- `CURRENT` |
| `timestamp` | (Optional) Required for timestamp positions. Fetch the offset position to the neares future from a specific time. The timestamp is specified in ISO 8601 format using the RFC 3339 profile.
**Type**: DateTime |
#### Responses
##### `200`
**Media type**: `application/json`
- `topic_id` — Identifier of the topic.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$`
- `offset` — Requested offset sequence number.
**Type**: Long
**Format**: int64
**Example**:
```json
{
"topic_id": "cti.a.p.em.topic.v1.0~a.p.tenant.v1.0",
"offset": 0
}
```
##### `401` — Method required an authenticated user
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "accessDenied",
"message": "Access denied."
}
}
```
##### `403` — Current user has no permissions for this URL/method
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_1`*:
```json
{
"error": {
"domain": "EventManager",
"code": "bearerTokenMissing",
"message": "Authorization bearer token is missing."
}
}
```
##### `500` — Internal service error
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "internalServiceError",
"message": "Internal service error"
}
}
```
### Fetch event types (GET /types)
Fetch a list of all available event types that client is allowed to publish or subscribe to.
#### Security
The endpoint supports the following authorization methods: `OAuth 2.0`
For OAuth2 authorization method, one of the following scopes is required by the endpoint:
* `urn:acronis.com:event_manager:{cti_query}:publisher`
* `urn:acronis.com:event_manager:{cti_query}:subscriber`
#### Request parameters
##### Query parameters
| Name | Description |
|------|-------------|
| `topic_id` | (Optional) Optional. Topic ID to fetch the event types for.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$` |
| `type_id` | (Optional) Optional. Specific event type ID to fetch.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$` |
| `include_schema` | (Optional) Optional. Include the schema of the event type.
**Type**: Boolean
**Default**: false |
#### Responses
##### `200`
**Media type**: `application/json`
- `schema` — **Type**: Array of Object
**Array type description:**
Defines the structure of the event type. It is used to define the structure of the event and to validate the event data.
**Type**: Object
**Example**:
```json
[
{
"allowed_subject_types": [
"cti.a.p.gr.record.v1.0~a.p.setting.v1.0",
"cti.a.p.gr.record.v1.0~a.p.value.v1.0"
],
"data_schema": "{\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"$id\": \"http://acronis.com/tenant-undeleted.json\",\n \"type\": \"object\",\n \"title\": \"The schema of tenant.undeleted event.\",\n \"description\": \"The root schema comprises the entire JSON document.\",\n \"properties\": {\n \"subject\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n },\n \"data\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"examples\": [\n \"My Tenant\"\n ]\n }\n },\n \"additionalProperties\": false\n }\n },\n \"required\": [\"subject\",\"data\"],\n \"additionalProperties\": false\n}\n",
"id": "cti.a.p.em.event.v1.0~a.p.tenant.created.v1.0",
"topic_id": "cti.a.p.em.topic.v1.0~a.p.tenant.v1.0",
"subject_ref_template": "/api/v2/tenants/{{subjectId}}",
"description": ""
}
]
```
##### `401` — Method required an authenticated user
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "accessDenied",
"message": "Access denied."
}
}
```
##### `403` — Current user has no permissions for this URL/method
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_1`*:
```json
{
"error": {
"domain": "EventManager",
"code": "bearerTokenMissing",
"message": "Authorization bearer token is missing."
}
}
```
##### `500` — Internal service error
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "internalServiceError",
"message": "Internal service error"
}
}
```
### Create event subscription (POST /subscriptions)
Create a new event subscription based on the provided criteria, such as topic, cti filter, and optional filters.
#### Security
The endpoint supports the following authorization methods: `OAuth 2.0`
For OAuth2 authorization method, one of the following scopes is required by the endpoint:
* `urn:acronis.com:event_manager:{cti_query}:subscriber`
#### Request parameters
##### Request body
**Media type**: `application/json`
- `cel` — Optional. CEL expression to filter events by.
**Type**: String
**Max length**: 4096
- `subscription_id` — Unique identifier of the subscription.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
- `tenant_depth` — Required. Specifies the required tenancy depth
`CURRENT` - return all the events with the tenant_id equal to the tenant_id specified in the subscription.
`DIRECT` - return events for the tenant_id specified in the subscription and its direct children.
`ALL` - return all the events for the tenant_id specified in the subscription and all its children.
**Type**: String
**Allowed values**:
- `CURRENT`
- `DIRECT`
- `ALL`
- `auto_commit_interval` — Optional. Interval at which to auto-commit offsets. The interval is specified in ISO 8601 format.
**Type**: String
**Pattern**: `^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$`
**Default**: PT5M
- `auto_commit` — Optional. Keep track of the last offset acknowledged by this consumer and automatically commit it. Auto-commit will potentially be made at the beginning of each and every poll request and on subscription eviction. This is useful when the subscriber does not have an external storage to keep track of the last offset committed.
**Type**: Boolean
**Default**: false
- `types` — Required. List of event types this subscription delivers.
Allowed CTI prefixes:
- `cti.a.p.em.event.v1.0~`
- `cti.a.p.em.msg.v1.0~`
Supported forms (right side of `~` only):
- Exact type:
`cti.a.p.em.event.v1.0~a.p.tenant.created.v1.0`
- All types prefixed with a specific path:
`cti.a.p.em.event.v1.0~a.p.tenant.*`
- Latest version of a particular type:
`cti.a.p.em.event.v1.0~a.p.tenant.updated.v1.*`
Version wildcard semantics:
- When v1.* is used, matching events are upcast to the latest available version of that type.
- When version is missing (i.e.,cti.a.p.em.event.v1.0~a.p.tenant.*), matching events are upcast to the latest available version of each major version.
**Type**: Array of String
**Array type description:**
CTI with wildcard support, where the wildcard `*` can only be used as the final character of a segment.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti((\.([a-z][a-z0-9_]*))|\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?(~(([a-z][a-z0-9_]*)|([a-z][a-z0-9_]*)\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?)*\*$|^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$`
**Min items**: 1
**Max items**: 32
- `topic_id` — Required. Identifier of the topic to subscribe to. The topic_id is used to filter events based on the topic they belong to.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$`
- `session_timeout` — Optional. Defines the maximum duration an instance can hold the leadership for event fetching without sending heartbeats. If the instance fails within this period, the system will reassign the leadership to ensure continuous event processing. This mechanism enhances fault tolerance by allowing for the automatic recovery of event consumption in case of instance failures. The duration is specified in ISO 8601 format.
**Type**: String
**Pattern**: `^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$`
**Default**: PT30S
- `tenant_id` — Optional. Specifies the root of the tenant hierarchy subtree to apply event filtering.
If not provided, the tenant_id will be extracted from the access token.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
- `subject_types` — Optional. List of subject types to filter by. Wildcard is supported.
**Type**: Array of String
**Array type description:**
CTI with wildcard support, where the wildcard `*` can only be used as the final character of a segment.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti((\.([a-z][a-z0-9_]*))|\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?(~(([a-z][a-z0-9_]*)|([a-z][a-z0-9_]*)\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?)*\*$|^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$`
**Max items**: 32
**Example**:
```json
{
"cel": "event.data.my_field == 'my_value'",
"subscription_id": "fd02a25c-fcb0-42a0-a5ce-56c1131db356",
"tenant_depth": "CURRENT",
"auto_commit_interval": "PT5M",
"auto_commit": false,
"types": [
"cti.a.p.em.event.v1.0~a.p.tenant.created.v1.0",
"cti.a.p.em.event.v1.0~a.p.tenant.deleted.v1.0"
],
"topic_id": "cti.a.p.em.topic.v1.0~a.p.tenant.v1.0",
"session_timeout": "PT30S",
"tenant_id": "",
"subject_types": [
"cti.a.monitoring.subject.v1.0~a.monitoring.cpu.v1.0",
"cti.a.monitoring.subject.v1.0~a.monitoring.gpu.v1.0"
]
}
```
#### Responses
##### `201` — Subscription was successfully created.
**Media type**: `application/json`
- `cel` — Optional. CEL expression to filter events by.
**Type**: String
**Max length**: 4096
- `subscription_id` — Unique identifier of the subscription.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
- `tenant_depth` — Required. Specifies the required tenancy depth
`CURRENT` - return all the events with the tenant_id equal to the tenant_id specified in the subscription.
`DIRECT` - return events for the tenant_id specified in the subscription and its direct children.
`ALL` - return all the events for the tenant_id specified in the subscription and all its children.
**Type**: String
**Allowed values**:
- `CURRENT`
- `DIRECT`
- `ALL`
- `auto_commit_interval` — Optional. Interval at which to auto-commit offsets. The interval is specified in ISO 8601 format.
**Type**: String
**Pattern**: `^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$`
**Default**: PT5M
- `auto_commit` — Optional. Keep track of the last offset acknowledged by this consumer and automatically commit it. Auto-commit will potentially be made at the beginning of each and every poll request and on subscription eviction. This is useful when the subscriber does not have an external storage to keep track of the last offset committed.
**Type**: Boolean
**Default**: false
- `types` — Required. List of event types this subscription delivers.
Allowed CTI prefixes:
- `cti.a.p.em.event.v1.0~`
- `cti.a.p.em.msg.v1.0~`
Supported forms (right side of `~` only):
- Exact type:
`cti.a.p.em.event.v1.0~a.p.tenant.created.v1.0`
- All types prefixed with a specific path:
`cti.a.p.em.event.v1.0~a.p.tenant.*`
- Latest version of a particular type:
`cti.a.p.em.event.v1.0~a.p.tenant.updated.v1.*`
Version wildcard semantics:
- When v1.* is used, matching events are upcast to the latest available version of that type.
- When version is missing (i.e.,cti.a.p.em.event.v1.0~a.p.tenant.*), matching events are upcast to the latest available version of each major version.
**Type**: Array of String
**Array type description:**
CTI with wildcard support, where the wildcard `*` can only be used as the final character of a segment.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti((\.([a-z][a-z0-9_]*))|\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?(~(([a-z][a-z0-9_]*)|([a-z][a-z0-9_]*)\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?)*\*$|^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$`
**Min items**: 1
**Max items**: 32
- `topic_id` — Required. Identifier of the topic to subscribe to. The topic_id is used to filter events based on the topic they belong to.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$`
- `session_timeout` — Optional. Defines the maximum duration an instance can hold the leadership for event fetching without sending heartbeats. If the instance fails within this period, the system will reassign the leadership to ensure continuous event processing. This mechanism enhances fault tolerance by allowing for the automatic recovery of event consumption in case of instance failures. The duration is specified in ISO 8601 format.
**Type**: String
**Pattern**: `^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$`
**Default**: PT30S
- `tenant_id` — Optional. Specifies the root of the tenant hierarchy subtree to apply event filtering.
If not provided, the tenant_id will be extracted from the access token.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
- `subject_types` — Optional. List of subject types to filter by. Wildcard is supported.
**Type**: Array of String
**Array type description:**
CTI with wildcard support, where the wildcard `*` can only be used as the final character of a segment.
**Type**: String
**Max length**: 1024
**Pattern**: `^cti((\.([a-z][a-z0-9_]*))|\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?(~(([a-z][a-z0-9_]*)|([a-z][a-z0-9_]*)\.)?(\.([a-z][a-z0-9_]*))?(\.([a-z_][a-z0-9_.]*))?(\.v(\d+|\d*\.\d*|\d*\.)?)?)*\*$|^cti\.([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+)(~([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z_][a-z0-9_.]*\.v[\d]+\.[\d]+))*(~[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12})?$`
**Max items**: 32
**Example**:
```json
{
"cel": "event.data.my_field == 'my_value'",
"subscription_id": "fd02a25c-fcb0-42a0-a5ce-56c1131db356",
"tenant_depth": "CURRENT",
"auto_commit_interval": "PT5M",
"auto_commit": false,
"types": [
"cti.a.p.em.event.v1.0~a.p.tenant.created.v1.0",
"cti.a.p.em.event.v1.0~a.p.tenant.deleted.v1.0"
],
"topic_id": "cti.a.p.em.topic.v1.0~a.p.tenant.v1.0",
"session_timeout": "PT30S",
"tenant_id": "",
"subject_types": [
"cti.a.monitoring.subject.v1.0~a.monitoring.cpu.v1.0",
"cti.a.monitoring.subject.v1.0~a.monitoring.gpu.v1.0"
]
}
```
##### `401` — Method required an authenticated user
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "accessDenied",
"message": "Access denied."
}
}
```
##### `403` — Current user has no permissions for this URL/method
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_1`*:
```json
{
"error": {
"domain": "EventManager",
"code": "bearerTokenMissing",
"message": "Authorization bearer token is missing."
}
}
```
##### `500` — Internal service error
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "internalServiceError",
"message": "Internal service error"
}
}
```
##### `409` — Another object of the same type already exists
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_1`*:
```json
{
"error": {
"domain": "EventManager",
"code": "conflict",
"message": "Conflict"
}
}
```
### Fetch subscription offset (GET /subscriptions/offset)
Fetch the current offset for a subscriber, indicating the position up to which events have been acknowledged.
#### Security
The endpoint supports the following authorization methods: `OAuth 2.0`
For OAuth2 authorization method, one of the following scopes is required by the endpoint:
* `urn:acronis.com:event_manager:{cti_query}:subscriber`
#### Request parameters
##### Query parameters
| Name | Description |
|------|-------------|
| `subscription_id` | (Required) Required. Identifier of the subscription.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$` |
#### Responses
##### `200`
**Media type**: `application/json`
- `subscription_id` — Unique identifier of the subscription.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
- `offset` — Latest committed offset of the subscriber.
**Type**: Long
**Format**: int64
**Example**:
```json
{
"subscription_id": "fd02a25c-fcb0-42a0-a5ce-56c1131db356",
"offset": 0
}
```
##### `401` — Method required an authenticated user
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "accessDenied",
"message": "Access denied."
}
}
```
##### `403` — Current user has no permissions for this URL/method
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_1`*:
```json
{
"error": {
"domain": "EventManager",
"code": "bearerTokenMissing",
"message": "Authorization bearer token is missing."
}
}
```
##### `500` — Internal service error
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "internalServiceError",
"message": "Internal service error"
}
}
```
### Fetch events (GET /events)
Fetch a batch of events starting from a specified cursor position, supporting real-time event consumption with optional limits and timeouts.
#### Security
The endpoint supports the following authorization methods: `OAuth 2.0`
For OAuth2 authorization method, one of the following scopes is required by the endpoint:
* `urn:acronis.com:event_manager:{cti_query}:subscriber`
#### Request parameters
##### Query parameters
| Name | Description |
|------|-------------|
| `subscription_id` | (Required) Required. Identifier of the subscription under which events are being consumed. Used in conjunction with instance_id to manage event distribution.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$` |
| `consumer_id` | (Required) Required. Unique identifier for the consumer instance, ensuring event distribution among multiple instances.
**Type**: String
**Pattern**: `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$` |
| `offset` | (Required) Required. Specifies the starting point for event fetching, allowing instances to resume from a precise position.
**Type**: Long
**Format**: int64 |
| `limit` | (Optional) Optional. Limits the number of events returned in one response. Helps manage processing load.
**Type**: Integer
**Default**: 100 |
| `timeout` | (Optional) Optional. Time to wait for events to become available in ISO 8601 duration format. Can be decreased by the server to the session timeout of the subscription.
**Type**: String
**Pattern**: `^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$`
**Default**: PT30S |
#### Responses
##### `200`
**Media type**: `application/json`
- `offset` — Latest offset of the subscriber. This is the offset that should be used in the next poll request.
**Type**: Long
**Format**: int64
- `events` — A batch of events starting from the cursor position for each partition.
**Type**: Array of Object
**Array type description:**
Defines the structure of the event that has occurred.
Events will contain two types of information: the event data representing the occurrence and context metadata providing contextual information about the occurrence. A single occurrence may result in more than one event.
Events are limited to a maximum size of 64KB, which includes both headers and payload.
**Type**: Object
**Max items**: 100
**Example**:
```json
{
"offset": 0,
"events": [
{
"tenant_id": "abbf321a-7d6a-49c9-8538-47db342d1638",
"source": "123",
"previous": 1,
"data": {
"message": "Hello, World!"
},
"id": "eb39471d-a1c5-44d4-8a2a-cb413d720e87",
"sequence": 2,
"ingest_time": "2021-04-15T19:41:40.1007002Z",
"time": "2022-03-31T10:43:21Z",
"type": "cti.a.p.em.event.v1.0~a.p.test.async.event.v1.0"
}
]
}
```
##### `429` — This response indicates that the client must retry the request later. There are two possible reasons:
1. **Non-leader consumer instance**: The client is attempting to consume events as a non-leader instance.
Only the leader instance is allowed to consume events.
The client should retry after the time specified in the `Retry-After` header to attempt to become the leader.
2. **Rate limiting**: The client has exceeded the allowed rate of event consumption, either by sending too many poll requests or consuming too many events in a given period.
The client should wait before retrying, as specified in the `Retry-After` header.
##### `401` — Method required an authenticated user
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "accessDenied",
"message": "Access denied."
}
}
```
##### `403` — Current user has no permissions for this URL/method
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_1`*:
```json
{
"error": {
"domain": "EventManager",
"code": "bearerTokenMissing",
"message": "Authorization bearer token is missing."
}
}
```
##### `500` — Internal service error
**Media type**: `application/json`
- `error` — Base error object
**Type**: Object
**Example**:
*`example_0`*:
```json
{
"error": {
"domain": "EventManager",
"code": "internalServiceError",
"message": "Internal service error"
}
}
```