Skip to main content

Hanko Admin API (0.3.0)

Introduction

This is the OpenAPI specification for the Hanko Admin API.

Authentication

The Admin API must be protected by an access management system.


User Management

Get a list of users

Responses

Response Headers
X-Total-Count
any
Example: 1234

The total count of the requested resource considering query parameter

Link
any
Example: "<http://localhost:8001/resource?page=1&per_page=10>; rel=\"first\",<http://localhost:8001/resource?page=16&per_page=10>; rel=\"last\",<http://localhost:8001/resource?page=6&per_page=10>; rel=\"next\",<http://localhost:8001/resource?page=4&per_page=10>; rel=\"prev\""

Web Linking as described in RFC5988

Response Schema: application/json
Array
id
string <uuid4>

The ID of the user

email
string <email>

The email address of the user

created_at
string <date-time>

Time of creation of the the user

updated_at
string <date-time>

Time of last update of the user

verified
boolean

Indicates whether the user's email address was verified

Array of objects

List of registered Webauthn credentials

Response samples

Content type
application/json
[
  • {
    • "id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
    • "email": "user@example.com",
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z",
    • "verified": true,
    • "webauthn_credentials": [
      ]
    }
]

Update a user by ID

path Parameters
id
required
string <uuid4> (UUID4)
Example: c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c

ID of the user

Request Body schema: application/json
email
string <email>
status
string
Enum: "active" "inactive"

Responses

Response Schema: application/json
id
string <uuid4>

The ID of the user

email
string <email>

The email address of the user

created_at
string <date-time>

Time of creation of the the user

updated_at
string <date-time>

Time of last update of the user

verified
boolean

Indicates whether the user's email address was verified

Array of objects

List of registered Webauthn credentials

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "status": "active"
}

Response samples

Content type
application/json
{
  • "id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
  • "email": "user@example.com",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "verified": true,
  • "webauthn_credentials": [
    • {
      }
    ]
}

Delete a user by ID

path Parameters
id
required
string <uuid4> (UUID4)
Example: c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c

ID of the user

Responses

Response samples

Content type
application/json
{
  • "code": 404,
  • "message": "Not found"
}

Audit Logs

Get a list of audit logs

query Parameters
page
integer
Default: 1

The page which should be returned

per_page
integer
Default: 20

The number of returned items

start_time
string
Example: start_time=2022-09-12T12:48:48Z

Date and time from which the logs are included

end_time
string
Example: end_time=2022-09-15T12:48:48Z

Date and time to which the logs are included

Responses

Response Headers
X-Total-Count
any
Example: 1234

The total count of the requested resource considering query parameter

Link
any
Example: "<http://localhost:8001/resource?page=1&per_page=10>; rel=\"first\",<http://localhost:8001/resource?page=16&per_page=10>; rel=\"last\",<http://localhost:8001/resource?page=6&per_page=10>; rel=\"next\",<http://localhost:8001/resource?page=4&per_page=10>; rel=\"prev\""

Web Linking as described in RFC5988

Response Schema: application/json
Array
id
required
string <uuid4>

The ID of the audit log

type
required
string
Enum: "user_created" "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"

The type of the audit log

meta_http_request_id
required
string

The ID of the corresponding http request

meta_source_ip
required
string <ip-address>

The IP from where the http request came from

meta_user_agent
required
string

The user agent from where the http request came from

created_at
required
string <date-time>

Time of creation of the the audit log

updated_at
required
string <date-time>

Time of last update of the audit log

error
string

A more detailed message why something failed

actor_user_id
string <uuid4>

The userID from the actor

actor_email
string <email>

The email from the actor

Response samples

Content type
application/json
[
  • {
    • "id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
    • "type": "user_created",
    • "error": "string",
    • "meta_http_request_id": "0a2xsrhlhiQv49FIpq8KV8uQVq6ky9Bw",
    • "meta_source_ip": "172.27.0.1",
    • "meta_user_agent": "string",
    • "actor_user_id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
    • "actor_email": "user@example.com",
    • "created_at": "2022-09-14T12:15:09.788784Z",
    • "updated_at": "2022-09-14T12:15:09.788784Z"
    }
]