> ## Documentation Index
> Fetch the complete documentation index at: https://learn.servitly.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Update an event
> Update a historical event, for instance to correct its severity, to complete its description and notes, or to set the endTimestamp that closes it.
Being a full update, the payload should provide the complete event object.
## OpenAPI
````json PUT /inventory/historicalEvents/{eventId}
{
"openapi": "3.1.0",
"info": {
"title": "Servitly DPS API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.servitly-sandbox.com",
"description": "[AWS SANDBOX]"
},
{
"url": "https://api.servitly.com",
"description": "[AWS PRODUCTION Ireland]"
},
{
"url": "https://api-ap.servitly.com",
"description": "[AWS Hong Kong]"
},
{
"url": "https://azapi.servitly-dev.com",
"description": "[AZURE DEV Frankfurt]"
},
{
"url": "https://azapi.servitly-staging.com",
"description": "[AZURE STAGING Frankfurt]"
},
{
"url": "https://azapi.servitly.com",
"description": "[AZURE PRODUCTION Frankfurt]"
}
],
"security": [
{
"bearerAuth": []
}
],
"tags": [
{
"name": "ACTIONS"
},
{
"name": "ALERTS"
},
{
"name": "API GATEWAY"
},
{
"name": "AUTHENTICATION"
},
{
"name": "AUTHORIZATIONS"
},
{
"name": "CUSTOMERS"
},
{
"name": "DATA IMPORT / EXPORT"
},
{
"name": "EVENTS"
},
{
"name": "LOCATIONS"
},
{
"name": "MAINTENANCE"
},
{
"name": "MAPPING"
},
{
"name": "METRIC DATA"
},
{
"name": "MOBILE APP"
},
{
"name": "ORGANIZATION"
},
{
"name": "PARTNERS"
},
{
"name": "PRODUCT MODELS"
},
{
"name": "SPARE PARTS"
},
{
"name": "STATISTICS"
},
{
"name": "STORE ORDERS"
},
{
"name": "SUBSCRIPTIONS"
},
{
"name": "SUBSCRIPTIONS (OLD)"
},
{
"name": "THING CONTROL"
},
{
"name": "THING DEFINITIONS"
},
{
"name": "THING MANAGEMENT"
},
{
"name": "THINGS"
},
{
"name": "TICKETS"
},
{
"name": "USER TYPES"
},
{
"name": "USERS"
},
{
"name": "WORK SESSIONS"
}
],
"paths": {
"/inventory/historicalEvents/{eventId}": {
"put": {
"summary": "Update an event",
"description": "Update a historical event, for instance to correct its severity, to complete its description and notes, or to set the endTimestamp that closes it.
Being a full update, the payload should provide the complete event object.",
"tags": [
"EVENTS"
],
"parameters": [
{
"$ref": "#/components/parameters/tenantNameHeader"
},
{
"in": "path",
"name": "eventId",
"required": "true",
"schema": {
"$ref": "#/components/schemas/ObjectId"
},
"description": "The event identifier."
}
],
"requestBody": {
"description": "The details of the event to update.",
"required": "true",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated."
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/NotAuthenticated"
},
"403": {
"$ref": "#/components/responses/NotAuthorized"
},
"429": {
"$ref": "#/components/responses/ApiLimit"
},
"500": {
"$ref": "#/components/responses/IntError"
}
}
}
}
},
"components": {
"parameters": {
"tenantNameHeader": {
"in": "header",
"name": "X-Servitly-Tenant",
"required": "true",
"schema": {
"type": "string",
"example": "{{tenantName}}"
},
"description": "The name of the tenant (e.g. acme)."
}
},
"schemas": {
"ObjectId": {
"type": "string",
"example": "abcd1234",
"minimum": "1",
"description": "The object identifier (e.g. 6620e4bb42541977c406b984)."
},
"Event": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The event object identifier.",
"readOnly": "true",
"example": "1234abcd"
},
"alertDefinitionId": {
"type": "string",
"description": "The identifier of the event-definition associated with the event.",
"example": "1234abcd"
},
"name": {
"type": "string",
"description": "The event name.",
"readOnly": "true",
"example": "E450"
},
"title": {
"type": "string",
"description": "The event title.",
"readOnly": "true",
"example": "Overheating"
},
"description": {
"type": "string",
"description": "The event description.",
"readOnly": "true",
"example": "High temperature detected"
},
"technicalDescription": {
"type": "string",
"description": "The event technical description.",
"readOnly": "true"
},
"startTimestamp": {
"type": "integer",
"format": "int64",
"description": "The event start timestamp.",
"example": "1578438000000"
},
"endTimestamp": {
"type": "integer",
"format": "int64",
"description": "The event end timestamp.",
"example": "1578438000000"
},
"eventSeverity": {
"type": "integer",
"enum": [
"1",
"2",
"3",
"4",
"5"
],
"description": "The event severity (1:FAILURE, 2:MAJOR ANOMALY, 3:MINOR ANOMALY, 4:OPERATION, 5:MAINTENANCE).",
"readOnly": "true"
},
"customerId": {
"type": "string",
"description": "The customer identifier associated with the event.",
"readOnly": "true"
},
"locationId": {
"type": "string",
"description": "The location identifier associated with the event."
},
"thingId": {
"type": "string",
"description": "The thing identifier associated with the event."
},
"activateUserEmail": {
"type": "string",
"description": "The email of the user who has reported the event.",
"example": "mark.hamill@abon-metal.com"
},
"notes": {
"type": "string",
"description": "The text notes in case of User Reported event.",
"example": "The machine was...."
}
}
}
},
"responses": {
"BadRequest": {
"description": "Request data not valid.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "Bad request"
}
}
}
}
}
},
"NotAuthenticated": {
"description": "User not authenticated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "User not authenticated"
}
}
}
}
}
},
"NotAuthorized": {
"description": "User not authorized.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "User not authorized"
}
}
}
}
}
},
"ApiLimit": {
"description": "API call rate limit exceeded.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "API call rate limit exceeded"
}
}
}
}
}
},
"IntError": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "Internal Server Error"
}
}
}
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
}
}
````