Skip to content
Back

Invalid type for attribute 'email': email

  • 0
  • 3
  • Self Hosted
  • Databases
17 Jul, 2026, 16:14

I'm using the node-appwrite SDK to create a table, the column payload looks like this:

TypeScript
[{"key":"email","type":"email","required":true, "size": 512}]

But I'm getting the error Invalid type for attribute 'email': email

Checking the appwrite source code, I see this as supported types: https://github.com/appwrite/appwrite/blob/a6d30130ba04e436ec46b8de4138af523079a8a2/src/Appwrite/Utopia/Database/Validator/Attributes.php#L23-L32

If I try to string as type it creates the table as expected, do we have missing types or I'm doing something wrong?

The docs example do the same as I'm doing

https://appwrite.io/docs/products/databases/tables

node-appwrite SDK: v26.2.0

TL;DR
The issue is with the attribute 'email' in the documentation. The problem can be solved by changing the type to 'string' and adding the 'format' parameter. The documentation will be updated soon.
17 Jul, 2026, 16:45

<@1356535431834898634> can you take a look at this? ๐Ÿ‘€

17 Jul, 2026, 17:27

Adding more information:

https://appwrite.io/docs/references/cloud/server-nodejs/tablesDB#createTable the documentation says:

Columns

TypeScript
Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.

The response model for createTable define the columns with:

Table columns.

Can be one of:

TypeScript
ColumnBoolean model, ColumnInteger model, ColumnFloat model, ColumnEmail model, ColumnEnum model, ColumnURL model, ColumnIP model, ColumnDatetime model, ColumnRelationship model, ColumnPoint model, ColumnLine model, ColumnPolygon model, ColumnString model
17 Jul, 2026, 17:40

Changing the type to string and adding the format param solves the problem, the issue is only in the documentation, as format isn't mentioned

17 Jul, 2026, 17:41

Sorry for that, I will update asap

1
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more