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
A fix for the invalid email attribute type issue has been created but not yet released. In the meantime, you can use individual column creation methods or Appwrite CLI to manage the schema through the Appwrite config JSON.
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
21 Jul, 2026, 17:03

There is any place where I can see all available types? for example I got an error if try to use text as column type, checking the source code I see the accepted values are:

TypeScript
Database::VAR_STRING
Database::VAR_INTEGER
Database::VAR_BIGINT
Database::VAR_FLOAT
Database::VAR_BOOLEAN
Database::VAR_DATETIME
Database::VAR_POINT
Database::VAR_LINESTRING
Database::VAR_POLYGON

so, I should use string, but string according to the docs it's deprecated: https://appwrite.io/blog/post/new-string-types

and the available formats doesn't include varchar, text, mediumtext or longtext

I'd love to have more information about my confusion. Just to make clear, I'm using the node-appwrite SDK with createTable

22 Jul, 2026, 07:12

text should work, are you sure you're on the latest sdk?

here are the available types - https://appwrite.io/docs/products/databases/tables#columns

22 Jul, 2026, 12:47

I'm using v26.2.0 (node-sdk) but the error is server side, checking the logs I see:

TypeScript
http.request · 11.6ms · 09cd46d4

  level                  error
  http.method            POST
  listener.usage.event   Appwrite\Bus\Events\RequestCompleted
  listener.usage.success true
  http.path              /v1/tablesdb/:databaseId/tables
  http.response.code     400

  Appwrite\Extend\Exception: Invalid type for attribute 'modulePath': text
    at /usr/src/code/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php:145
    at /usr/src/code/vendor/utopia-php/http/src/Http/Http.php:645
    at /usr/src/code/vendor/utopia-php/http/src/Http/Http.php:864
    at /usr/src/code/vendor/utopia-php/http/src/Http/Http.php:791
    ... 3 more

I'm using appwrite v1.9.5

22 Jul, 2026, 12:58

hey can you try using the attribute creation methods instead of directly coupling with the tables

22 Jul, 2026, 12:59

You mean use createTextColumn for example?

22 Jul, 2026, 13:01

yes

22 Jul, 2026, 13:04

Yes, that works without problem, it seems there is a bug in createTable

1
10 Aug, 2026, 12:47

Hey <@1356535431834898634> there is any fix for this or a workaround to work while it's fixed?

11 Aug, 2026, 11:44

Hey, sorry for the late reply A fix is created but prolly not released yet. Will message here once done

Till then you can use the individual column creation methods or appwrite cli for this where you will be maintaining schema through the appwrite config json

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