API Reference
Runtime Logs

Runtime Logs

Read the newest lines of an environment's Odoo or PostgreSQL logs, live from its server. This is the same output as the Logs tab in the dashboard.

For the log of a deploy, restart or other task, use GET /environments/{env_id}/logs instead.

Base URL: https://api.oec.sh/api/public/v1

Works with read-only and full-access keys.


Get Runtime Logs

GET /environments/{env_id}/runtime-logs

Path Parameters

ParameterTypeDescription
env_idUUIDThe environment ID.

Query Parameters

ParameterTypeDescription
sourcestringodoo (default) or container: the Odoo container's output. postgres: the database container's output.
linesintegerNewest lines to return. Min 1, max 1000. Default: 200.

Response: 200 OK

{
  "environment_id": "5a296461-9222-40da-91f5-9e912890dc1b",
  "source": "odoo",
  "lines": 200,
  "truncated": true,
  "log": "2026-10-05 09:12:01,224 1 INFO prod odoo.modules.loading: loading 112 modules...\n...",
  "fetched_at": "2026-10-05T09:12:03.512Z"
}
FieldTypeDescription
environment_idUUIDThe environment ID.
sourcestringThe source you asked for.
linesintegerNumber of lines in log.
truncatedbooleantrue when older lines exist that were not returned. Ask for more lines to see them (up to 1000).
logstringThe lines, oldest first, separated by \n. At most 1 MB: when the lines are longer than that, only the newest whole lines that fit are returned and truncated is true. Empty when the container has printed nothing yet.
fetched_atstringWhen the logs were read from the server (UTC).

Errors

StatuserrorReason
404not_foundEnvironment not found, or outside your key's organization or project.
409no_serverThe environment has no server assigned yet.
409environment_not_readyThe environment is pending, cloning or deploying, so there is no container to read yet. Follow the task with GET /environments/{env_id}/logs and try again when it has finished.
409container_not_foundDocker on the server reports that the container does not exist. Deploy the environment to create it.
422lines is outside 1 to 1000, or source is not one of the values above.
429target_rate_limitMore than 6 calls in a minute for this environment, or more than 20 runtime-log and metrics calls in a minute from your organization to environments on the same server. Wait the number of seconds in retry_after (also sent as the Retry-After header).
502server_unreachableThe server could not be reached, or Docker on it did not answer. Try again in a minute.
504docker_timeoutDocker on the server did not answer within 20 seconds. The site may still be running; restarting Docker on the server clears this.

Every call reads from your server. On top of your key's rate limit, each environment accepts at most 6 runtime-log calls a minute, whichever keys make them, and your organization can make at most 20 runtime-log and metrics calls a minute to the environments on one server.

Example

# Last 500 lines of Odoo output
curl "https://api.oec.sh/api/public/v1/environments/YOUR_ENV_ID/runtime-logs?lines=500" \
  -H "Authorization: Bearer YOUR_API_KEY"
 
# PostgreSQL output, just the log text
curl -s "https://api.oec.sh/api/public/v1/environments/YOUR_ENV_ID/runtime-logs?source=postgres" \
  -H "Authorization: Bearer YOUR_API_KEY" | jq -r '.log'