Get a list of audit logs
curl --request GET \
--url https://{tenant_id}.hanko.io/admin/audit_logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant_id}.hanko.io/admin/audit_logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant_id}.hanko.io/admin/audit_logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant_id}.hanko.io/admin/audit_logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant_id}.hanko.io/admin/audit_logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant_id}.hanko.io/admin/audit_logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_id}.hanko.io/admin/audit_logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"type": "user_logged_out",
"meta_http_request_id": "0a2xsrhlhiQv49FIpq8KV8uQVq6ky9Bw",
"meta_source_ip": "172.27.0.1",
"meta_user_agent": "<string>",
"created_at": "2022-09-14T12:15:09.788784Z",
"updated_at": "2022-09-14T12:15:09.788784Z",
"error": "<string>",
"actor_user_id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"actor_email": "jsmith@example.com",
"details": {}
}
]{
"code": 500,
"message": "Internal Server Error"
}Audit Logs
Get a list of audit logs
GET
/
audit_logs
Get a list of audit logs
curl --request GET \
--url https://{tenant_id}.hanko.io/admin/audit_logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant_id}.hanko.io/admin/audit_logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant_id}.hanko.io/admin/audit_logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant_id}.hanko.io/admin/audit_logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant_id}.hanko.io/admin/audit_logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant_id}.hanko.io/admin/audit_logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_id}.hanko.io/admin/audit_logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"type": "user_logged_out",
"meta_http_request_id": "0a2xsrhlhiQv49FIpq8KV8uQVq6ky9Bw",
"meta_source_ip": "172.27.0.1",
"meta_user_agent": "<string>",
"created_at": "2022-09-14T12:15:09.788784Z",
"updated_at": "2022-09-14T12:15:09.788784Z",
"error": "<string>",
"actor_user_id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"actor_email": "jsmith@example.com",
"details": {}
}
]{
"code": 500,
"message": "Internal Server Error"
}Authorizations
Query Parameters
Only audit logs with the specified type are included
The type of the audit log
Available options:
user_logged_out, password_set_succeeded, password_set_failed, password_login_succeeded, password_login_failed, passcode_login_init_succeeded, passcode_login_init_failed, passcode_login_final_succeeded, passcode_login_final_failed, webauthn_registration_init_succeeded, webauthn_registration_init_failed, webauthn_registration_final_succeeded, webauthn_registration_final_failed, webauthn_authentication_init_succeeded, webauthn_authentication_init_failed, webauthn_authentication_final_succeeded, webauthn_authentication_final_failed, webauthn_credential_updated, webauthn_credential_deleted, thirdparty_signup_succeeded, thirdparty_signin_succeeded, thirdparty_linking_succeeded, thirdparty_signin_signup_failed, token_exchange_succeeded, token_exchange_failed, user_created, email_created, email_verified, email_deleted, primary_email_changed, user_deleted, login_success, login_failure, otp_created, passkey_created, passkey_deleted, security_key_created, username_changed, username_deleted, password_changed, password_deleted Example:
"user_created"
Response
Details about audit logs
The type of the audit log
Available options:
user_logged_out, password_set_succeeded, password_set_failed, password_login_succeeded, password_login_failed, passcode_login_init_succeeded, passcode_login_init_failed, passcode_login_final_succeeded, passcode_login_final_failed, webauthn_registration_init_succeeded, webauthn_registration_init_failed, webauthn_registration_final_succeeded, webauthn_registration_final_failed, webauthn_authentication_init_succeeded, webauthn_authentication_init_failed, webauthn_authentication_final_succeeded, webauthn_authentication_final_failed, webauthn_credential_updated, webauthn_credential_deleted, thirdparty_signup_succeeded, thirdparty_signin_succeeded, thirdparty_linking_succeeded, thirdparty_signin_signup_failed, token_exchange_succeeded, token_exchange_failed, user_created, email_created, email_verified, email_deleted, primary_email_changed, user_deleted, login_success, login_failure, otp_created, passkey_created, passkey_deleted, security_key_created, username_changed, username_deleted, password_changed, password_deleted