Skip to Content
APIApi Logs

Last Updated: 3/9/2026


PocketBase v0.36.6

API Logs

Returns a paginated logs list.

Only superusers can perform this action.

import from 'pocketbase'; const = new PocketBase('http://127.0.0.1:8090');... await. collection("_superusers"). authWithPassword('test@example.com', '1234567890'); const = await.. getList(1, 20,{filter:'data.status >= 400'});

import'package:pocketbase/pocketbase.dart''package:pocketbase/pocketbase.dart'; final = PocketBase('http://127.0.0.1:8090''http://127.0.0.1:8090');... await. collection("_superusers" "_superusers"). authWithPassword('test@example.com''test@example.com', '1234567890' '1234567890'); final = await.. getList(: 1,: 20,:'data.status >= 400''data.status >= 400',);

API details

GET

/api/logs

Requires Authorization:TOKEN

Query parameters

ParamTypeDescription
pageNumberThe page (aka. offset) of the paginated list (default to 1).
perPageNumberThe max returned logs per page (default to 30).
sortStringSpecify the ORDER BY fields. Add - / + (default) in front of the attribute for DESC / ASC order, e.g.: // DESC by the insertion rowid and ASC by level ? = -, Supported log sort fields: @random, rowid, id, created, updated, level, message and any data.* attribute.
filterStringFilter expression to filter/search the returned logs list, e.g.: ? =(. ~'test.com' &&> 0) Supported log filter fields: id, created, updated, level, message and any data.* attribute. The syntax basically follows the format OPERAND OPERATOR OPERAND, where: * OPERAND - could be any field literal, string (single or double quoted), number, null, true, false * OPERATOR - is one of: + = Equal + != NOT equal + > Greater than + >= Greater than or equal + < Less than + <= Less than or equal + ~ Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) + !~ NOT Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) + ?= Any/At least one of Equal + ?!= Any/At least one of NOT equal + ?> Any/At least one of Greater than + ?>= Any/At least one of Greater than or equal + ?< Any/At least one of Less than + ?<= Any/At least one of Less than or equal + ?~ Any/At least one of Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) + ?!~ Any/At least one of NOT Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) To group and combine several expressions you can use parenthesis (...), && (AND) and `
fieldsStringComma separated string of the fields to return in the JSON response (by default returns all fields). Ex.: ? =*,.. * targets all keys from the specific depth level. In addition, the following field modifiers are also supported: * :excerpt(maxLength, withEllipsis?) Returns a short plain text version of the field string value. Ex.: ?fields=*,description:excerpt(200,true)

Responses

{"page": 1, "perPage": 20, "totalItems": 2, "items":[{"id": "ai5z3aoed6809au", "created":"2024-10-27 09:28:19.524Z", "data":{"auth": "_superusers", "execTime":2.392327, "method": "GET", "referer":"http://localhost:8090/_/", "remoteIP":"127.0.0.1", "status": 200, "type": "request", "url":"/api/collections/_pbc_2287844090/records?page=1&perPage=1&filter=&fields=id", "userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36", "userIP":"127.0.0.1"}, "message":"GET /api/collections/_pbc_2287844090/records?page=1&perPage=1&filter=&fields=id", "level": 0},{"id": "26apis4s3sm9yqm", "created":"2024-10-27 09:28:19.524Z", "data":{"auth": "_superusers", "execTime":2.392327, "method": "GET", "referer":"http://localhost:8090/_/", "remoteIP":"127.0.0.1", "status": 200, "type": "request", "url":"/api/collections/_pbc_2287844090/records?page=1&perPage=1&filter=&fields=id", "userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36", "userIP":"127.0.0.1"}, "message":"GET /api/collections/_pbc_2287844090/records?page=1&perPage=1&filter=&fields=id", "level": 0}]}

{"status": 400, "message":"Something went wrong while processing your request. Invalid filter.", "data":{}}

{"status": 401, "message":"The request requires valid record authorization token.", "data":{}}

{"status": 403, "message":"The authorized record is not allowed to perform this action.", "data":{}}

Returns a single log by its ID.

Only superusers can perform this action.

import from 'pocketbase'; const = new PocketBase('http://127.0.0.1:8090');... await. collection("_superusers"). authWithEmail('test@example.com', '123456'); const = await.. getOne('LOG_ID');

import'package:pocketbase/pocketbase.dart''package:pocketbase/pocketbase.dart'; final = PocketBase('http://127.0.0.1:8090''http://127.0.0.1:8090');... await. collection("_superusers" "_superusers"). authWithEmail('test@example.com''test@example.com', '123456' '123456'); final = await.. getOne('LOG_ID' 'LOG_ID');

API details

GET

/api/logs/id

Requires Authorization:TOKEN

Path parameters

ParamTypeDescription
idStringID of the log to view.

Query parameters

ParamTypeDescription
fieldsStringComma separated string of the fields to return in the JSON response (by default returns all fields). Ex.: ? =*,.. * targets all keys from the specific depth level. In addition, the following field modifiers are also supported: * :excerpt(maxLength, withEllipsis?) Returns a short plain text version of the field string value. Ex.: ?fields=*,description:excerpt(200,true)

Responses

{"id": "ai5z3aoed6809au", "created":"2024-10-27 09:28:19.524Z", "data":{"auth": "_superusers", "execTime":2.392327, "method": "GET", "referer":"http://localhost:8090/_/", "remoteIP":"127.0.0.1", "status": 200, "type": "request", "url":"/api/collections/_pbc_2287844090/records?page=1&perPage=1&filter=&fields=id", "userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36", "userIP":"127.0.0.1"}, "message":"GET /api/collections/_pbc_2287844090/records?page=1&perPage=1&filter=&fields=id", "level": 0}

{"status": 401, "message":"The request requires valid record authorization token.", "data":{}}

{"status": 403, "message":"The authorized record is not allowed to perform this action.", "data":{}}

{"status": 404, "message":"The requested resource wasn't found.", "data":{}}

Returns hourly aggregated logs statistics.

Only superusers can perform this action.

import from 'pocketbase'; const = new PocketBase('http://127.0.0.1:8090');... await. collection("_superusers"). authWithPassword('test@example.com', '123456'); const = await.. getStats({filter:'data.status >= 400'});

import'package:pocketbase/pocketbase.dart''package:pocketbase/pocketbase.dart'; final = PocketBase('http://127.0.0.1:8090''http://127.0.0.1:8090');... await. collection("_superusers" "_superusers"). authWithPassword('test@example.com''test@example.com', '123456' '123456'); final = await.. getStats(:'data.status >= 400''data.status >= 400');

API details

GET Requires Authorization:TOKEN

Query parameters

ParamTypeDescription
filterStringFilter expression to filter/search the logs, e.g.: ? =(. ~'test.com' &&> 0) Supported log filter fields: rowid, id, created, updated, level, message and any data.* attribute. The syntax basically follows the format OPERAND OPERATOR OPERAND, where: * OPERAND - could be any field literal, string (single or double quoted), number, null, true, false * OPERATOR - is one of: + = Equal + != NOT equal + > Greater than + >= Greater than or equal + < Less than + <= Less than or equal + ~ Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) + !~ NOT Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) + ?= Any/At least one of Equal + ?!= Any/At least one of NOT equal + ?> Any/At least one of Greater than + ?>= Any/At least one of Greater than or equal + ?< Any/At least one of Less than + ?<= Any/At least one of Less than or equal + ?~ Any/At least one of Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) + ?!~ Any/At least one of NOT Like/Contains (if not specified auto wraps the right string OPERAND in a ”%” for wildcard match) To group and combine several expressions you can use parenthesis (...), && (AND) and `
fieldsStringComma separated string of the fields to return in the JSON response (by default returns all fields). Ex.: ? =*,.. * targets all keys from the specific depth level. In addition, the following field modifiers are also supported: * :excerpt(maxLength, withEllipsis?) Returns a short plain text version of the field string value. Ex.: ?fields=*,description:excerpt(200,true)

Responses

[{"total": 4, "date":"2022-06-01 19:00:00.000"},{"total": 1, "date":"2022-06-02 12:00:00.000"},{"total": 8, "date":"2022-06-02 13:00:00.000"}]

{"status": 400, "message":"Something went wrong while processing your request. Invalid filter.", "data":{}}

{"status": 401, "message":"The request requires valid record authorization token.", "data":{}}

{"status": 403, "message":"The authorized record is not allowed to perform this action.", "data":{}}


Prev: API Settings Next: API Crons