Account Type

The Account object represents a user in the Verisoul system. Each account has a unique identifier, an optional email address, and customizable metadata.

Structure

FieldTypeRequiredDescription
idstringYesUnique identifier for the account
emailstringNoEmail address associated with the account
metadataobjectNoKey-value pairs of custom data associated with the account

Email Address

An Account can have have a string email address. Verisoul stores only one email address per Account. When updating an account with a new email address, the previous email address is replaced.

Metadata

The metadata object allows you to store custom data with each account. When updating metadata:

  1. New fields are added to the existing metadata
  2. Existing fields are overwritten with new values
  3. Other existing fields are preserved

Example: Metadata Updates

Starting metadata state:

{
  "id": "acc_123456789",
  "email": "user@example.com",
  "metadata": {
    "first_name": "John",
    "signup_date": "2023-01-15"
  }
}

Update 1: Overwrite an existing field

// Request
{
  "metadata": {
    "first_name": "Jonathan"
  }
}

// Resulting account state
{
  "id": "acc_123456789",
  "email": "user@example.com",
  "metadata": {
    "first_name": "Jonathan", // Updated
    "signup_date": "2023-01-15" // Preserved
  }
}

Update 2: Add a new field

// Request
{
  "metadata": {
    "last_name": "Smith"
  }
}

// Resulting account state
{
  "id": "acc_123456789",
  "email": "user@example.com",
  "metadata": {
    "first_name": "Jonathan", // Preserved
    "signup_date": "2023-01-15", // Preserved
    "last_name": "Smith" // Added
  }
}