Create TSDBv2 Metric

POST/projects/{projectId}/tsdb/v2/schemas/{schemaName}/metrics

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

Creates an additional metric in a schema.

Authentication

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

Must contain a project API key.

Path parameters

NameTypeRequiredConstraintsDescription
projectIdintegerYesThe unique ID for a specified project.
schemaNamestringYesName of the schema.

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
namestringYesName of the metric.
tagsarray<object>NoKey and optional value pairs that can be used to filter metrics.
Properties of tags
PropertyTypeRequiredConstraintsDescription
keystringYesName of the metric tag.
valuestringNoValue of the metric tag.
typestringNoone of: float, stringData type of this metric. The default is float.

Request example

{
  "name": "bar_metric",
  "tags": [
    {
      "key": "location",
      "value": "outside"
    }
  ],
  "type": "string"
}

Responses

201 Successfully created the metric.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
namestringYesName of the metric.
tagsarray<object>NoKey and optional value pairs that can be used to filter metrics.
Properties of tags
PropertyTypeRequiredConstraintsDescription
keystringYesName of the metric tag.
valuestringNoValue of the metric tag.
typestringNoone of: float, stringData type of this metric. The default is float.

Response example

{
  "name": "bar_metric",
  "tags": [
    {
      "key": "location",
      "value": "outside"
    }
  ],
  "type": "string"
}

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.