time-points

Create time points

POST /v1/time-points

Writes require a UUID Idempotency-Key. Retry the same operation with the same key, body and etag. Results are retained for 30 days; reconcile the outcome before retrying later. Legacy timestamp:UUID keys remain accepted.

Parameters

Idempotency-Key

header · Required

Writes require a UUID Idempotency-Key. Retry the same operation with the same key, body and etag. Results are retained for 30 days; reconcile the outcome before retrying later. Legacy timestamp:UUID keys remain accepted.

Type: string

Complete JSON Schema
{
  "type": "string"
}

Request body

Required

application/json

Type: object

FieldTypeRequiredDescription and constraints
timestringYesISO 8601 timestamp with a time zone {"format":"date-time"}
detailstring | nullNoEntry description
detail (anyOf 1)stringNo{"maxLength":65536}
detail (anyOf 2)nullNo
colorHexstring | nullNoHexadecimal color
colorHex (anyOf 1)stringNo{"maxLength":65536}
colorHex (anyOf 2)nullNo
isUsedbooleanNoWhether used
isTriggeredByUserbooleanNoWhether triggered by the user
Complete JSON Schema
{
  "type": "object",
  "required": [
    "time"
  ],
  "properties": {
    "time": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp with a time zone"
    },
    "detail": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 65536
        },
        {
          "type": "null"
        }
      ],
      "description": "Entry description"
    },
    "colorHex": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 65536
        },
        {
          "type": "null"
        }
      ],
      "description": "Hexadecimal color"
    },
    "isUsed": {
      "type": "boolean",
      "description": "Whether used"
    },
    "isTriggeredByUser": {
      "type": "boolean",
      "description": "Whether triggered by the user"
    }
  },
  "additionalProperties": false
}

Request example

Replace path and request parameters with actual values. For requests with a body, save it as request.json using the schema above.

curl --fail-with-body --request POST 'https://api.treering.cn/v1/time-points' \
  --header "Authorization: Bearer $TREERING_API_TOKEN" \
  --header 'Idempotency-Key: <Idempotency-Key>' \
  --header 'Content-Type: application/json' \
  --data-binary @request.json

Responses

201

Successful response; status depends on the operation result.

application/json

Type: object

FieldTypeRequiredDescription and constraints
idstringYesResource, job or operation identifier
versionstringYesVersion as a decimal string; do not convert to a floating-point number {"pattern":"^(0|[1-9][0-9]*)$"}
etagstringYesConcurrency tag; preserve quotes when sending If-Match
updatedAtstringYesLast server update timestamp
operationIdstringNoRequest receipt identifier; no status polling is needed
deletedAtstringNoDeletion timestamp
timestring | nullNoISO 8601 timestamp with a time zone
time (anyOf 1)stringNo
time (anyOf 2)nullNo
detailstring | nullNoEntry description
detail (anyOf 1)stringNo
detail (anyOf 2)nullNo
colorHexstring | nullNoHexadecimal color
colorHex (anyOf 1)stringNo
colorHex (anyOf 2)nullNo
isUsedbooleanNoWhether used
isTriggeredByUserbooleanNoWhether triggered by the user
sourcestring | nullNoSource label
source (anyOf 1)stringNo
source (anyOf 2)nullNo
Complete JSON Schema
{
  "type": "object",
  "required": [
    "id",
    "version",
    "etag",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Resource, job or operation identifier"
    },
    "version": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$",
      "description": "Version as a decimal string; do not convert to a floating-point number"
    },
    "etag": {
      "type": "string",
      "description": "Concurrency tag; preserve quotes when sending If-Match"
    },
    "updatedAt": {
      "type": "string",
      "description": "Last server update timestamp"
    },
    "operationId": {
      "type": "string",
      "description": "Request receipt identifier; no status polling is needed"
    },
    "deletedAt": {
      "type": "string",
      "description": "Deletion timestamp"
    },
    "time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "ISO 8601 timestamp with a time zone"
    },
    "detail": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Entry description"
    },
    "colorHex": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Hexadecimal color"
    },
    "isUsed": {
      "type": "boolean",
      "description": "Whether used"
    },
    "isTriggeredByUser": {
      "type": "boolean",
      "description": "Whether triggered by the user"
    },
    "source": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Source label"
    }
  },
  "additionalProperties": false
}

400, 401, 403, 404, 409, 410, 413, 422, 429, 500, 503

Error response; branch on code.

application/json

Type: object

FieldTypeRequiredDescription and constraints
codestringYesMachine-readable error code
messagestringNoError message; use code for program logic
requestIdstringNoRequest trace identifier
operationIdstringNoRequest receipt identifier; no status polling is needed
Complete JSON Schema
{
  "type": "object",
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Error message; use code for program logic"
    },
    "requestId": {
      "type": "string",
      "description": "Request trace identifier"
    },
    "operationId": {
      "type": "string",
      "description": "Request receipt identifier; no status polling is needed"
    }
  },
  "additionalProperties": true
}

On this page