Export metrics data
POST/projects/{projectId}/entities/{entityId}/metrics/{metricsDefinitionId}/export
Base URL: https://api.tinkermode.com
Export the metrics data.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a user API key of a user with permission to read the entity metrics, a service account token with the same permission, or a project API key.
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) | |
metricsDefinitionId | string | Yes | Metrics definition ID (unique within entity class) |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
begin | string | Yes | The beginning time of the data entries. The format follows RFC3339. The exported CSV shows timestamps in the same time zone offset as this value. For example, if begin is 2026-10-01T00:00:00+09:00, a data point recorded at 2026-10-01T00:30:00Z appears as 2026/10/01 09:30:00. If begin ends with Z, the timestamps are in UTC. | |
end | string | Yes | The end time of the data entries. The format follows RFC3339. It must be later than begin. Otherwise the request fails with 403 and the reason INVALID_PARAMETERS. | |
fileName | string | No | Optional parameter to specify the export CSV file name. If omitted, metrics definition ID will be used in the file name. | |
includeHeader | boolean | No | If true, the exported CSV file will start with a header. | |
timeFormat | string | No | Optional parameter to specify the timestamp format in the exported CSV. Use "rfc3339Milli" for RFC3339 format with millisecond precision. If omitted, the default format (YYYY/MM/DD HH:MM:SS) is used. |
Responses
200 The URLs for downloading the exported data are returned.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
dataUrl | string | Yes | read-only (server-generated) | URL of file containing the exported data. This URL is usable only if the export is completed successfully. |
statusUrl | string | Yes | read-only (server-generated) | URL to a JSON file that reports the status of the export. Clients should poll this URL until a file is returned. |
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. |