Logfire

App · 20 actions

Query your Logfire logs, spans and metrics with SQL, search recent records, send log lines, and manage projects, read and write tokens, alerts and dashboards.

Actions

ActionWhat it does
Create alertCreate an alert that runs a SQL query on a schedule and flags it in Logfire when it finds rows.
Create read tokenCreate a read token for a project, optionally with an expiry.
Create write tokenCreate a write token for a project, optionally with an expiry.
Delete alertDelete an alert and its history.
Get alertGet one alert with its query, schedule and last check.
Get dashboardGet one dashboard with its full definition (panels, queries and layout).
Get projectGet one project's name, description, organization and visibility.
Get read token projectCheck which organization and project the connection's read token belongs to.
List alertsList a project's alerts with their query, schedule and how the last check went.
List dashboardsList a project's dashboards.
List projectsList the projects the API key can see, with their organization and visibility.
List read tokensList a project's read tokens, with when each expires and whether it is active.
List variablesList a project's managed variables with their rollouts and labels.
List write tokensList a project's write tokens, with when each expires and whether it is active.
Revoke read tokenRevoke a read token so it stops working at once.
Revoke write tokenRevoke a write token so services using it stop sending data at once.
Run SQL queryRun a SQL query over the project's logs, spans and metrics and get the rows back.
Search logs and spansFind recent logs and spans by message text, service, level, exceptions or trace, newest first.
Send logSend one log line to the project, so it shows in Logfire's live view.
Update alertChange an alert's name, query, schedule or on/off state.

Create alert

Create an alert that runs a SQL query on a schedule and flags it in Logfire when it finds rows.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
NamenametextRequired
The alert's name.
SQL queryquerytextRequired
The alert fires when this query finds rows, such as SELECT * FROM records WHERE is_exception.
Descriptiondescriptiontext
What the alert is for.
Start switched onactivetrue/false
Turn off to create the alert switched off. Defaults to on.Default: true.
Look at rows fromtime_windowtext
How far back each check looks. Defaults to the last hour.One of: PT5M (Last 5 minutes), PT15M (Last 15 minutes), PT30M (Last 30 minutes), PT1H (Last hour (default)), PT3H (Last 3 hours), PT6H (Last 6 hours), PT12H (Last 12 hours), PT24H (Last 24 hours). Default: PT1H.
Checkfrequencytext
How often the alert runs. Defaults to every hour; shorter gaps depend on your Logfire plan.One of: PT1M (Every minute), PT5M (Every 5 minutes (not on every plan)), PT15M (Every 15 minutes), PT30M (Every 30 minutes), PT1H (Every hour (default)), PT6H (Every 6 hours), PT24H (Every day). Default: PT1H.
Wait for late datawatermarktext
How long to wait for data that arrives late. Defaults to 1 minute.One of: PT0S (None), PT1M (1 minute (default)), PT5M (5 minutes). Default: PT1M.
Notify whennotify_whentext
When the alert notifies. Defaults to every check that finds rows.One of: has_matches (Every check that finds rows (default)), has_matches_changed (Rows are found, and again when they change), matches_changed (The rows found change), starts_having_matches (Rows are first found). Default: has_matches.
Environmentsenvironmentslist
Only look at data from these deployment environments, such as production. Leave empty for all of them.

Outputs

alertobject
The alert
Example output
{
  "alert": {
    "active": true,
    "channels": [],
    "created_at": "2026-10-01T09:00:00Z",
    "created_by_name": "Jo Bloggs",
    "description": "",
    "environments": [],
    "fired": null,
    "frequency": "PT1H",
    "has_errors": null,
    "has_matches": null,
    "id": "5d961928-38f6-41d3-a29e-26ac6f5158e0",
    "last_run": null,
    "name": "Errors in checkout",
    "notify_when": "has_matches",
    "organization_id": "2c1d0e3f-0000-4000-8000-000000000001",
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "query": "SELECT trace_id FROM records WHERE is_exception",
    "result_length": null,
    "time_window": "PT1H",
    "updated_at": "2026-10-01T09:00:00Z",
    "watermark": "PT1M"
  }
}

Create read token

Create a read token for a project, optionally with an expiry. The result holds the token itself, which Logfire shows only once.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Expiresexpires_atdate and time
When the token stops working. Leave empty for a token that never expires.

Outputs

tokenobject
The new token
Example output
{
  "token": {
    "created_at": "2026-10-01T09:00:00Z",
    "description": null,
    "expires_at": null,
    "id": "835a8e09-417c-4688-9c5a-9f5dc40cf744",
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "token": "pylf_v1_us_example"
  }
}

Create write token

Create a write token for a project, optionally with an expiry. The result holds the token itself, which Logfire shows only once.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Expiresexpires_atdate and time
When the token stops working. Leave empty for a token that never expires.

Outputs

tokenobject
The new token
Example output
{
  "token": {
    "created_at": "2026-10-01T09:00:00Z",
    "description": null,
    "expires_at": null,
    "id": "835a8e09-417c-4688-9c5a-9f5dc40cf744",
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "token": "pylf_v1_us_example"
  }
}

Delete alert

Delete an alert and its history. This cannot be undone.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Alertalert_idtextRequired
The alert. Pick one, or give its id from an earlier step.

Outputs

alert_idtext
The alert deleted
deletedtrue/false
Always true once deleted
Example output
{
  "alert_id": "5d961928-38f6-41d3-a29e-26ac6f5158e0",
  "deleted": true
}

Get alert

Get one alert with its query, schedule and last check.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Alertalert_idtextRequired
The alert. Pick one, or give its id from an earlier step.

Outputs

alertobject
The alert
Example output
{
  "alert": {
    "active": true,
    "channels": [],
    "created_at": "2026-10-01T09:00:00Z",
    "created_by_name": "Jo Bloggs",
    "description": "",
    "environments": [],
    "fired": null,
    "frequency": "PT1H",
    "has_errors": null,
    "has_matches": null,
    "id": "5d961928-38f6-41d3-a29e-26ac6f5158e0",
    "last_run": null,
    "name": "Errors in checkout",
    "notify_when": "has_matches",
    "organization_id": "2c1d0e3f-0000-4000-8000-000000000001",
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "query": "SELECT trace_id FROM records WHERE is_exception",
    "result_length": null,
    "time_window": "PT1H",
    "updated_at": "2026-10-01T09:00:00Z",
    "watermark": "PT1M"
  }
}

Get dashboard

Get one dashboard with its full definition (panels, queries and layout).

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Dashboarddashboard_idtextRequired
The dashboard. Pick one, or give its id from an earlier step.

Outputs

dashboardobject
The dashboard
Example output
{
  "dashboard": {
    "created_at": "2026-09-01T09:00:00Z",
    "created_by_name": "Jo Bloggs",
    "dashboard_name": "Web service",
    "dashboard_slug": "web-service",
    "definition": {},
    "id": "7e1f0c52-3b8a-4a57-8f7d-5a9b1c2d3e4f",
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "updated_at": "2026-09-02T09:00:00Z",
    "version": 3
  }
}

Get project

Get one project's name, description, organization and visibility.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.

Outputs

projectobject
The project
Example output
{
  "project": {
    "created_at": "2026-05-24T11:18:22.704455Z",
    "description": null,
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "organization_name": "my-organization",
    "project_name": "my-project",
    "updated_at": "2026-05-24T11:18:22.704455Z",
    "visibility": "private"
  }
}

Get read token project

Check which organization and project the connection's read token belongs to.

Inputs

None.

Outputs

organization_nametext
The organization
project_nametext
The project
Example output
{
  "organization_name": "my-organization",
  "project_name": "my-project"
}

List alerts

List a project's alerts with their query, schedule and how the last check went.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.

Outputs

alertslist
The alerts
countnumber
How many were returned
Example output
{
  "alerts": [
    {
      "active": true,
      "channels": [],
      "created_at": "2026-10-01T09:00:00Z",
      "created_by_name": "Jo Bloggs",
      "description": "",
      "environments": [],
      "fired": null,
      "frequency": "PT1H",
      "has_errors": null,
      "has_matches": null,
      "id": "5d961928-38f6-41d3-a29e-26ac6f5158e0",
      "last_run": null,
      "name": "Errors in checkout",
      "notify_when": "has_matches",
      "organization_id": "2c1d0e3f-0000-4000-8000-000000000001",
      "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "query": "SELECT trace_id FROM records WHERE is_exception",
      "result_length": null,
      "time_window": "PT1H",
      "updated_at": "2026-10-01T09:00:00Z",
      "watermark": "PT1M"
    }
  ],
  "count": 1
}

List dashboards

List a project's dashboards.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.

Outputs

countnumber
How many were returned
dashboardslist
The dashboards
Example output
{
  "count": 1,
  "dashboards": [
    {
      "created_at": "2026-09-01T09:00:00Z",
      "created_by_name": "Jo Bloggs",
      "dashboard_name": "Web service",
      "dashboard_slug": "web-service",
      "id": "7e1f0c52-3b8a-4a57-8f7d-5a9b1c2d3e4f",
      "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "updated_at": "2026-09-02T09:00:00Z",
      "version": 3
    }
  ]
}

List projects

List the projects the API key can see, with their organization and visibility.

Inputs

None.

Outputs

countnumber
How many were returned
projectslist
The projects
Example output
{
  "count": 1,
  "projects": [
    {
      "created_at": "2026-05-24T11:18:22.704455Z",
      "description": null,
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "organization_name": "my-organization",
      "project_name": "my-project",
      "updated_at": "2026-05-24T11:18:22.704455Z",
      "visibility": "private"
    }
  ]
}

List read tokens

List a project's read tokens, with when each expires and whether it is active.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.

Outputs

countnumber
How many were returned
tokenslist
The read tokens
Example output
{
  "count": 1,
  "tokens": [
    {
      "active": true,
      "created_at": "2026-10-01T09:00:00Z",
      "created_by_name": "Jo Bloggs",
      "description": null,
      "expires_at": null,
      "id": "835a8e09-417c-4688-9c5a-9f5dc40cf744",
      "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "project_name": "my-project",
      "token_prefix": "pylf_v1_us"
    }
  ]
}

List variables

List a project's managed variables with their rollouts and labels.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.

Outputs

countnumber
How many were returned
variableslist
The variables
Example output
{
  "count": 1,
  "variables": [
    {
      "created_at": "2026-09-01T09:00:00Z",
      "description": "Greeting shown to new users",
      "id": "9c2d1e0f-4b3a-4c5d-8e7f-6a5b4c3d2e1f",
      "json_schema": {
        "type": "string"
      },
      "kind": "general",
      "labels": {},
      "name": "welcome_message",
      "overrides": [],
      "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "rollout": {
        "labels": {}
      },
      "updated_at": "2026-09-01T09:00:00Z"
    }
  ]
}

List write tokens

List a project's write tokens, with when each expires and whether it is active.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.

Outputs

countnumber
How many were returned
tokenslist
The write tokens
Example output
{
  "count": 1,
  "tokens": [
    {
      "active": true,
      "created_at": "2026-10-01T09:00:00Z",
      "created_by_name": "Jo Bloggs",
      "description": null,
      "expires_at": null,
      "id": "835a8e09-417c-4688-9c5a-9f5dc40cf744",
      "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "project_name": "my-project",
      "token_prefix": "pylf_v1_us"
    }
  ]
}

Revoke read token

Revoke a read token so it stops working at once. This cannot be undone.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Read tokentoken_idtextRequired
The read token to revoke. Pick one, or give its id from an earlier step.

Outputs

revokedtrue/false
Always true once revoked
token_idtext
The token revoked
Example output
{
  "revoked": true,
  "token_id": "835a8e09-417c-4688-9c5a-9f5dc40cf744"
}

Revoke write token

Revoke a write token so services using it stop sending data at once. This cannot be undone.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Write tokentoken_idtextRequired
The write token to revoke. Pick one, or give its id from an earlier step.

Outputs

revokedtrue/false
Always true once revoked
token_idtext
The token revoked
Example output
{
  "revoked": true,
  "token_id": "835a8e09-417c-4688-9c5a-9f5dc40cf744"
}

Run SQL query

Run a SQL query over the project's logs, spans and metrics and get the rows back. Needs a read token. Looks at the last 24 hours unless you give a time range.

Inputs

SQL querysqltextRequired
A SQL query over the project's data, such as SELECT message FROM records WHERE is_exception. Logs and spans are in 'records'; metrics are in 'metrics'.
Frommin_timestampdate and time
Start of the time range to look at. Defaults to 24 hours ago.
Untilmax_timestampdate and time
End of the time range. Leave empty for up to now.
Row limitlimitnumber
The most rows to return, 1 to 10,000. Defaults to 100.From 1 to 10000.
Environmentsenvironmentslist
Only look at data from these deployment environments, such as production. Leave empty for all of them.
Time zonetime_zonetext
The time zone the query runs in, such as Europe/Paris. Defaults to UTC.

Outputs

columnslist
The columns
max_timestamptext
End of the range, empty for up to now
min_timestamptext
Start of the range
row_countnumber
How many were returned
rowslist
The rows, one object each
Example output
{
  "columns": [
    {
      "data_type": "Utf8",
      "name": "message",
      "nullable": false
    }
  ],
  "max_timestamp": "",
  "min_timestamp": "2026-10-19T14:00:00Z",
  "row_count": 1,
  "rows": [
    {
      "message": "Card declined"
    }
  ]
}

Search logs and spans

Find recent logs and spans by message text, service, level, exceptions or trace, newest first. Needs a read token.

Inputs

Message containsmessage_containstext
Only records whose message contains this text, in any capitals.
Serviceservice_nametext
Only records from this service, exactly as Logfire shows it.
Levelmin_leveltext
Only records at or above this level. Defaults to any level.One of: any (Any level (default)), debug (Debug and above), info (Info and above), warn (Warning and above), error (Error and above), fatal (Fatal only). Default: any.
Only exceptionsexceptions_onlytrue/false
Turn on to see only records that recorded an exception.
Trace IDtrace_idtext
Only records in this trace, as 32 hexadecimal characters.
Frommin_timestampdate and time
Start of the time range to look at. Defaults to 24 hours ago.
Untilmax_timestampdate and time
End of the time range. Leave empty for up to now.
Row limitlimitnumber
The most records to return, 1 to 1,000, newest first. Defaults to 100.From 1 to 1000.
Environmentsenvironmentslist
Only look at data from these deployment environments, such as production. Leave empty for all of them.

Outputs

countnumber
How many were returned
max_timestamptext
End of the range, empty for up to now
min_timestamptext
Start of the range
recordslist
The matching records
sqltext
The query that was run
Example output
{
  "count": 1,
  "max_timestamp": "",
  "min_timestamp": "2026-10-19T14:00:00Z",
  "records": [
    {
      "attributes": {
        "order_id": 42
      },
      "exception_message": "insufficient funds",
      "exception_type": "CardDeclined",
      "is_exception": true,
      "level": 17,
      "message": "Card declined",
      "service_name": "checkout",
      "span_id": "b7ad6b7169203331",
      "span_name": "charge card",
      "start_timestamp": "2026-10-20T14:00:00.123456Z",
      "trace_id": "0af7651916cd43dd8448eb211c80319c"
    }
  ],
  "sql": "SELECT start_timestamp FROM records ORDER BY start_timestamp DESC LIMIT 100"
}

Send log

Send one log line to the project, so it shows in Logfire's live view. Needs a write token.

Inputs

MessagemessagetextRequired
The text of the log line.
Serviceservice_nametextRequired
The service the log line is shown under in Logfire.
Levelleveltext
How serious the log line is. Defaults to info.One of: debug, info (Info (default)), warn (Warning), error, fatal. Default: info.
Timetimestampdate and time
When it happened. Defaults to now.
Attributesattributesobject
Extra keys and values to store with the log line.
Environmentenvironmenttext
The deployment environment, such as production.

Outputs

leveltext
The level sent
messagetext
The message sent
senttrue/false
Always true once accepted
service_nametext
The service
timestamptext
When it happened
Example output
{
  "level": "info",
  "message": "Nightly import finished",
  "sent": true,
  "service_name": "lodol-workflows",
  "timestamp": "2026-10-20T14:00:00Z"
}

Update alert

Change an alert's name, query, schedule or on/off state. Fields left empty stay as they are.

Inputs

Projectproject_idtextRequired
The Logfire project. Pick one, or give its id from an earlier step.
Alertalert_idtextRequired
The alert. Pick one, or give its id from an earlier step.
Namenametext
A new name. Leave empty to keep it.
SQL queryquerytext
A new query. Leave empty to keep it.
Descriptiondescriptiontext
A new description. Leave empty to keep it.
Switched onactivetrue/false
Turn on or off. Leave unchanged to keep it as it is.
Look at rows fromtime_windowtext
How far back each check looks. Defaults to the last hour.One of: PT5M (Last 5 minutes), PT15M (Last 15 minutes), PT30M (Last 30 minutes), PT1H (Last hour (default)), PT3H (Last 3 hours), PT6H (Last 6 hours), PT12H (Last 12 hours), PT24H (Last 24 hours). Default: PT1H.
Checkfrequencytext
How often the alert runs. Defaults to every hour; shorter gaps depend on your Logfire plan.One of: PT1M (Every minute), PT5M (Every 5 minutes (not on every plan)), PT15M (Every 15 minutes), PT30M (Every 30 minutes), PT1H (Every hour (default)), PT6H (Every 6 hours), PT24H (Every day). Default: PT1H.
Wait for late datawatermarktext
How long to wait for data that arrives late. Defaults to 1 minute.One of: PT0S (None), PT1M (1 minute (default)), PT5M (5 minutes). Default: PT1M.
Notify whennotify_whentext
When the alert notifies. Defaults to every check that finds rows.One of: has_matches (Every check that finds rows (default)), has_matches_changed (Rows are found, and again when they change), matches_changed (The rows found change), starts_having_matches (Rows are first found). Default: has_matches.
Environmentsenvironmentslist
Only look at data from these deployment environments, such as production. Leave empty for all of them.

Outputs

alertobject
The alert
Example output
{
  "alert": {
    "active": true,
    "channels": [],
    "created_at": "2026-10-01T09:00:00Z",
    "created_by_name": "Jo Bloggs",
    "description": "",
    "environments": [],
    "fired": null,
    "frequency": "PT1H",
    "has_errors": null,
    "has_matches": null,
    "id": "5d961928-38f6-41d3-a29e-26ac6f5158e0",
    "last_run": null,
    "name": "Errors in checkout (updated)",
    "notify_when": "has_matches",
    "organization_id": "2c1d0e3f-0000-4000-8000-000000000001",
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "query": "SELECT trace_id FROM records WHERE is_exception",
    "result_length": null,
    "time_window": "PT1H",
    "updated_at": "2026-10-01T09:00:00Z",
    "watermark": "PT1M"
  }
}

On this page