Create event subscription
POST/projects/{projectId}/entities/{entityId}/assistants/{assistantId}/eventSubscriptions
Base URL: https://api.tinkermode.com
Create a new event subscription for the Entity AI Assistant instance. This endpoint is available only for Entity-level Assistants.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain the key of a user or service account with permissions to update assistants of the entity, or a project API key with admin permission.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
projectId | integer | Yes | The unique ID for a specified project. | |
entityId | string | Yes | Entity ID (unique within project) | |
assistantId | integer | Yes | The unique ID for a specific assistant. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
actions | array<object> | Yes | The actions to take when the event is triggered. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assistantId | integer | Yes | The unique identifier for the AI Assistant instance this event subscription belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | string | No | read-only (server-generated); format: date-time | Timestamp when the event subscription was created. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description | string | No | A description of the event subscription. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
disabled | boolean | No | Whether the event subscription is disabled. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eventType | string | Yes | The type of event to subscribe to. The pair of (assistantId, eventType) must be unique. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | integer | No | read-only (server-generated) | The unique identifier for the event subscription. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name | string | Yes | Display name of the event subscription. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectId | integer | Yes | The unique identifier for the project the event subscription belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
updatedAt | string | No | read-only (server-generated); format: date-time | Timestamp when the event subscription was last updated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Responses
201 Successfully created the event subscription.
Content type: application/json
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
actions | array<object> | Yes | The actions to take when the event is triggered. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
assistantId | integer | Yes | The unique identifier for the AI Assistant instance this event subscription belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | string | No | read-only (server-generated); format: date-time | Timestamp when the event subscription was created. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description | string | No | A description of the event subscription. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
disabled | boolean | No | Whether the event subscription is disabled. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eventType | string | Yes | The type of event to subscribe to. The pair of (assistantId, eventType) must be unique. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | integer | No | read-only (server-generated) | The unique identifier for the event subscription. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name | string | Yes | Display name of the event subscription. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectId | integer | Yes | The unique identifier for the project the event subscription belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
updatedAt | string | No | read-only (server-generated); format: date-time | Timestamp when the event subscription was last updated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |