presets

Update presets

PATCH /v1/presets/{id}

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.

Requires If-Match copied from the current etag, including quotes. Missing: 428; conflict: 412.

Parameters

id

path · Required

Resource, job or operation identifier

Type: string

Complete JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 512
}

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"
}

If-Match

header · Required

Requires If-Match copied from the current etag, including quotes. Missing: 428; conflict: 412.

Type: string

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

Request body

Required

application/json

Type: object

FieldTypeRequiredDescription and constraints
detailstring | nullNoEntry description
detail (anyOf 1)stringNo{"maxLength":65536}
detail (anyOf 2)nullNo
projectIdstring | nullNoProject ID, or null
projectId (anyOf 1)stringNo{"minLength":1,"maxLength":512}
projectId (anyOf 2)nullNo
tagIdsarray<string>NoTag IDs; comma-separated GET filter, array in bodies {"maxItems":100}
tagIds[]stringNo{"minLength":1,"maxLength":512}
archiveTimestring | nullNoArchive timestamp; null means active
archiveTime (anyOf 1)stringNo{"format":"date-time"}
archiveTime (anyOf 2)nullNo
Complete JSON Schema
{
  "type": "object",
  "properties": {
    "detail": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 65536
        },
        {
          "type": "null"
        }
      ],
      "description": "Entry description"
    },
    "projectId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "description": "Project ID, or null"
    },
    "tagIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 512
      },
      "maxItems": 100,
      "description": "Tag IDs; comma-separated GET filter, array in bodies"
    },
    "archiveTime": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "description": "Archive timestamp; null means active"
    }
  }
}

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 PATCH 'https://api.treering.cn/v1/presets/{id}' \
  --header "Authorization: Bearer $TREERING_API_TOKEN" \
  --header 'Idempotency-Key: <Idempotency-Key>' \
  --header 'If-Match: <If-Match>' \
  --header 'Content-Type: application/json' \
  --data-binary @request.json

Responses

200

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
detailstring | nullNoEntry description
detail (anyOf 1)stringNo
detail (anyOf 2)nullNo
projectIdstring | nullNoProject ID, or null
projectId (anyOf 1)stringNo
projectId (anyOf 2)nullNo
tagIdsarray<string>NoTag IDs; comma-separated GET filter, array in bodies
tagIds[]stringNo
archiveTimestring | nullNoArchive timestamp; null means active
archiveTime (anyOf 1)stringNo
archiveTime (anyOf 2)nullNo
createTimestring | nullNoOriginal creation timestamp
createTime (anyOf 1)stringNo
createTime (anyOf 2)nullNo
orderstringNoRead-only position from client ordering; adjust ordering in the Treering app {"pattern":"^(0|[1-9][0-9]*)$"}
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"
    },
    "detail": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Entry description"
    },
    "projectId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Project ID, or null"
    },
    "tagIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tag IDs; comma-separated GET filter, array in bodies"
    },
    "archiveTime": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Archive timestamp; null means active"
    },
    "createTime": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Original creation timestamp"
    },
    "order": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$",
      "description": "Read-only position from client ordering; adjust ordering in the Treering app"
    }
  },
  "additionalProperties": false
}

400, 401, 403, 404, 409, 412, 413, 422, 428, 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