Skip to content
Skip to Content
Coder Docs

Get audit logs

GET
/api/v2/audit

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Query Parameters

q?string

Search query

limit*integer

Page limit

offset?integer

Page offset

Response Body

OK

application/json
  1. response
audit_logs?array<>
count?integer
count_cap?integer

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X GET \	"$CODER_URL/api/v2/audit?limit={limit}" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "audit_logs": [    {      "action": "create",      "additional_fields": {},      "description": "string",      "diff": {        "property1": {          "new": null,          "old": null,          "secret": true        },        "property2": {          "new": null,          "old": null,          "secret": true        }      },      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "ip": "string",      "is_deleted": true,      "organization": {        "display_name": "string",        "icon": "string",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "name": "string"      },      "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",      "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",      "resource_icon": "string",      "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",      "resource_link": "string",      "resource_target": "string",      "resource_type": "template",      "status_code": 0,      "time": "2019-08-24T14:15:22Z",      "user": {        "avatar_url": "http://example.com",        "created_at": "2019-08-24T14:15:22Z",        "email": "[email protected]",        "has_ai_seat": true,        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "is_service_account": true,        "last_seen_at": "2019-08-24T14:15:22Z",        "login_type": "",        "name": "string",        "organization_ids": [          "7d4232d7-54a0-4c93-9c1e-a8fd2dfcdabe"        ],        "roles": [          {            "display_name": "string",            "name": "string",            "organization_id": "string"          }        ],        "status": "active",        "theme_preference": "string",        "updated_at": "2019-08-24T14:15:22Z",        "username": "string"      },      "user_agent": "string"    }  ],  "count": 0,  "count_cap": 0}