Profilo e sicurezza
MarkdownMetodi, campi delle richieste e risposte.
Guida completa
La sezione contiene 6 metodi. Apri un metodo per vedere condizioni di accesso, campi della richiesta e risposta.
| Metodo e percorso | Descrizione | Accesso |
|---|---|---|
PUT /api/v1/user | Modifica del profilo | Token dell’area personale |
GET /api/v1/user/passkeys | Elenco delle passkey | Token dell’area personale |
PUT /api/v1/user/password | Modifica della password | Token dell’area personale |
GET /api/v1/user/profile | Profilo, saldo e collegamenti | Token dell’area personale |
GET /api/v1/user/totp/status | Stato 2FA (TOTP) | Token dell’area personale |
GET /api/v1/user/totp/verification-method | Metodo di verifica TOTP | Token dell’area personale |
PUT /api/v1/user — Modifica del profilo
Accesso: token dell’area personale
/api/v1/userCampi JSON / modulo
| Il campo | Tipo | Obbligatorio | Verifica / descrizione |
|---|---|---|---|
username | string | no | ; può essere null |
avatar_url | string | no | ; può essere null |
balance_notify_enabled | boolean | no | ; può essere null |
balance_notify_threshold | number | no | ; può essere null |
{
"username": "PLACEHOLDER_USERNAME (string)",
"avatar_url": "PLACEHOLDER_AVATAR_URL (string)",
"balance_notify_enabled": "PLACEHOLDER_BALANCE_NOTIFY_ENABLED (boolean)",
"balance_notify_threshold": "PLACEHOLDER_BALANCE_NOTIFY_THRESHOLD (number)"
}PLACEHOLDER indica il tuo input e il suo tipo. Sostituisci i valori e mantieni solo i campi facoltativi necessari; i segnaposto stringa non vanno inviati al posto di numeri, boolean, oggetti o array.
Schema della richiesta: UpdateProfileRequest
Risposta
La risposta JSON contiene code, message e data. Il contenuto di data è descritto negli schemi sotto.
Schemi dei dati della risposta: User, UserProfileResponse. Campi e tipi sono nelle pagine «Schemi dei dati».
{
"code": 0,
"message": "success",
"data": {
"id": "PLACEHOLDER_ID (integer)",
"email": "PLACEHOLDER_EMAIL (string)",
"username": "PLACEHOLDER_USERNAME (string)",
"role": "PLACEHOLDER_ROLE (string)",
"balance": "PLACEHOLDER_BALANCE (number)",
"frozen_balance": "PLACEHOLDER_FROZEN_BALANCE (number)",
"concurrency": "PLACEHOLDER_CONCURRENCY (integer)",
"status": "PLACEHOLDER_STATUS (string)",
"last_active_at": "PLACEHOLDER_LAST_ACTIVE_AT (string)",
"created_at": "PLACEHOLDER_CREATED_AT (string)",
"updated_at": "PLACEHOLDER_UPDATED_AT (string)",
"deleted_at": "PLACEHOLDER_DELETED_AT (string)",
"balance_notify_enabled": "PLACEHOLDER_BALANCE_NOTIFY_ENABLED (boolean)",
"balance_notify_threshold_type": "PLACEHOLDER_BALANCE_NOTIFY_THRESHOLD_TYPE (string)",
"balance_notify_threshold": "PLACEHOLDER_BALANCE_NOTIFY_THRESHOLD (number)",
"balance_notify_extra_emails": "PLACEHOLDER_BALANCE_NOTIFY_EXTRA_EMAILS (array)",
"total_recharged": "PLACEHOLDER_TOTAL_RECHARGED (number)",
"rpm_limit": "PLACEHOLDER_RPM_LIMIT (integer)",
"api_keys": "PLACEHOLDER_API_KEYS (array)",
"avatar_url": "PLACEHOLDER_AVATAR_URL (string)",
"email_bound": "PLACEHOLDER_EMAIL_BOUND (boolean)"
}
}Particolarità: Tutti i dati personali e gli oggetti sono limitati al soggetto JWT.
Particolarità: L’operazione modifica lo stato o prosegue un’autorizzazione monouso; l’esempio descrive il contratto e non viene eseguito.
Particolarità: I limiti di spesa delle chiavi (quota, quota_used) arrivano nella risposta delle chiavi, non nel profilo. frozen_balance è l’importo riservato e non va considerato saldo libero.
GET /api/v1/user/passkeys — Elenco delle passkey
Accesso: token dell’area personale
/api/v1/user/passkeyscurl --fail-with-body "https://ailoot.ai/api/v1/user/passkeys" \
-H "Authorization: Bearer $TOKEN"Il corpo della richiesta non è necessario. Passa i parametri indicati sopra nell’URL.
Risposta
La risposta JSON contiene code, message e data. Il contenuto di data è descritto negli schemi sotto.
Schemi dei dati della risposta: PasskeyCredentialSummary. Campi e tipi sono nelle pagine «Schemi dei dati».
{
"code": 0,
"message": "success",
"data": {
"id": "PLACEHOLDER_ID (integer)",
"name": "PLACEHOLDER_NAME (string)",
"created_at": "PLACEHOLDER_CREATED_AT (string)",
"last_used_at": "PLACEHOLDER_LAST_USED_AT (string)",
"backup": "PLACEHOLDER_BACKUP (boolean)"
}
}Particolarità: Tutti i dati personali e gli oggetti sono limitati al soggetto JWT.
Particolarità: credential è ottenuto da navigator.credentials; session_token da begin. Corpo di Finish <=65536 byte; registrazione ed eliminazione richiedono la password.
PUT /api/v1/user/password — Modifica della password
Accesso: token dell’area personale
/api/v1/user/passwordCampi JSON / modulo
| Il campo | Tipo | Obbligatorio | Verifica / descrizione |
|---|---|---|---|
old_password | string | sì | required |
new_password | string | sì | required,min=6 |
{
"old_password": "PLACEHOLDER_OLD_PASSWORD (string)",
"new_password": "PLACEHOLDER_NEW_PASSWORD (string)"
}PLACEHOLDER indica il tuo input e il suo tipo. Sostituisci i valori e mantieni solo i campi facoltativi necessari; i segnaposto stringa non vanno inviati al posto di numeri, boolean, oggetti o array.
Schema della richiesta: ChangePasswordRequest
Risposta
La risposta JSON contiene code, message e data. Il contenuto di data è descritto negli schemi sotto.
{
"code": 0,
"message": "success",
"data": {
"message": "VALUE_FROM_RESPONSE"
}
}Particolarità: Tutti i dati personali e gli oggetti sono limitati al soggetto JWT.
Particolarità: L’operazione modifica lo stato o prosegue un’autorizzazione monouso; l’esempio descrive il contratto e non viene eseguito.
GET /api/v1/user/profile — Profilo, saldo e collegamenti
Accesso: token dell’area personale
/api/v1/user/profilecurl --fail-with-body "https://ailoot.ai/api/v1/user/profile" \
-H "Authorization: Bearer $TOKEN"Il corpo della richiesta non è necessario. Passa i parametri indicati sopra nell’URL.
Risposta
La risposta JSON contiene code, message e data. Il contenuto di data è descritto negli schemi sotto.
Schemi dei dati della risposta: User, UserProfileResponse. Campi e tipi sono nelle pagine «Schemi dei dati».
{
"code": 0,
"message": "success",
"data": {
"id": "PLACEHOLDER_ID (integer)",
"email": "PLACEHOLDER_EMAIL (string)",
"username": "PLACEHOLDER_USERNAME (string)",
"role": "PLACEHOLDER_ROLE (string)",
"balance": "PLACEHOLDER_BALANCE (number)",
"frozen_balance": "PLACEHOLDER_FROZEN_BALANCE (number)",
"concurrency": "PLACEHOLDER_CONCURRENCY (integer)",
"status": "PLACEHOLDER_STATUS (string)",
"last_active_at": "PLACEHOLDER_LAST_ACTIVE_AT (string)",
"created_at": "PLACEHOLDER_CREATED_AT (string)",
"updated_at": "PLACEHOLDER_UPDATED_AT (string)",
"deleted_at": "PLACEHOLDER_DELETED_AT (string)",
"balance_notify_enabled": "PLACEHOLDER_BALANCE_NOTIFY_ENABLED (boolean)",
"balance_notify_threshold_type": "PLACEHOLDER_BALANCE_NOTIFY_THRESHOLD_TYPE (string)",
"balance_notify_threshold": "PLACEHOLDER_BALANCE_NOTIFY_THRESHOLD (number)",
"balance_notify_extra_emails": "PLACEHOLDER_BALANCE_NOTIFY_EXTRA_EMAILS (array)",
"total_recharged": "PLACEHOLDER_TOTAL_RECHARGED (number)",
"rpm_limit": "PLACEHOLDER_RPM_LIMIT (integer)",
"api_keys": "PLACEHOLDER_API_KEYS (array)",
"avatar_url": "PLACEHOLDER_AVATAR_URL (string)",
"email_bound": "PLACEHOLDER_EMAIL_BOUND (boolean)"
}
}Particolarità: Tutti i dati personali e gli oggetti sono limitati al soggetto JWT.
Particolarità: I limiti di spesa delle chiavi (quota, quota_used) arrivano nella risposta delle chiavi, non nel profilo. frozen_balance è l’importo riservato e non va considerato saldo libero.
GET /api/v1/user/totp/status — Stato 2FA (TOTP)
Accesso: token dell’area personale
/api/v1/user/totp/statuscurl --fail-with-body "https://ailoot.ai/api/v1/user/totp/status" \
-H "Authorization: Bearer $TOKEN"Il corpo della richiesta non è necessario. Passa i parametri indicati sopra nell’URL.
Risposta
La risposta JSON contiene code, message e data. Il contenuto di data è descritto negli schemi sotto.
Schemi dei dati della risposta: TotpStatusResponse. Campi e tipi sono nelle pagine «Schemi dei dati».
{
"code": 0,
"message": "success",
"data": {
"enabled": "PLACEHOLDER_ENABLED (boolean)",
"enabled_at": "PLACEHOLDER_ENABLED_AT (integer)",
"feature_enabled": "PLACEHOLDER_FEATURE_ENABLED (boolean)"
}
}Particolarità: Tutti i dati personali e gli oggetti sono limitati al soggetto JWT.
Particolarità: secret e setup_token sono segreti; la verifica dipende dalle impostazioni TOTP e dall’utente.
GET /api/v1/user/totp/verification-method — Metodo di verifica TOTP
Accesso: token dell’area personale
/api/v1/user/totp/verification-methodcurl --fail-with-body "https://ailoot.ai/api/v1/user/totp/verification-method" \
-H "Authorization: Bearer $TOKEN"Il corpo della richiesta non è necessario. Passa i parametri indicati sopra nell’URL.
Risposta
La risposta JSON contiene code, message e data. Il contenuto di data è descritto negli schemi sotto.
{
"code": 0,
"message": "success",
"data": {
"method": "email"
}
}Particolarità: Tutti i dati personali e gli oggetti sono limitati al soggetto JWT.
Particolarità: secret e setup_token sono segreti; la verifica dipende dalle impostazioni TOTP e dall’utente.
TotpVerificationMethod
{
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"type": "string",
"enum": [
"email",
"password"
]
}
}
}