> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maqetin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Profiles

> What a profile holds, which traits have a type, how traits change, and how anonymous visits join a profile.

Maqetin keeps one profile for each person your app identifies: their traits, their events and those of their earlier anonymous visits, and every message Maqetin sent them. The console shows each profile as a contact.

## What a profile holds

| Part | What it holds |
| - | - |
| Ids | `userId`, your own key for the person, and `id`, the platform id Maqetin makes. A route that reads one profile takes the platform id. The console shows them as `userId` and `contactId` |
| Traits | The standard fields and your own traits |
| Email | The address, the email opt-in, and whether the address is suppressed |
| Devices | The 20 most recently seen devices, with their platform, time zone and when each was last seen |
| Last seen | The time of their newest event |
| Events | Every event of the person, and the events of their linked anonymous visits |
| Messages | Every message Maqetin sent them, with its delivery, open and click events |
| Journeys | Every journey they entered, and where they are in it |

## Set traits with identify

`identify` upserts a profile: it creates it the first time and updates its traits after that. [Identify](https://docs.maqetin.com/api-reference/identify.md) lists every field of the call.

```json theme={null}
{ "userId": "user_123", "traits": { "email": "ada@example.com", "firstName": "Ada", "lastName": "Lovelace", "plan": "pro" }, "channel": "rest" }
```

| Trait | Type | If the type is wrong |
| - | - | - |
| `email` | A valid email address | The call is refused with a 400 |
| `phone`, `firstName`, `lastName`, `plan`, `country` | A string | The call is refused with a 400 |
| `createdAt` | An ISO date-time in UTC | The call is refused with a 400 |
| `timezone` | An IANA time zone, such as `Asia/Singapore` | Skipped: the call is accepted and the profile keeps its value |
| `locale` | A language tag, such as `en-SG` | Skipped: the call is accepted and the profile keeps its value |
| `emailOptIn` | `true` or `false` | Skipped: the call is accepted and the profile keeps its value |
| Any other trait | Any JSON value | |

## How traits change

* An `identify` changes only the traits it sends. The others keep their values.
* Each trait keeps the value of the `identify` with the latest `timestamp`, so a late call with an older `timestamp` does not overwrite a newer value.
* Send `null` for one of your own traits to remove it.
* A `timezone` or `locale` you send as a trait wins over the one the SDK reads from the browser.
* A new profile starts with `emailOptIn` set to `true`. Send `false` when the person has not agreed to email from journeys. An unsubscribe also sets it to `false`.
* Once a call made with a secret key sets `email`, `phone` or `emailOptIn`, only another secret-key call can change it. A browser call can still fill one while it is empty.
* Set those three from your server if you can: send a [batch](https://docs.maqetin.com/api-reference/batch.md) with a secret key that has the `events:write` scope. [API keys](https://docs.maqetin.com/workspace/api-keys.md) explains the two kinds of key.
* Anyone can read the public key in your page, so a browser call can claim to be any person. [Identity verification](https://docs.maqetin.com/data/identity-verification.md) closes that gap with a token your server signs.

## Limits

| Limit | Value |
| - | - |
| A standard text trait (`email`, `phone`, `firstName`, `lastName`, `plan`, `country`) | 1,024 bytes |
| Your own traits on one profile | 200 |
| One of your own traits, its name and value together | 8,192 bytes |
| All your own traits on one profile | 131,072 bytes |
| A trait name usable in a segment | Letters, digits, `_` and `-`, up to 100 characters |
| Anonymous ids a profile keeps links to | The 50 most recent |
| Trait names on the **Trait keys** tab of **Developers** | The standard fields, then up to 500 of your own |

A trait over a limit is skipped, and the rest of the call still applies. A trait name that starts with `$`, holds a `.`, or is `__proto__`, `constructor` or `prototype` is skipped too.

## Anonymous visits

Send `identify` with the `anonymousId` the SDK tagged the earlier events with, and they join the profile ([Events](https://docs.maqetin.com/data/events.md#identified-and-anonymous-events) shows the flow). The SDK keeps that id in the browser's storage, and `reset()` starts a new one: call it on logout, or on a shared browser the next person's `identify` picks up the earlier visits. Maqetin joins anonymous visits to a profile, but never merges two profiles that each have a `userId`.

## Read, export or delete a profile

Every member of the workspace can read contacts in the console; only the owner can export or delete one ([Contacts](https://docs.maqetin.com/data/contacts.md)). From your server, a secret key with the `contacts:read` scope lists, reads and exports profiles, and one with `contacts:delete` erases one ([Contacts API](https://docs.maqetin.com/api-reference/contacts.md)).


## Related topics

- [Contacts](https://docs.maqetin.com/data/contacts.md)
- [Events](https://docs.maqetin.com/data/events.md)
- [Segments](https://docs.maqetin.com/data/segments.md)
- [Quickstart](https://docs.maqetin.com/quickstart.md)
- [Identify](https://docs.maqetin.com/api-reference/identify.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.