# Fetch an application's runtime or build logs.

This function fetches an application's runtime or build logs. It
returns the most recent lines from the log the container persists on
disk. It returns a static tail; live streaming of new lines is not yet
available.

Endpoint: GET /WebApp/fetch_logs
Version: 11.138.0.10
Security: BasicAuth

## Query parameters:

  - `log_type` (string, required)
    The type of log to fetch.

* app — The application's runtime output (stdout and stderr).
* build — The output of the build step.
    Enum: "app", "build"

  - `name` (string, required)
    The application's unique name (slug).
    Example: "my-app"

  - `deploy_id` (string)
    Limit the output to a specific deploy's logs. Only meaningful when
log_type is build.

This parameter defaults to the most recent deploy.
    Example: "dp-20260612-0001"

  - `lines` (integer)
    The maximum number of log lines to return, counted from the end
of the log.
    Example: 100

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "fetch_logs"

  - `module` (string)
    The name of the module called.
    Example: "WebApp"

  - `result` (object)

  - `result.data` (object)

  - `result.data.lines` (array)
    The requested log lines, oldest first.
    Example: ["Server listening on port 3000","GET / 200 12ms"]

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    - 1 - Success.
- 0 - Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


