Get backend function logs

Changed on

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Returns recent log lines from one of the app's backend functions, newest first.

A line is anything the function wrote to the console, plus the errors it didn't catch. The lines hold whatever the function logged, so they can include data about the app's users.

By default you get up to 500 lines from the last 7 days. Set since and until to pick a different window, level to keep one severity, and limit for fewer lines. Logs are kept for a limited time, so a window far in the past can come back empty.

To page back, send the time of the oldest line you have, plus one millisecond, as until, and drop the lines you already have. Several lines can share a millisecond, and this keeps you from skipping any.

A function that doesn't exist, or that has never run, returns an empty list rather than an error.

Some older apps whose functions haven't moved to Base44's current function runtime can window and filter their lines differently.

This is limited to 60 requests a minute per app for each workspace's personal API keys, so every key in a workspace shares one allowance. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key, including a read-only one, from anyone with access to the app, viewers included. Workspace API keys are not authorized for it.</Note>

get/api/apps/{app_id}/functions-mgmt/{function_name}/logs

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/functions-mgmt/{function_name}/logs
  • Auth: HTTP bearer

Path parameters

function_namestring required

Name of the backend function, without a file extension. Nested functions have slashes in their name, and you send those as they are.

app_idstring required

ID of the app the function belongs to.

Query parameters

envstring

Whose traffic to show. prod returns lines from the deployment serving the published app, and preview returns lines from the builder's preview. Leave it out for every line from the function's latest deployment. Any other value is ignored.

sincestring

Start of the window, as an ISO 8601 timestamp. A timestamp without an offset is read as UTC. Defaults to 7 days before until.

untilstring

End of the window, as an ISO 8601 timestamp. A timestamp without an offset is read as UTC. Defaults to now.

levelstring

Keep only lines at this severity. Send debug, info, warn, or error, and warning is read as warn.

limitinteger

Maximum number of lines to return, from 1 to 500. Defaults to 500, and a larger value is treated as 500.

Response

The log lines, newest first.

timestring required

When the line was logged, as a UTC timestamp in ISO 8601 format.

levelstring required

Severity of the line, such as info, warn, or error.

messagestring required

What the function wrote. An uncaught error carries its name, message and stack trace. Each invocation also gets a line of its own with the request method and response status, like POST → 200.

Example response

[
  {
    "time": "2026-01-15T09:23:41.482000+00:00",
    "level": "info",
    "message": "Sent welcome email to jane@acme.com"
  }
]

Changes

    • breaking

      query request parameter env list-of-types was narrowed by removing types null

    • breaking

      query request parameter level list-of-types was narrowed by removing types null

    • breaking

      query request parameter limit list-of-types was narrowed by removing types null

    • breaking

      query request parameter since list-of-types was narrowed by removing types null

    • breaking

      query request parameter until list-of-types was narrowed by removing types null

    • breaking

      for the query request parameter limit, the type changed from no type to integer

    • info

      for the query request parameter env, the type was generalized from no type to string

    • info

      for the query request parameter level, the type was generalized from no type to string

    • info

      for the query request parameter since, the type was generalized from no type to string

    • info

      for the query request parameter until, the type was generalized from no type to string

    • info

      the endpoint scheme security PersonalAccessTokenAuth was added to the API