> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-0.md).

# Account tables

{% hint style="info" %}
Generated from the staging database schema, with descriptions drafted by agents ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/db/tables/viewpoint-0.md).
{% endhint %}

## Description

Signing in, passwords, verification codes, devices and sign-in tokens, single sign-on, app start and consent logs, and the links that open the app (dynamic links).

## Tables

| Name                                                                                                                       | Columns | Comment                                                                                                                                                                                                                                                                                                                                                  | Type       |
| -------------------------------------------------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| [api\_token\_auth](https://docs.snapfix.com/engineering-reference/db/tables/api_token_auth.md)                             | 11      | One short-lived reference token. authpy adds one for each sign-in, resend or sign-up code it sends, and its uuid is the reference id that the resend and verify steps use; php-apis's ?action=api\_token\_auth adds 60-second API tokens.                                                                                                                | BASE TABLE |
| [credential\_code](https://docs.snapfix.com/engineering-reference/db/tables/credential_code.md)                            | 12      | One 6-character code sent to a signed-in user by email or SMS to verify their email or mobile number; api\_php\_live\_v2 and php-apis write it. Codes are kept in plain text and never deleted. A WhatsApp request adds a row without a code, because Twilio checks those codes.                                                                         | BASE TABLE |
| [dynamiclink](https://docs.snapfix.com/engineering-reference/db/tables/dynamiclink.md)                                     | 18      | One short link for a user or QR invitation, a password reset or a profile check, with counters for how often it was opened and used. A QR sign-up link stores the sign-up form, password included.                                                                                                                                                       | BASE TABLE |
| [dynamiclink\_user](https://docs.snapfix.com/engineering-reference/db/tables/dynamiclink_user.md)                          | 13      | One person invited through a dynamic link (uuid\_tUser), with the state of the invitation, a welcome flag and how many times they were invited.                                                                                                                                                                                                          | BASE TABLE |
| [enum\_sso](https://docs.snapfix.com/engineering-reference/db/tables/enum_sso.md)                                          | 8       | Sign-in types, code in uuid: google, apple, azure, github, amazon and slack (single sign-on), and Snapfix's own snapfix-password, snapfix-email-otp and snapfix-mobile-otp. sso\_rules.enum\_sso holds these codes, and authpy treats every type other than the three Snapfix ones as single sign-on.                                                    | BASE TABLE |
| [sso\_apple\_user](https://docs.snapfix.com/engineering-reference/db/tables/sso_apple_user.md)                             | 18      | One Apple sign-in linked to a user, with the Apple email, name and image and the provider's responses as JSON.                                                                                                                                                                                                                                           | BASE TABLE |
| [sso\_azure\_user](https://docs.snapfix.com/engineering-reference/db/tables/sso_azure_user.md)                             | 18      | One Microsoft (Azure) sign-in linked to a user, with the email, name and image and the provider's responses as JSON.                                                                                                                                                                                                                                     | BASE TABLE |
| [sso\_google\_user](https://docs.snapfix.com/engineering-reference/db/tables/sso_google_user.md)                           | 18      | One Google sign-in linked to a user, with the email, name and image and the provider's responses as JSON.                                                                                                                                                                                                                                                | BASE TABLE |
| [sso\_rules](https://docs.snapfix.com/engineering-reference/db/tables/sso_rules.md)                                        | 16      | One rule that recommends a sign-in method for login emails containing email\_tail, and can add users who sign in that way to groups.                                                                                                                                                                                                                     | BASE TABLE |
| [tPri\_Device](https://docs.snapfix.com/engineering-reference/db/tables/tpri_device.md)                                    | 16      | A device a user has signed in from, with its device ID, make, model and type, and the keys for its encrypted payloads, which are stored as plain text.                                                                                                                                                                                                   | BASE TABLE |
| [tPri\_Log\_StartAppUser](https://docs.snapfix.com/engineering-reference/db/tables/tpri_log_startappuser.md)               | 8       | A row each time a user starts the app, with the app version and the IP lookup data.                                                                                                                                                                                                                                                                      | BASE TABLE |
| [tPri\_Log\_UserGdpr](https://docs.snapfix.com/engineering-reference/db/tables/tpri_log_usergdpr.md)                       | 10      | One record of a user's communication consent (account updates, group task updates and product updates). php-apis adds a row for each change and takes the newest row of a user as the current choice \[[ASK-27](https://github.com/snapfix/docs/blob/main/ASK.md#ask-27-where-do-users-change-their-communication-consent-and-how-should-it-be-stored)]. | BASE TABLE |
| [tPri\_Log\_UserTermsConditions](https://docs.snapfix.com/engineering-reference/db/tables/tpri_log_usertermsconditions.md) | 8       | One record of a user agreeing or not to the terms and conditions, with the terms text shown. php-apis writes it.                                                                                                                                                                                                                                         | BASE TABLE |
| [tPri\_UserHashSalt](https://docs.snapfix.com/engineering-reference/db/tables/tpri_userhashsalt.md)                        | 11      | One password record of a user, with the salted hash that sign-in checks (authpy and the Laravel API). The newest row (highest id) is the current one.                                                                                                                                                                                                    | BASE TABLE |
| [tPri\_UserHashSalt\_Temporary](https://docs.snapfix.com/engineering-reference/db/tables/tpri_userhashsalt_temporary.md)   | 13      | A temporary password of a user, accepted until expiryTs and optionally for one sign-in only.                                                                                                                                                                                                                                                             | BASE TABLE |
| [tServerOnly\_DeviceUserToken](https://docs.snapfix.com/engineering-reference/db/tables/tserveronly_deviceusertoken.md)    | 13      | A person's sign-in on a device, with device details, login and logout times and fLoggedOn while signed in. Only php-apis's generic table actions write it, nothing calls them, and staging has one row.                                                                                                                                                  | BASE TABLE |
| [token\_jwt](https://docs.snapfix.com/engineering-reference/db/tables/token_jwt.md)                                        | 18      | One sign-in token issued by authpy to a user on a device: its ID, type, times, claims and blocked flag; the token string itself is not stored. php-apis reads it to reject blocked tokens.                                                                                                                                                               | BASE TABLE |

## Relations

```mermaid
erDiagram

"dynamiclink_user" }o--o| "dynamiclink" : "FOREIGN KEY (uuid_dynamiclink) REFERENCES dynamiclink (uuid)"

"api_token_auth" {
}
"credential_code" {
}
"dynamiclink" {
  varchar_255_ uuid
}
"dynamiclink_user" {
  varchar_255_ uuid_dynamiclink
}
"enum_sso" {
}
"sso_apple_user" {
}
"sso_azure_user" {
}
"sso_google_user" {
}
"sso_rules" {
}
"tPri_Device" {
}
"tPri_Log_StartAppUser" {
}
"tPri_Log_UserGdpr" {
}
"tPri_Log_UserTermsConditions" {
}
"tPri_UserHashSalt" {
}
"tPri_UserHashSalt_Temporary" {
}
"tServerOnly_DeviceUserToken" {
}
"token_jwt" {
}
```

***

> Generated by [tbls](https://github.com/k1LoW/tbls)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-0.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
