Create a time series collection

POST/homes/{homeId}/smartModules/{moduleId}/collections

Base URL: https://api.tinkermode.com

Create a new time series collection for this home. Normally a collection is automatically created when data points are first injected. However, such collections are automatically defaulted to the UTC time zone. Collections that are meant to be in a specific time zone should be explicitly created with this endpoint ahead of time, before any data points are injected. The request body must contain the id and timeZone fields.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain a user, service account, or project API key.

Path parameters

NameTypeRequiredConstraintsDescription
homeIdintegerYesThe unique id for a home.
moduleIdstringYesThe unique id for a smart module.

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
homeIdintegerNoread-only (server-generated)Home that this collection belongs to.
idstringNoread-only (server-generated); pattern: ^[a-zA-Z0-9]([a-zA-Z0-9\-_\:]*[a-zA-Z0-9])*$Time Series Collection ID. Must be unique within each home. Must be 1 or more alphanumeric characters and may contain dashes ('-'), underscores ('_'), and colons (':') may be used after the first character but must be followed by 1+ alphanumeric characters.
moduleIdstringNoread-only (server-generated)ID of Smart Module that created this collection.
tagNamesarrayNoread-only (server-generated)List of unique Identifiers of string tags in collection.
timeZonestringNoread-only (server-generated)If present, collection is associated with a time zone that is not UTC. This should be a time zone name defined in the IANA TZ Database.
valueNamesarrayNoread-only (server-generated)List of unique Identifiers of numerical fields in collection.

Request example

{
  "id": "sensor1_measurements",
  "timeZone": "America/New_York"
}

Responses

201 Collection successfully created.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
homeIdintegerNoread-only (server-generated)Home that this collection belongs to.
idstringNoread-only (server-generated); pattern: ^[a-zA-Z0-9]([a-zA-Z0-9\-_\:]*[a-zA-Z0-9])*$Time Series Collection ID. Must be unique within each home. Must be 1 or more alphanumeric characters and may contain dashes ('-'), underscores ('_'), and colons (':') may be used after the first character but must be followed by 1+ alphanumeric characters.
moduleIdstringNoread-only (server-generated)ID of Smart Module that created this collection.
tagNamesarrayNoread-only (server-generated)List of unique Identifiers of string tags in collection.
timeZonestringNoread-only (server-generated)If present, collection is associated with a time zone that is not UTC. This should be a time zone name defined in the IANA TZ Database.
valueNamesarrayNoread-only (server-generated)List of unique Identifiers of numerical fields in collection.

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.