๐Ÿ“ฆ directus / v6-archive

๐Ÿ“„ delete-column.md ยท 62 lines
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# Delete Column

> **Note:** Table names are case-sensitive

<span class="request">`DELETE` **/api/1.1/tables/_[table-name]_/columns/_[column-name]_**</span>

<span class="description">Deletes a column from the specified table</span>

<span class="arguments">Name</span> | Value | Description
------------------ | ----- | -----------
**table-name** _String_             | <span class="required">Required</span>    | The name of the table that contains the column to delete
**column-name** _String_            | <span class="required">Required</span>    | The name of the column you wish to delete

### Example Request

```bash
$ curl -X DELETE  https://instance--key.directus.io/api/1.1/tables/projects/columns/intro \
        -u [user-token]:
```

```php
$client->deleteColumn('projects', 'intro');
```

```javascript
client.deleteColumn('projects', 'intro');
```

## Response

<span class="attributes">Attribute</span> | Description
--------|------------
**success** _Boolean_ | Whether or not the bookmark was deleted
**error** _Error Object_ | Contains error information for failures <a class="object">**Error Object**: View Nested Attributes</a>

### Example Response (Success)

```json
{
  "meta": {
    "table": "projects",
    "column": "intro"
  },
  "success": true
}
```

### Example Response (Failure)

```
{
  "meta": {
    "table": "projects",
    "column": "intro"
  },
  "success": false,
  "error": {
    "message": "column `intro` does not exists in table: `projects`"
  }
}
```