exports

Get export status

GET /v1/exports/{id}

Return export status and file details. Follow Retry-After until state=ready; inspect errorCode if failed.

Parameters

id

path · Required

Resource, job or operation identifier

Type: string

Complete JSON Schema
{
  "type": "string",
  "format": "uuid"
}

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/exports/{id}' \
  --header "Authorization: Bearer $TREERING_API_TOKEN"

Responses

200

Successful response; status depends on the operation result.

application/json

Type: object

FieldTypeRequiredDescription and constraints
idstringYesResource, job or operation identifier
statestringYesEntry, job or operation state; meaning depends on the endpoint {"enum":["queued","building","ready","failed","expired"]}
errorCodestring | nullYesJob error code, or null
errorCode (anyOf 1)stringNo
errorCode (anyOf 2)nullNo
snapshotAtstring | nullYesTimestamp at which the export data was captured
snapshotAt (anyOf 1)stringNo
snapshotAt (anyOf 2)nullNo
expiresAtstring | nullYesExport file expiry; null before generation
expiresAt (anyOf 1)stringNo
expiresAt (anyOf 2)nullNo
bytesstring | nullYesFile size in bytes as a decimal string
bytes (anyOf 1)stringNo{"pattern":"^(0|[1-9][0-9]*)$"}
bytes (anyOf 2)nullNo
sha256string | nullYesSHA-256 checksum of the export file
sha256 (anyOf 1)stringNo
sha256 (anyOf 2)nullNo
Complete JSON Schema
{
  "type": "object",
  "required": [
    "id",
    "state",
    "errorCode",
    "snapshotAt",
    "expiresAt",
    "bytes",
    "sha256"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Resource, job or operation identifier"
    },
    "state": {
      "type": "string",
      "enum": [
        "queued",
        "building",
        "ready",
        "failed",
        "expired"
      ],
      "description": "Entry, job or operation state; meaning depends on the endpoint"
    },
    "errorCode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Job error code, or null"
    },
    "snapshotAt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Timestamp at which the export data was captured"
    },
    "expiresAt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Export file expiry; null before generation"
    },
    "bytes": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        {
          "type": "null"
        }
      ],
      "description": "File size in bytes as a decimal string"
    },
    "sha256": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "SHA-256 checksum of the export file"
    }
  }
}

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