Spot Integration Event Types API
The Integration Event Types API from Spot — 2 operation(s) for integration event types.
The Integration Event Types API from Spot — 2 operation(s) for integration event types.
openapi: 3.0.0
info:
title: Spot AI — Spot Connect (beta) Analytics Integration Event Types API
version: 1.10.0
description: Spot AI Developer API
contact:
name: Spot AI
url: https://developers.spot.ai/
servers:
- url: https://dev-api.spot.ai/
tags:
- name: Integration Event Types
paths:
/v1/integrations/{integration_id}/event-types:
post:
operationId: CreateIntegrationEventType
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationEventTypeResult'
examples:
Example 1:
value:
integration_event_type:
id: 51
integration_id: 1
name: POS Transaction
schema:
type: object
properties:
store_id:
type: string
lane:
type: number
transaction_id:
type: string
required:
- store_id
- lane
external_device_id_template: '{store_id}:{lane}'
created: '2023-06-29T12:20:05.533Z'
updated: '2023-06-29T12:20:05.533Z'
'422':
description: Validation Failed
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: 'This endpoint creates a new integration event type.
Users will be able to define their own event schema by specifying
key-value pairs in json schema format conforming to Spot''s meta-schema.'
summary: Create integration event type
tags:
- Integration Event Types
security:
- bearer_security: []
parameters:
- description: '- ID of the integration that the event type belongs to'
in: path
name: integration_id
required: true
schema:
format: int32
type: integer
requestBody:
description: '- Integration event type information'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pick_IntegrationEventType.name-or-schema-or-duration-or-buffer-or-external_device_id_template_'
description: '- Integration event type information'
get:
operationId: GetAllEventTypesForIntegration
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationEventTypeListResult'
examples:
Example 1:
value:
integration_event_types:
- id: 51
integration_id: 1
name: POS Transaction
schema:
type: object
properties:
store_id:
type: string
lane:
type: number
transaction_id:
type: string
required:
- store_id
- lane
external_device_id_template: '{store_id}:{lane}'
created: '2023-06-29T12:20:05.533Z'
updated: '2023-06-29T12:20:05.533Z'
prev: eyAiaWQiOiA1MCwgImRpcmVjdGlvbiI6ICJwcmV2IiB9
next: eyAiaWQiOiAxMDEsICJkaXJlY3Rpb24iOiAibmV4dCIgfQ==
'422':
description: Validation Failed
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: 'This endpoint returns a paginated list of all integration event types
associated with an integration that the caller has access to.
Event types that the caller does not have access to will not be included
in the response.'
summary: Get all event types for integration
tags:
- Integration Event Types
security:
- bearer_security: []
parameters:
- description: '- ID of the integration that the event types belong to'
in: path
name: integration_id
required: true
schema:
format: int32
type: integer
- description: '- Cursor for pagination'
in: query
name: cursor
required: false
schema:
type: string
- description: '- Number of cameras to return. Max 100'
in: query
name: limit
required: false
schema:
format: int32
type: integer
/v1/integrations/{integration_id}/event-types/{integration_event_type_id}:
delete:
operationId: DeleteIntegrationEventType
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationEventTypeResult'
examples:
Example 1:
value:
integration_event_type:
id: 51
integration_id: 1
name: POS Transaction
schema:
type: object
properties:
store_id:
type: string
lane:
type: number
transaction_id:
type: string
required:
- store_id
- lane
external_device_id_template: '{store_id}:{lane}'
created: '2023-06-29T12:20:05.533Z'
updated: '2023-06-29T12:20:05.533Z'
'422':
description: Validation Failed
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: Deletes an integration event type. All events of that integration event type will also be deleted.
summary: Delete integration event type
tags:
- Integration Event Types
security:
- bearer_security: []
parameters:
- description: '- ID of the integration that the event type belongs to'
in: path
name: integration_id
required: true
schema:
format: int32
type: integer
- description: '- ID of the integration event type'
in: path
name: integration_event_type_id
required: true
schema:
format: int32
type: integer
get:
operationId: GetIntegrationEventTypeById
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationEventTypeResult'
examples:
Example 1:
value:
integration_event_type:
id: 51
integration_id: 1
name: POS Transaction
schema:
type: object
properties:
store_id:
type: string
lane:
type: number
transaction_id:
type: string
required:
- store_id
- lane
external_device_id_template: '{store_id}:{lane}'
created: '2023-06-29T12:20:05.533Z'
updated: '2023-06-29T12:20:05.533Z'
'422':
description: Validation Failed
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: 'This endpoint returns details of an integration event type.
Details include integration event type name and integration event type schema.'
summary: Get integration event type by id
tags:
- Integration Event Types
security:
- bearer_security: []
parameters:
- description: '- ID of the integration that the event type belongs to'
in: path
name: integration_id
required: true
schema:
format: int32
type: integer
- description: '- ID of the integration event type'
in: path
name: integration_event_type_id
required: true
schema:
format: int32
type: integer
put:
operationId: UpdateIntegrationEventType
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationEventTypeResult'
examples:
Example 1:
value:
integration_event_type:
id: 51
integration_id: 1
name: POS Transaction
schema:
type: object
properties:
store_id:
type: string
lane:
type: number
transaction_id:
type: string
required:
- store_id
- lane
external_device_id_template: '{store_id}:{lane}'
created: '2023-06-29T12:20:05.533Z'
updated: '2023-06-29T12:20:05.533Z'
'422':
description: Validation Failed
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: This endpoint can be used to update properties of an integration event type.
summary: Update integration event type name
tags:
- Integration Event Types
security:
- bearer_security: []
parameters:
- description: '- ID of the integration that the event type belongs to'
in: path
name: integration_id
required: true
schema:
format: int32
type: integer
- description: '- ID of the integration event type'
in: path
name: integration_event_type_id
required: true
schema:
format: int32
type: integer
requestBody:
description: '- JSON object containing the updated integration event type information'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pick_IntegrationEventType.name-or-schema-or-duration-or-buffer-or-external_device_id_template_'
description: '- JSON object containing the updated integration event type information'
components:
schemas:
ValidationError:
properties:
name:
type: string
message:
type: string
details:
items:
$ref: '#/components/schemas/ValidationErrorDetails'
type: array
required:
- name
- message
- details
type: object
additionalProperties: false
Pick_IntegrationEventType.name-or-schema-or-duration-or-buffer-or-external_device_id_template_:
properties:
name:
type: string
description: The name of the integration event type
example: My Integration Event Type
minLength: 1
maxLength: 40
schema:
additionalProperties: false
type: object
description: 'The schema of the integration event type, in JSON Schema format.
Defines the structure of event attributes that will be validated on ingestion.'
example:
type: object
properties:
store_id:
type: string
lane:
type: number
required:
- store_id
- lane
duration:
type: integer
format: int64
description: The default duration of the integration event type, in milliseconds
maximum: 600000
buffer:
type: integer
format: int64
description: The default buffer of the integration event type, in milliseconds
maximum: 120000
external_device_id_template:
type: string
description: 'A template string for generating external device IDs from event attributes.
When set, Spot will automatically create or match devices based on the
evaluated template value from each incoming event''s attributes.
**Template Syntax**: Use `{property_name}` to reference event attributes.
Nested properties are supported: `{metadata.store.id}`.
**Requirements**:
- Template must contain at least one variable
- All referenced properties must be marked as `required` in the schema
- Empty strings are not allowed
**Example**: For a schema with required properties `store_id` and `lane`,
the template `{store_id}:{lane}` would generate device IDs like `"STORE001:3"`.
When omitted, events must explicitly specify a device_id during ingestion.'
example: '{store_id}:{lane}'
required:
- name
- schema
type: object
description: From T, pick a set of properties whose keys are in the union K
IntegrationEventType:
properties:
id:
type: integer
format: int32
integration_id:
type: integer
format: int32
description: The ID of the integration this event type is associated with
example: 1
name:
type: string
description: The name of the integration event type
example: My Integration Event Type
minLength: 1
maxLength: 40
duration:
type: integer
format: int64
description: The default duration of the integration event type, in milliseconds
maximum: 600000
buffer:
type: integer
format: int64
description: The default buffer of the integration event type, in milliseconds
maximum: 120000
schema:
additionalProperties: false
type: object
description: The schema of the integration event type, in JSON Schema format
created:
type: string
format: date-time
description: The date this integration event type was created
example: '2023-06-29T12:20:05.533Z'
updated:
type: string
format: date-time
description: The date this integration event type was last updated
example: '2023-06-29T12:20:05.533Z'
required:
- id
- integration_id
- name
- schema
- created
- updated
type: object
additionalProperties: false
ValidationErrorDetails:
properties:
field:
type: string
message:
type: string
value: {}
required:
- field
- message
type: object
additionalProperties: false
IntegrationEventTypeListResult:
properties:
prev:
type: string
nullable: true
next:
type: string
nullable: true
integration_event_types:
items:
$ref: '#/components/schemas/IntegrationEventType'
type: array
required:
- prev
- next
- integration_event_types
type: object
additionalProperties: false
IntegrationEventTypeResult:
properties:
integration_event_type:
$ref: '#/components/schemas/IntegrationEventType'
required:
- integration_event_type
type: object
additionalProperties: false
securitySchemes:
bearer_security:
type: http
scheme: bearer