1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122# Create Table
> **Note:** Table names are case-sensitive
<span class="request">`POST` **/api/1.1/tables**</span>
<span class="description">Creates a new table within the database. Table names must be unique within each database and are limited to letters, numbers, and `-` or `_`. After creating a new table you must assign permissions to at least one Directus user group</span>
<span class="arguments">Name</span> | Value | Description
------------------ | ---------------------------------------- | -------------------
**name** _String_ | <span class="required">Required</span> | The unique name of the table to create
### Example Request
```bash
$ curl -d "name=projects" https://instance--key.directus.io/api/1.1/tables \
-u [user-token]:
```
```php
$table = $client->createTable('projects');
```
```javascript
client.createTable('projects');
```
## Response
<span class="attributes">Attribute</span> | Description
-------|------------
**meta** _Meta Object_ | The Directus system metadata object that provides useful information not contained within the dataset itself [**Meta Object**: View Nested Attributes](/overview/objects-model.md#meta-object)
<span class="custom">**data**</span> _Table Object Collection_ | <span class="custom">This data and its architecture is based on Directus table schema</span> [**Table Object**: View Nested Attributes](/overview/objects-model.md#table-object)
### Example Response
```json
{
"meta": {
"type": "item",
"table": "directus_tables"
},
"data": {
"id": "projects",
"name": "projects",
"table_name": "projects",
"columns": [
{
"id": "id",
"name": "id",
"column_name": "id",
"type": "INT",
"length": null,
"precision": 10,
"scale": 0,
"sort": 1,
"default_value": null,
"nullable": null,
"column_key": null,
"extra_options": [],
"options": [],
"table_name": "projects",
"required": false,
"ui": "numeric",
"hidden_list": false,
"hidden_input": false,
"relationship": null,
"comment": ""
},
{
"id": "active",
"name": "active",
"column_name": "active",
"type": "INT",
"length": null,
"precision": 10,
"scale": 0,
"sort": 2,
"default_value": "2",
"nullable": null,
"column_key": null,
"extra_options": [],
"options": [],
"table_name": "projects",
"required": false,
"ui": "numeric",
"hidden_list": false,
"hidden_input": false,
"relationship": null,
"comment": ""
}
],
"primary_column": null,
"schema": "your_database",
"hidden": false,
"single": false,
"default_status": null,
"user_create_column": null,
"user_update_column": null,
"date_create_column": null,
"date_update_column": null,
"created_at": "2016-11-26 11:15:17",
"date_created": null,
"comment": "",
"row_count": 0,
"footer": false,
"list_view": null,
"column_groupings": null,
"filter_column_blacklist": null,
"preferences": {
"user": 1,
"columns_visible": "",
"table_name": "projects",
"title": null,
"sort": "id",
"sort_order": "ASC",
"status": "1,2"
}
}
}
```