> 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/token_jwt.md).

# token\_jwt

{% 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/token_jwt.md).
{% endhint %}

## Description

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.

<details>

<summary><strong>Table Definition</strong></summary>

```sql
CREATE TABLE `token_jwt` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) DEFAULT NULL,
  `uuid_tUser` varchar(255) DEFAULT NULL,
  `device_id` varchar(255) DEFAULT NULL,
  `token_jti` varchar(255) DEFAULT NULL,
  `token_identity` varchar(255) DEFAULT NULL,
  `token_type` varchar(255) DEFAULT NULL,
  `token_iat` bigint DEFAULT '0',
  `token_nbf` bigint DEFAULT '0',
  `token_exp` bigint DEFAULT '0',
  `token_fresh` tinyint DEFAULT NULL,
  `token_user_claims` json DEFAULT NULL,
  `blocked` tinyint DEFAULT '0',
  `notes` varchar(255) DEFAULT NULL,
  `fDeleted` tinyint DEFAULT '0',
  `fCreatedTs` bigint DEFAULT '0',
  `fServerTs` bigint DEFAULT '0',
  `uuid_tUser_CreatedBy` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uuid` (`uuid`) USING BTREE,
  KEY `idx_tokenjwt_user_device` (`uuid_tUser`,`device_id`,`token_type`,`blocked`,`id`),
  KEY `idx_tokenjwt_jti` (`token_jti`,`id`),
  KEY `idx_token_cleanup` (`uuid_tUser`,`device_id`,`token_type`,`fCreatedTs`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
```

</details>

## Columns

| Name                   | Type         | Default | Nullable | Extra Definition | Comment                                                     |
| ---------------------- | ------------ | ------- | -------- | ---------------- | ----------------------------------------------------------- |
| id                     | int          |         | false    | auto\_increment  |                                                             |
| uuid                   | varchar(255) |         | true     |                  |                                                             |
| uuid\_tUser            | varchar(255) |         | true     |                  |                                                             |
| device\_id             | varchar(255) |         | true     |                  |                                                             |
| token\_jti             | varchar(255) |         | true     |                  |                                                             |
| token\_identity        | varchar(255) |         | true     |                  |                                                             |
| token\_type            | varchar(255) |         | true     |                  | access or refresh.                                          |
| token\_iat             | bigint       | 0       | true     |                  | Issue time, in Unix seconds.                                |
| token\_nbf             | bigint       | 0       | true     |                  | Not-before time, in Unix seconds.                           |
| token\_exp             | bigint       | 0       | true     |                  | Expiry time, in Unix seconds.                               |
| token\_fresh           | tinyint      |         | true     |                  | Always 0: authpy writes 0 whatever the token's fresh claim. |
| token\_user\_claims    | json         |         | true     |                  | The token's user claims, as JSON.                           |
| blocked                | tinyint      | 0       | true     |                  | 1 when the token has been revoked.                          |
| notes                  | varchar(255) |         | true     |                  |                                                             |
| fDeleted               | tinyint      | 0       | true     |                  |                                                             |
| fCreatedTs             | bigint       | 0       | true     |                  |                                                             |
| fServerTs              | bigint       | 0       | true     |                  |                                                             |
| uuid\_tUser\_CreatedBy | varchar(255) |         | true     |                  |                                                             |

## Viewpoints

| Name                                                                               | Definition                                                                                                                                                          |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [account](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-0.md) | 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). |

## Constraints

| Name    | Type        | Definition             |
| ------- | ----------- | ---------------------- |
| PRIMARY | PRIMARY KEY | PRIMARY KEY (id)       |
| uuid    | UNIQUE      | UNIQUE KEY uuid (uuid) |

## Indexes

| Name                        | Definition                                                                                      |
| --------------------------- | ----------------------------------------------------------------------------------------------- |
| idx\_token\_cleanup         | KEY idx\_token\_cleanup (uuid\_tUser, device\_id, token\_type, fCreatedTs) USING BTREE          |
| idx\_tokenjwt\_jti          | KEY idx\_tokenjwt\_jti (token\_jti, id) USING BTREE                                             |
| idx\_tokenjwt\_user\_device | KEY idx\_tokenjwt\_user\_device (uuid\_tUser, device\_id, token\_type, blocked, id) USING BTREE |
| PRIMARY                     | PRIMARY KEY (id) USING BTREE                                                                    |
| uuid                        | UNIQUE KEY uuid (uuid) USING BTREE                                                              |

## Relations

```mermaid
erDiagram


"token_jwt" {
  int id PK
}
```

***

> 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/token_jwt.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.
