KontoCloud
Java SDK / Operation reference

Authentication and security

16 operations

Example values illustrate the structure. Replace them with your identifiers and data; business validation still applies to these examples.

POST

/api/auth/device

#

post_auth_device

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
clientstringRequired
request.json
{
  "client": "example"
}

Successful response

200 · application/json

DeviceLoginStart

Call example

Java SDK

var body = "{\n  \"client\": \"example\"\n}";
var result = client.json("post_auth_device",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/security.rs · security::device_start

POST

/api/auth/device/poll

#

post_auth_device_poll

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
device_codestringRequired
request.json
{
  "device_code": "example"
}

Successful response

200 · application/json

DeviceLoginPoll

Call example

Java SDK

var body = "{\n  \"device_code\": \"example\"\n}";
var result = client.json("post_auth_device_poll",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/security.rs · security::device_poll

GET

/api/auth/email-verification

#

get_auth_email_verification

Access

User session: Authorization: Bearer <token>. API keys are not accepted on this route. Permissions and email verification depend on the operation; verification itself and logout are available before verification.

Request body

No request body.

Successful response

200 · application/json

integer · i32

Call example

Java SDK

var result = client.json("get_auth_email_verification",
    Map.of(), Map.of(), null);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · email_verify_wait

POST

/api/auth/email-verification

#

post_auth_email_verification

Access

User session: Authorization: Bearer <token>. API keys are not accepted on this route. Permissions and email verification depend on the operation; verification itself and logout are available before verification.

Request body

No request body.

Successful response

202 · application/json

AuthCode

Call example

Java SDK

var result = client.json("post_auth_email_verification",
    Map.of(), Map.of(), null);

Errors and constraints

mail_failed

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · email_verify_request

POST

/api/auth/email-verification/confirm

#

post_auth_email_verification_confirm

Access

User session: Authorization: Bearer <token>. API keys are not accepted on this route. Permissions and email verification depend on the operation; verification itself and logout are available before verification.

Request body

FieldTypeRequired
codestringRequired
request.json
{
  "code": "example"
}

Successful response

200 · application/json

Me

Call example

Java SDK

var body = "{\n  \"code\": \"example\"\n}";
var result = client.json("post_auth_email_verification_confirm",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · email_verify_confirm

POST

/api/auth/login

#

post_auth_login

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
emailstringRequired
passwordstringRequired
request.json
{
  "email": "[email protected]",
  "password": "example"
}

Successful response

200 · application/json

LoginStart

Call example

Java SDK

var body = "{\n  \"email\": \"[email protected]\",\n  \"password\": \"example\"\n}";
var result = client.json("post_auth_login",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/security.rs · security::login

POST

/api/auth/login/mfa

#

post_auth_login_mfa

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
ticketstringRequired
codestringRequired
request.json
{
  "ticket": "example",
  "code": "example"
}

Successful response

200 · application/json

Session

Call example

Java SDK

var body = "{\n  \"ticket\": \"example\",\n  \"code\": \"example\"\n}";
var result = client.json("post_auth_login_mfa",
    Map.of(), Map.of(), body);

Errors and constraints

mfa_locked

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/security.rs · security::login_mfa

POST

/api/auth/login/passkey

#

post_auth_login_passkey

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
ticketstringRequired
credential_idstringRequired
client_data_jsonstringRequired
authenticator_datastringRequired
signaturestringRequired
request.json
{
  "ticket": "example",
  "credential_id": "example",
  "client_data_json": "example",
  "authenticator_data": "example",
  "signature": "example"
}

Successful response

200 · application/json

Session

Call example

Java SDK

var body = "{\n  \"ticket\": \"example\",\n  \"credential_id\": \"example\",\n  \"client_data_json\": \"example\",\n  \"authenticator_data\": \"example\",\n  \"signature\": \"example\"\n}";
var result = client.json("post_auth_login_passkey",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/security.rs · security::login_passkey

POST

/api/auth/login/passkey/options

#

post_auth_login_passkey_options

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
ticketstringRequired
request.json
{
  "ticket": "example"
}

Successful response

200 · application/json

PasskeyRequestOptions

Call example

Java SDK

var body = "{\n  \"ticket\": \"example\"\n}";
var result = client.json("post_auth_login_passkey_options",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/security.rs · security::login_passkey_options

POST

/api/auth/logout

#

post_auth_logout

Access

User session: Authorization: Bearer <token>. API keys are not accepted on this route. Permissions and email verification depend on the operation; verification itself and logout are available before verification.

Request body

No request body.

Successful response

204

The response has no body.

Call example

Java SDK

var result = client.request("post_auth_logout",
    Map.of(), Map.of(), null, Map.of());

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · logout

POST

/api/auth/logout-all

#

post_auth_logout_all

Access

User session: Authorization: Bearer <token>. API keys are not accepted on this route. Permissions and email verification depend on the operation; verification itself and logout are available before verification.

Request body

No request body.

Successful response

204

The response has no body.

Call example

Java SDK

var result = client.request("post_auth_logout_all",
    Map.of(), Map.of(), null, Map.of());

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · logout_all

POST

/api/auth/password

#

post_auth_password

Access

User session: Authorization: Bearer <token>. API keys are not accepted on this route. Permissions and email verification depend on the operation; verification itself and logout are available before verification.

Request body

FieldTypeRequired
currentstringRequired
newstringRequired
request.json
{
  "current": "example",
  "new": "example"
}

Successful response

204

The response has no body.

Call example

Java SDK

var body = "{\n  \"current\": \"example\",\n  \"new\": \"example\"\n}";
var result = client.request("post_auth_password",
    Map.of(), Map.of(), body.getBytes(java.nio.charset.StandardCharsets.UTF_8), Map.of("Content-Type", "application/json"));

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · change_password

POST

/api/auth/password-reset

#

post_auth_password_reset

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
emailstringRequired
request.json
{
  "email": "[email protected]"
}

Successful response

202 · application/json

AuthCode

Call example

Java SDK

var body = "{\n  \"email\": \"[email protected]\"\n}";
var result = client.json("post_auth_password_reset",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · password_reset_request

POST

/api/auth/password-reset/confirm

#

post_auth_password_reset_confirm

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
codestringRequired
passwordstringRequired
request.json
{
  "code": "example",
  "password": "example"
}

Successful response

204

The response has no body.

Call example

Java SDK

var body = "{\n  \"code\": \"example\",\n  \"password\": \"example\"\n}";
var result = client.request("post_auth_password_reset_confirm",
    Map.of(), Map.of(), body.getBytes(java.nio.charset.StandardCharsets.UTF_8), Map.of("Content-Type", "application/json"));

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · password_reset_confirm

POST

/api/auth/register

#

post_auth_register

Access

No user session required. Submit credentials, codes or tickets as specified below.

Request body

FieldTypeRequired
emailstringRequired
namestringRequired
passwordstringRequired
request.json
{
  "email": "[email protected]",
  "name": "example",
  "password": "example"
}

Successful response

201 · application/json

Me

Call example

Java SDK

var body = "{\n  \"email\": \"[email protected]\",\n  \"name\": \"example\",\n  \"password\": \"example\"\n}";
var result = client.json("post_auth_register",
    Map.of(), Map.of(), body);

Errors and constraints

bad_email

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/lib.rs · register

POST

/api/auth/session/activate

#

post_auth_session_activate

Access

Token from a session awaiting device activation. This is the activation step, not a regular API operation.

Request body

FieldTypeRequired
transferbooleanRequired
approve_devicebooleanRequired
replace_device
string · UUIDnull
Optional
request.json
{
  "transfer": true,
  "approve_device": true
}

Successful response

200 · application/json

Session

Call example

Java SDK

var body = "{\n  \"transfer\": true,\n  \"approve_device\": true\n}";
var result = client.json("post_auth_session_activate",
    Map.of(), Map.of(), body);

Errors and constraints

Listed codes are explicit handler checks. Validation, access, locked-period and external-service errors also apply. After a network failure, check the state before retrying a write.

Errors and constraints →

Contract source: crates/kc-api/src/security.rs · security::activate_session

Complete JSON types

The types below include every nested field for this area. Requiredness describes deserialization; business validation can require additional values.

ActivateSession

FieldTypeRequired
transferbooleanRequired
approve_devicebooleanRequired
replace_device
string · UUIDnull
Optional

AuthCode

FieldTypeRequired
code
stringnull
Server default: null
Optional

DeviceCode

FieldTypeRequired
device_codestringRequired

DeviceLoginPoll

object · 1
FieldTypeRequired
status"pending"Required
object · 1
FieldTypeRequired
status"denied"Required
object · 1
FieldTypeRequired
status"expired"Required
object · 2
FieldTypeRequired
sessionSessionRequired
status"approved"Required

DeviceLoginStart

FieldTypeRequired
device_codestringRequired
user_codestringRequired
verification_urlstringRequired
expires_atstring · ISO 8601Required
intervalinteger · u32Required

DeviceSessionDetails

FieldTypeRequired
ip
stringnull
Optional
country
stringnull
Optional
user_agent
stringnull
Optional

Login

FieldTypeRequired
emailstringRequired
passwordstringRequired

Me

FieldTypeRequired
idstring · UUIDRequired
emailstringRequired
namestringRequired
preferences
Map<string, string>
Server default
Optional
platform_adminbooleanServer default: falseOptional
email_verifiedbooleanServer default: falseOptional
has_avatarbooleanServer default: falseOptional
mfa_required_by
Array<string>
Server default: []
Optional

MfaLogin

FieldTypeRequired
ticketstringRequired
codestringRequired

MfaRequired

FieldTypeRequired
mfa_ticketstringRequired
retry_after_secondsinteger · u64Server default: 0Optional
totpbooleanRequired
passkeybooleanRequired

MfaTicket

FieldTypeRequired
ticketstringRequired

PasskeyAssertion

FieldTypeRequired
ticketstringRequired
credential_idstringRequired
client_data_jsonstringRequired
authenticator_datastringRequired
signaturestringRequired

PasskeyRequestOptions

FieldTypeRequired
challengestringRequired
rp_idstringRequired
allow_credentials
Array<string>
Required

Register

FieldTypeRequired
emailstringRequired
namestringRequired
passwordstringRequired

RegisteredDevice

FieldTypeRequired
idstring · UUIDRequired
namestringRequired
approved_atstring · ISO 8601Required
last_used_atstring · ISO 8601Required
activebooleanRequired
currentbooleanRequired
sessionServer default: nullOptional

SessionActivation

FieldTypeRequired
expires_atstring · ISO 8601Required
approve_devicebooleanRequired
device_namestringRequired
max_devicesinteger · i32Required
devicesRequired