User

User account management endpoints

Activate Currency

post

Sets the active currency for the user's session.

Business Logic:

  • Validates the currency code against available currencies.

  • Updates the session with the new currency.

Dynamic Settings:

  • AVAILABLE_CURRENCIES: List of valid currency codes (e.g., ['TRY', 'USD', 'EUR']).

Header parameters
X-CSRFTokenstringRequired

CSRF token for write operations (POST, PUT, PATCH, DELETE). Required for security when using session authentication. Obtain token from cookie 'csrftoken' or meta tag in HTML.

Example: abc123def456ghi789
CookiestringRequired

Session ID and CSRF token cookies. Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>

Example: sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789
Body
currency_codestringRequired

The currency code to activate (e.g., 'TRY', 'USD'). Must be one of the available currencies.

Responses
post
/users/activate-currency/

No content

Anonymize User

patch

Anonymizes the current user account.

Business Logic:

  • Requires SELF_ANONYMIZATION_ENABLED setting to be true.

  • Marks the user as anonymized and logs them out.

  • No request body is required as the operation targets the authenticated user.

Authorizations
sessionidstringRequired
Header parameters
X-CSRFTokenstringRequired

CSRF token for write operations (POST, PUT, PATCH, DELETE). Required for security when using session authentication. Obtain token from cookie 'csrftoken' or meta tag in HTML.

Example: abc123def456ghi789
CookiestringRequired

Session ID and CSRF token cookies. Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>

Example: sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789
Responses
chevron-right
200

User anonymized successfully

No content

patch
/users/anonymize/

No content

Validate Password Reset Token

get

Checks if the password reset link (UID and token) is valid.

Path parameters
uidb64stringRequired

Base64 encoded user ID

tokenstringRequired

Password reset token

Responses
chevron-right
200

Validation result

application/json
get
/users/api-reset/{uidb64}/{token}/
200

Validation result

Reset Password

post

Resets the user's password using the provided token and new password.

Business Logic:

  • Validates the uidb64 and token to ensure the reset link is valid.

  • Validates that new_password1 and new_password2 match.

  • Validates new_password1 against configured password validators (AUTH_PASSWORD_VALIDATORS).

  • Updates the user's password and saves the old password in history.

  • Sets the user type to 'registered'.

Path parameters
uidb64stringRequired

Base64 encoded user ID

tokenstringRequired

Password reset token

Header parameters
X-CSRFTokenstringRequired

CSRF token for write operations (POST, PUT, PATCH, DELETE). Required for security when using session authentication. Obtain token from cookie 'csrftoken' or meta tag in HTML.

Example: abc123def456ghi789
CookiestringRequired

Session ID and CSRF token cookies. Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>

Example: sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789
Body
new_password1string · passwordRequired

The new password. Validated against the system's password validators (e.g., minimum length, common passwords).

new_password2string · passwordRequired

Confirmation of the new password. Must match 'new_password1'.

Responses
chevron-right
200

Password reset successfully

No content

post
/users/api-reset/{uidb64}/{token}/

No content

Change User City

post

Updates the user's city preference.

Business Logic:

  • Updates the 'city' attribute in the user's profile or session.

Header parameters
X-CSRFTokenstringRequired

CSRF token for write operations (POST, PUT, PATCH, DELETE). Required for security when using session authentication. Obtain token from cookie 'csrftoken' or meta tag in HTML.

Example: abc123def456ghi789
CookiestringRequired

Session ID and CSRF token cookies. Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>

Example: sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789
Body
citystringRequired

City name or ID. Validated against available cities in the system.

Responses
chevron-right
200

City updated successfully

application/json
post
/users/change_city/

Last updated

Was this helpful?