Skip to main content

Account

Tags: account, authentication

User account management

Resources

Request and response models used by the endpoints on this page.

AccountResponse

FieldTypeRequiredDescription
avatarUrlString
createdAtDateTime
emailString
emailVerifiedAtDateTime
enabledBoolean
idInteger
isSuperuserBoolean
localeString
loggedInBoolean
nameString
optedOutBoolean
phoneString
phoneVerifiedAtDateTime
signupWorkspaceIdInteger
stripeCustomerIdString
timezoneString
tosAcceptedBoolean
uuidString

Example:

{
"id": 0 // Integer,
"uuid": "string" // String,
"loggedIn": false // Boolean,
"avatarUrl": "string" // String,
"email": "string" // String,
"phone": "string" // String,
"emailVerifiedAt": "2024-01-01T00:00:00Z" // DateTime,
"phoneVerifiedAt": "2024-01-01T00:00:00Z" // DateTime,
"name": "string" // String,
"createdAt": "2024-01-01T00:00:00Z" // DateTime,
"isSuperuser": false // Boolean,
"enabled": false // Boolean,
"signupWorkspaceId": 0 // Integer,
"tosAccepted": false // Boolean,
"optedOut": false // Boolean,
"stripeCustomerId": "string" // String,
"locale": "string" // String,
"timezone": "string" // String
}

UpdateAccountRequest

FieldTypeRequiredDescription
localeString
nameString
optedOutBoolean
timezoneString
tosAcceptedBoolean

Example:

{
"name": "string" // String, optional,
"tosAccepted": false // Boolean, optional,
"optedOut": false // Boolean, optional,
"locale": "string" // String, optional,
"timezone": "string" // String, optional
}

Endpoints

Get Current Account

GET /api/v2/account

Description:

Retrieve the current user's account information

Retrieve user information based on user_id.

Returns a logged-out account object (with loggedIn=false) if not authenticated. This endpoint accepts optional authentication.

Authentication: Requires authenticated user

Response: See AccountResponse


Update Current Account

POST /api/v2/account

Description:

Update the current user's account information

Update user information.

Authentication: Requires authenticated user

Parameters:

Response: See AccountResponse


Acquisition

POST /api/v2/account/acquisition

Description:

Persist the buyer's FIRST-touch marketing attribution (write-once).

Called by the browser at signup completion with its resolved UTM/referrer capture. First write wins: once Account.acquisition is set a later post does not overwrite it, so the winning first touch is preserved for revenue-by-channel reporting (docs/growth/attribution.md P1). Idempotent: a repeat call (or a signal-free payload) returns recorded=false without mutating the row. (No DB uniqueness is enforced — the browser posts once, so a concurrent double-post is a non-issue and both carry the same first touch.) Values are allowlisted and size-capped server-side; PII-free by convention.

Authentication: Requires authenticated user

Parameters:

Response: See AcquisitionResponse