Asana: Create a table
Asana tables.createTable: arguments, response, policy and SDK examples.
← Tables operations · Get started
Operation asana.createtable
Provider route: POST /tables. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/asana with npm, or alter-sdk-asana with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { AsanaIntegration } from "@alter-ai/asana";
async function execute(input: Parameters<AsanaIntegration["tables"]["createTable"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new AsanaIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.tables.createTable(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_asana import AsanaIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = AsanaIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.tables.create_table(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | Model | Optional | Expand Get a table — request body — query |
body | object | Required within parent | |
body.data | Model | Required within parent | Expand Create a table — request body — body data |
Referenced models: Create a table — request body — body data, Get a table — request body — query
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | object | All variants apply | |
$ (allOf 1).data | Model | Optional | Expand Get a table — response body — data data — Table Response |
$ (allOf 2) | Model | All variants apply | Expand Get a table — response body — data |
Referenced models: Get a table — response body — data data — Table Response, Get a table — response body — data
Schemas
Section titled “Schemas”7 more schemas are linked from the tables above, on the schema pages.
Get a table — response body — data data — Table Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get tables in a workspace — response body — data, next page data item |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).modified_at | string | Optional | The time at which this table was last modified. Format: date-time Read only: true |
$ (allOf 2).created_at | string | Optional | The time at which this resource was created. Format: date-time Read only: true |
$ (allOf 2).workspace | JSON | Optional | |
$ (allOf 2).workspace (allOf 1) | Model | All variants apply | Expand Update a workspace — request body — body data |
$ (allOf 2).workspace (allOf 2) | object | All variants apply | *Create-only*. The workspace or organization this table is associated with. Once created, tables cannot be moved to a different workspace. This attribute can only be specified at creation time. Read only: true |
$ (allOf 2).custom_field_settings | array | Optional | Array of custom field definitions that are enabled for the table. These represent which custom fields are available to records in the table, but do not include any values. Read only: true |
$ (allOf 2).custom_field_settings[] | Model | Each item | Expand Add a custom field to a table — response body — data data — Custom Field Table Setting Response |
$ (allOf 2).default_access_level | string | Optional | The default access level for users who join or are added as members of the table. Known values: admin, editor, commenter, viewer |
Referenced models: Add a custom field to a table — response body — data data — Custom Field Table Setting Response, Get tables in a workspace — response body — data, next page data item, Update a workspace — request body — body data
Get a table — response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Get a table — response body — data data — sdk__Table Response |
Referenced models: Get a table — response body — data data — sdk__Table Response
Create a table — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get tables in a workspace — response body — data, next page data item |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).workspace | string | Required within parent | *Create-only*. The workspace or organization in which this table will be created. Once created, tables cannot be moved to a different workspace. |
Referenced models: Get tables in a workspace — response body — data, next page data item
Get a table — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
opt_pretty | boolean | Optional | |
opt_fields | array | Optional | |
opt_fields[] | string | Each item | One of: created_at, custom_field_settings, custom_field_settings.custom_field, custom_field_settings.custom_field.date_value, custom_field_settings.custom_field.date_value.date, custom_field_settings.custom_field.date_value.date_time, custom_field_settings.custom_field.display_value, custom_field_settings.custom_field.enabled, custom_field_settings.custom_field.enum_options, custom_field_settings.custom_field.enum_options.color, custom_field_settings.custom_field.enum_options.enabled, custom_field_settings.custom_field.enum_options.name, custom_field_settings.custom_field.enum_value, custom_field_settings.custom_field.enum_value.color, custom_field_settings.custom_field.enum_value.enabled, custom_field_settings.custom_field.enum_value.name, custom_field_settings.custom_field.id_prefix, custom_field_settings.custom_field.input_restrictions, custom_field_settings.custom_field.is_formula_field, custom_field_settings.custom_field.is_lookup_field, custom_field_settings.custom_field.multi_enum_values, custom_field_settings.custom_field.multi_enum_values.color, custom_field_settings.custom_field.multi_enum_values.enabled, custom_field_settings.custom_field.multi_enum_values.name, custom_field_settings.custom_field.name, custom_field_settings.custom_field.number_value, custom_field_settings.custom_field.representation_type, custom_field_settings.custom_field.text_value, custom_field_settings.custom_field.type, custom_field_settings.is_important, default_access_level, modified_at, name, workspace, workspace.name |
Add a custom field to a table — response body — data data — Custom Field Table Setting Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Add a custom field to a table — response body — data data gid, resource type |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).custom_field | JSON | Optional | |
$ (allOf 2).custom_field (allOf 1) | Model | All variants apply | Expand Get a membership — response body — data / data / access_level: admin, editor, user parent |
$ (allOf 2).custom_field (allOf 2) | object | All variants apply | The custom field that is applied to the table. Read only: true |
$ (allOf 2).is_important | boolean | Optional | `is_important` is used in the Asana web application to determine if this custom field is displayed in the list/grid view of a table. Read only: true |
Referenced models: Add a custom field to a table — response body — data data gid, resource type, Get a membership — response body — data / data / access_level: admin, editor, user parent
Get tables in a workspace — response body — data, next page data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *table* is a container for structured records (rows), with columns defined by custom field settings. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the table. |
Update a workspace — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *workspace* is the highest-level organizational unit in Asana. All projects and tasks have an associated workspace. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the workspace. |
Get a table — response body — data data — sdk__Table Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A generic Asana Resource, containing a globally unique identifier.A generic Asana Resource, containing a globally unique identifier. A *table* is a container for structured records (rows), with columns defined by custom field settings. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the table. |
modified_at | string | Optional | The time at which this table was last modified. Format: date-time Read only: true |
created_at | string | Optional | The time at which this resource was created. Format: date-time Read only: true |
workspace | Model | Optional | Expand Get a table — response body — data data workspace |
custom_field_settings | array | Optional | Array of custom field definitions that are enabled for the table. These represent which custom fields are available to records in the table, but do not include any values. Read only: true |
custom_field_settings[] | Model | Each item | Expand Get a table — response body — data data custom field settings item |
default_access_level | string | Optional | The default access level for users who join or are added as members of the table. Known values: admin, editor, commenter, viewer |
Referenced models: Get a table — response body — data data custom field settings item, Get a table — response body — data data workspace
Add a custom field to a table — response body — data data gid, resource type
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *custom field table setting* represents the many-to-many join of a custom field and a table, storing information relevant to that particular pairing. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
Get a custom field — response body — data data date value date, date time
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | *Conditional*. Only relevant for custom fields of type `date`. This object reflects the chosen date (and optionally, time) value of a `date` custom field. If no date is selected, the value of `date_value` will be `null`. |
date | string | Optional | A string representing the date in YYYY-MM-DD format. |
date_time | string | Optional | A string representing the date in ISO 8601 format. If no time value is selected, the value of `date-time` will be `null`. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.createtable. Catalog operation: asana:createTable. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["tables:write"]