Getting started
Back to home
Getting started

Read runtime logs

Read a bounded runtime log snapshot. Use since or the returned cursor to request newer entries; each snapshot is limited to the latest 500 lines.

GET/api/customer/v1/projects/{projectId}/logs

Path parameters

NameValue
projectIdRequired resource ID from an earlier API response.

Query parameters

NameTypeRequiredLimits
tailintegerNoMinimum 1; Maximum 500
sincestringNoSee schema
cursorstringNoSee schema

Example request

Set HCODE_BASE_URL and HCODE_API_KEY as shown in Getting started. Replace resource variables with your own IDs.

curl --request GET "$HCODE_BASE_URL/api/customer/v1/projects/${PROJECT_ID}/logs" \
  --header "Authorization: Bearer $HCODE_API_KEY"

Response

The JSON shape is defined in the response schema.

Response schema
{
  "type": "object",
  "properties": {
    "logs": {
      "type": "string"
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "timestamp",
          "message"
        ],
        "additionalProperties": true
      }
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "logs",
    "lines",
    "nextCursor"
  ],
  "additionalProperties": true
}

See errors and retries for failure responses.