tags

List tags

GET /v1/tags

Default page size 100, maximum 500. Keep filters and pass nextCursor to continue. Data can change during pagination; use full export for a backup.

Parameters

archived

query · Optional

Archive filter: active, only or all

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "active",
    "only",
    "all"
  ]
}

limit

query · Optional

Page size; default 100, maximum 500

Type: string

Complete JSON Schema
{
  "type": "string",
  "pattern": "^(?:[1-9][0-9]?|[1-4][0-9]{2}|500)$"
}

cursor

query · Optional

Opaque cursor; return unchanged, do not parse

Type: string

Complete JSON Schema
{
  "type": "string",
  "maxLength": 8192
}

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 GET 'https://api.treering.cn/v1/tags' \
  --header "Authorization: Bearer $TREERING_API_TOKEN"

Responses

200

Successful response; status depends on the operation result.

application/json

Type: object

FieldTypeRequiredDescription and constraints
itemsarray<object>YesResources, events or operation results
items[]objectNo{"additionalProperties":false}
items[].idstringYesResource, job or operation identifier
items[].versionstringYesVersion as a decimal string; do not convert to a floating-point number {"pattern":"^(0|[1-9][0-9]*)$"}
items[].etagstringYesConcurrency tag; preserve quotes when sending If-Match
items[].updatedAtstringYesLast server update timestamp
items[].operationIdstringNoRequest receipt identifier; no status polling is needed
items[].deletedAtstringNoDeletion timestamp
items[].namestring | nullNoName
items[].name (anyOf 1)stringNo
items[].name (anyOf 2)nullNo
items[].parentIdstring | nullNoParent tag ID, or null for a root tag
items[].parentId (anyOf 1)stringNo
items[].parentId (anyOf 2)nullNo
items[].archiveTimestring | nullNoArchive timestamp; null means active
items[].archiveTime (anyOf 1)stringNo
items[].archiveTime (anyOf 2)nullNo
items[].createTimestring | nullNoOriginal creation timestamp
items[].createTime (anyOf 1)stringNo
items[].createTime (anyOf 2)nullNo
items[].sourcestring | nullNoSource label
items[].source (anyOf 1)stringNo
items[].source (anyOf 2)nullNo
hasMorebooleanYesWhether another page is available
nextCursorstring | nullYesNext-page cursor, or null on the final page
nextCursor (anyOf 1)stringNo
nextCursor (anyOf 2)nullNo
evaluatedAtstringYesServer evaluation timestamp
effectiveRangeobject | nullYesFixed effective range for this query
effectiveRange (anyOf 1)objectNo
effectiveRange (anyOf 1).fromstringYesInclusive start timestamp; provide with to
effectiveRange (anyOf 1).tostringYesExclusive end timestamp; provide with from
effectiveRange (anyOf 2)nullNo
Complete JSON Schema
{
  "type": "object",
  "required": [
    "items",
    "hasMore",
    "nextCursor",
    "evaluatedAt",
    "effectiveRange"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "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"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name"
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Parent tag ID, or null for a root tag"
          },
          "archiveTime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Archive timestamp; null means active"
          },
          "createTime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Original creation timestamp"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source label"
          }
        },
        "additionalProperties": false
      },
      "description": "Resources, events or operation results"
    },
    "hasMore": {
      "type": "boolean",
      "description": "Whether another page is available"
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Next-page cursor, or null on the final page"
    },
    "evaluatedAt": {
      "type": "string",
      "description": "Server evaluation timestamp"
    },
    "effectiveRange": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "from",
            "to"
          ],
          "properties": {
            "from": {
              "type": "string",
              "description": "Inclusive start timestamp; provide with to"
            },
            "to": {
              "type": "string",
              "description": "Exclusive end timestamp; provide with from"
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Fixed effective range for this query"
    }
  }
}

400, 401, 403, 404, 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