Server logs (superusers)

List actions performed by users.

⚠️ Only available to superusers

Results from this endpoint can be filtered by a Boolean query specified in the q parameter.

Filterable fields:

  • app_label
  • model_name
  • action Available actions:
    • create
    • delete
    • in-trash
    • put-back
    • remove
    • update
    • auth
  • log_type Available log types:
    • access
    • project-history
    • data-editing
    • submission-management
    • user-management
    • asset-management
  • date_created
  • user_uid
  • user__username
  • user__email
  • user__is_superuser
  • metadata__asset_uid
  • metadata__auth_type

Notes: Some logs may have additional filterable fields in the metadata

Some examples:

  • All deleted submissions api/v2/audit-logs/?q=action:delete
  • All deleted submissions of a specific project aTJ3vi2KRGYj2NytSzBPp7 api/v2/audit-logs/?q=action:delete AND metadata__asset_uid:aTJ3vi2KRGYj2NytSzBPp7
  • All submissions deleted by a specific user my_username api/v2/audit-logs/?q=action:delete AND user__username:my_username
  • All deleted submissions submitted after a specific date /api/v2/audit-logs/?q=action:delete AND date_created__gte:2022-11-15
  • All deleted submissions submitted after a specific date and time /api/v2/audit-logs/?q=action:delete AND date_created__gte:"2022-11-15 20:34"
  • All authentications from superusers api/v2/audit-logs/?q=action:auth AND user__is_superuser:True

Notes: Do not forget to wrap search terms in double-quotes if they contain spaces (e.g. date and time "2022-11-15 20:34")

get/api/v2/audit-logs/

Request

  • The document declares no server URL.
  • Auth: one of:
    • HTTP basic
    • API key in header Authorization

Query parameters

limitinteger

Number of results to return per page. Use with start.

offsetinteger

Deprecated alias of start.

qstring
startinteger

The initial index from which to return the results. Use with limit.

Response

nextstring uri nullable
previousstring uri nullable

Example response

{
  "next": "https://kf.kobotoolbox.org/api-endpoint/?start=400&limit=100",
  "previous": "https://kf.kobotoolbox.org/api-endpoint/?start=200&limit=100",
  "results": [
    {
      "user": "https://kf.kobotoolbox.org/api/v2/users/bob/"
    }
  ]
}

Changes

    • info

      added the optional property /// to the response with the status