KontoCloud
Rust 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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
    r: &DeviceLoginRequest,
) -> kc_sdk::Result <DeviceLoginStart> {
    client.device_login_start(r).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &mut Client,
    device_code: &str,
) -> kc_sdk::Result <DeviceLoginPoll> {
    client.device_login_poll(device_code).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
) -> kc_sdk::Result <i32> {
    client.email_verification_wait().await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
) -> kc_sdk::Result <AuthCode> {
    client.request_email_verification().await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
    code: &str,
) -> kc_sdk::Result <Me> {
    client.verify_email(code).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &mut Client,
    email: &str,
    password: &str,
) -> kc_sdk::Result <LoginStart> {
    client.login_start(email, password).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &mut Client,
    ticket: &str,
    code: &str,
) -> kc_sdk::Result <Session> {
    client.login_mfa(ticket, code).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &mut Client,
    a: &PasskeyAssertion,
) -> kc_sdk::Result <Session> {
    client.login_passkey(a).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
    ticket: &str,
) -> kc_sdk::Result <PasskeyRequestOptions> {
    client.login_passkey_options(ticket).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &mut Client,
) -> kc_sdk::Result <()> {
    client.logout().await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &mut Client,
) -> kc_sdk::Result <()> {
    client.logout_all().await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
    current: &str,
    new: &str,
) -> kc_sdk::Result <()> {
    client.change_password(current, new).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
    email: &str,
) -> kc_sdk::Result <AuthCode> {
    client.request_password_reset(email).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
    code: &str,
    password: &str,
) -> kc_sdk::Result <()> {
    client.confirm_password_reset(code, password).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &Client,
    r: &Register,
) -> kc_sdk::Result <Me> {
    client.register(r).await
}

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

Rust SDK

use kc_sdk::{Client, Download, kc_types::*};
use chrono::NaiveDate;

async fn example(
    client: &mut Client,
    a: &ActivateSession,
) -> kc_sdk::Result <Session> {
    client.activate_session(a).await
}

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