> ## Documentation Index
> Fetch the complete documentation index at: https://docs.macro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AddColumn

> Add a column to a table in one of the user's databases. Type it by what its values are, not by how they were typed at you:  - a person (host, owner, assignee, attendee, author): a person column, `entity` then `USER` as below; - a Macro document, task, company, call, channel or project: `entity` with that kind; - a row of another table in this database: a relation, `entity` with `linkToTableId`; - a status, stage or category ("Going / Maybe / Declined"): `select`, with `isMultiSelect` or `tag` for several; - money, counts and scores ("$1,200"): `number`; dates ("Aug 13"): `date`; yes/no: `boolean`; URLs: `link`; - free text only: `text`. Never text for people or Macro items.  `AddColumn` takes `specificEntityType` for an entity column (`USER` for a person column). A relation holds row ids of the target table and is written as a list of them. Select and tag columns accept only the labels in `options`, so list every value the data has; add more later with AddColumnOptions.  Requires edit access. The response is the database's schema after the change, with the new column's exact `sqlName`. If `database` is null, the column was still created: call DescribeDatabase with databaseId before continuing, and do not repeat AddColumn.

# AddColumn

Add a column to a table in one of the user's databases. Type it by what its values are, not by how they were typed at you:

* a person (host, owner, assignee, attendee, author): a person column, `entity` then `USER` as below;
* a Macro document, task, company, call, channel or project: `entity` with that kind;
* a row of another table in this database: a relation, `entity` with `linkToTableId`;
* a status, stage or category ("Going / Maybe / Declined"): `select`, with `isMultiSelect` or `tag` for several;
* money, counts and scores ("\$1,200"): `number`; dates ("Aug 13"): `date`; yes/no: `boolean`; URLs: `link`;
* free text only: `text`. Never text for people or Macro items.

`AddColumn` takes `specificEntityType` for an entity column (`USER` for a person column). A relation holds row ids of the target table and is written as a list of them. Select and tag columns accept only the labels in `options`, so list every value the data has; add more later with AddColumnOptions.

Requires edit access. The response is the database's schema after the change, with the new column's exact `sqlName`. If `database` is null, the column was still created: call DescribeDatabase with databaseId before continuing, and do not repeat AddColumn.

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `databaseId` | string | Yes | Id of the database the table belongs to, from ListDatabases. |
| `tableId` | string | Yes | Id of the table to add the column to, from DescribeDatabase or CreateTable. It must belong to databaseId. |
| `name` | string | Yes | Display name of the column, as the user would head it — e.g. "Dietary Needs". SQL refers to it by this name, quoted. |
| `dataType` | `"text"` \| `"number"` \| `"boolean"` \| `"date"` \| `"link"` \| `"select"` \| `"select_number"` \| `"tag"` \| `"entity"` | Yes | The value type of a column, as the model names it.  A deliberate mirror of \[`DataType`] rather than a re-export: the property system's names are internal, and the tool vocabulary has to stay stable independently of them. |
| `isMultiSelect` | boolean | No | True if a cell can hold several values at once. Defaults to false. Multi-valued cells are written as lists in SQL; test membership with `col HAS 'x'`. |
| `options` | string\[] | No | For a select, select\_number, or tag column, the allowed labels — e.g. \["Going", "Maybe", "Declined"]. SQL writes and reads these labels verbatim, and anything else is rejected by the statement, so list every value the data actually has. A select\_number column's labels must be numbers. Omit for other column types; add more later with AddColumnOptions. |
| `specificEntityType` | `"USER"` \| `"DOCUMENT"` \| `"TASK"` \| `"COMPANY"` \| `"CALL_RECORD"` \| `"CHANNEL"` \| `"CHAT"` \| `"PROJECT"` \| `"THREAD"` \| `"CALENDAR_EVENT"` \| `"INITIATIVE"` | No | Required for dataType entity without linkToTableId, and refused otherwise: what the ids reference, e.g. USER for a person column or DOCUMENT. |
| `linkToTableId` | string | No | Id of another table of this database, making this a relation whose cells hold that table's row ids. Omit for any other column. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.