> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get application logs

> Get a point-in-time snapshot of an application's recent stdout and stderr with GET /v2/apps/{app_id}/logs. For live logs, use the realtime SSE stream.

<Warning>
  This endpoint is strictly rate limited. Exceeding **any** of the limits returns `429 Too Many Requests`:

  * **1 request every 5 seconds** per user, per application.
  * **20 requests every 10 seconds** per user across all applications, followed by a **short cooldown**.

  When you receive a `429`, stop polling that application and wait for the cooldown to end before retrying.
</Warning>

<Tip>
  Use this endpoint only for a **point-in-time snapshot** of logs (opening the logs tab or a manual refresh). For **live, continuous logs**, use the [Real-time Logs](/en/api-reference/endpoint/apps/realtime) (SSE) endpoint, which streams logs in real time without hitting this rate limit.
</Tip>

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Requires an API key with the `apps:read` [scope](/en/api-reference/authentication#scopes).

This endpoint fetches the application's most recent stdout/stderr buffer directly from the cluster: it is a short-lived snapshot, not a stream. stdout and stderr are returned concatenated in the order they were written, with no per-line distinction between the two, unlike the [Real-time Logs](/en/api-reference/endpoint/apps/realtime) event which prefixes each line with its stream id.

Use it when you need a one-off look at recent output, for example rendering the logs tab on page load or after a manual refresh button. It returns `404` when the application is offline, has never been deployed, or the cluster returns a transient error. Workspace members with access to the application can call it the same way the owner does.

## Parameters

<ParamField path="app_id" type="string" placeholder="Application ID" required>
  The ID of the application. You can find this in the URL of your application's dashboard.
</ParamField>

## Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful: `success` if it was, `error` if not.
</ResponseField>

<ResponseField name="response" type="object">
  The contents of the response.

  <Expandable title="Toggle object">
    <ResponseField name="logs" type="string">
      The latest logs from the application.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={"system"}
  {
      "status": "success",
      "response": {
          "logs": "Working!"
      }
  }
  ```
</ResponseExample>

## Common errors

| Code | HTTP | Meaning |
| - | - | - |
| `LOGS_UNAVAILABLE` | 404 | The logs could not be returned: the application is offline, has never been deployed, or a transient error occurred. Retry shortly. |

## Related

* CLI: [`squarecloud app logs`](/en/cli-reference/logs#squarecloud-app-logs)
* SDKs: [`api.apps.logs()`](/en/sdks/js/managing_application) (JavaScript), [`client.apps.logs()`](/en/sdks/py/managing_application) (Python), [`c.Apps.Logs()`](/en/sdks/go/managing_application) (Go)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.