API Documentation
Public
- Introduction
- Flow
- Status
- Passcode
- Password
- WebAuthn
- .well-known
- Third Party
- Token
- User Management
- Email Management
- SAML
- Session Management
Admin
- Introduction
- Status
- User Management
- User Metadata Management
- Email Management
- Password Management
- WebAuthn credential Management
- OTP Management
- Session Management
- Webhooks
- Audit Logs
- Metrics
User Management
Create a new user
POST
/
users
curl --request POST \
--url https://{tenant_id}.hanko.io/admin/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"emails": [
{
"address": "<string>",
"is_primary": true,
"is_verified": true
}
],
"username": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}'
{
"id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"webauthn_credentials": [
{
"id": "f9bebc04-b894-4018-bdb8-8b520a532fef",
"name": "<string>",
"public_key": "<string>",
"attestation_type": "<string>",
"aaguid": "<string>",
"transports": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"backup_eligible": true,
"backup_state": true,
"mfa_only": true
}
],
"emails": [
{
"id": "802df042-1ac2-496d-af81-6ace729ed055",
"address": "jsmith@example.com",
"is_verified": true,
"is_primary": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"username": {
"id": "8cbed467-554b-4d17-b23f-bce1b4f1db92",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"otp": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
},
"password": {
"id": "28a7206b-e789-435a-b87c-108e034135c2",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"identities": [
{
"id": "77f8d594-9765-4891-ab2b-f31a797b531d",
"email_id": "d4095586-8318-4a40-a840-b4260496f85a",
"provider_id": "<string>",
"provider_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"metadata": {
"public_metadata": {
"role": "admin"
},
"private_metadata": {
"internal_id": "e6c19cfb-09a2-41e5-a908-e33193b7ca0a"
},
"unsafe_metadata": {
"birthday": "2025-05-12"
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your API key. Must only be used when using Hanko Cloud.
Body
application/json
Response
200
application/json
Details of the newly created user
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://{tenant_id}.hanko.io/admin/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"emails": [
{
"address": "<string>",
"is_primary": true,
"is_verified": true
}
],
"username": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}'
{
"id": "c339547d-e17d-4ba7-8a1d-b3d5a4d17c1c",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"webauthn_credentials": [
{
"id": "f9bebc04-b894-4018-bdb8-8b520a532fef",
"name": "<string>",
"public_key": "<string>",
"attestation_type": "<string>",
"aaguid": "<string>",
"transports": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"backup_eligible": true,
"backup_state": true,
"mfa_only": true
}
],
"emails": [
{
"id": "802df042-1ac2-496d-af81-6ace729ed055",
"address": "jsmith@example.com",
"is_verified": true,
"is_primary": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"username": {
"id": "8cbed467-554b-4d17-b23f-bce1b4f1db92",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"otp": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
},
"password": {
"id": "28a7206b-e789-435a-b87c-108e034135c2",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"identities": [
{
"id": "77f8d594-9765-4891-ab2b-f31a797b531d",
"email_id": "d4095586-8318-4a40-a840-b4260496f85a",
"provider_id": "<string>",
"provider_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"metadata": {
"public_metadata": {
"role": "admin"
},
"private_metadata": {
"internal_id": "e6c19cfb-09a2-41e5-a908-e33193b7ca0a"
},
"unsafe_metadata": {
"birthday": "2025-05-12"
}
}
}
Assistant
Responses are generated using AI and may contain mistakes.