Coda API (0.1.1-beta)

Introduction

The Coda API is a RESTful API that lets you programmatically interact with Coda docs:

  • List and search Coda docs
  • Create new docs and copy existing ones
  • Discover sections, folders, tables, formulas, and controls
  • Read, insert, upsert, update, and delete rows

Note: the Coda API is in beta. As we update and release newer versions of the API, we reserve the right to remove older APIs and functionality with a 4-week deprecation notice.

Beta Overview

We wanted to give our users and community a way to leverage the best of what Coda has to offer with existing data and third-party data sources. To that end, we started out by partnering with Zapier to offer easy integration with over 1000 apps.

If you are looking to go beyond that, we offer this API, which allows you to get data in and out of tables in Coda. The API also lets you read computed values from formulas and user-selected values from controls.

While it is in beta, your feedback is especially important, and will be used to help shape the fully-launched version of the API. Whether you have a question, a suggestion on how we can improve it, or even want to share something cool you've built, please drop us a note at help+api@coda.io.

Getting Started

Our Getting Started Guide helps you learn the basic of working with the API and shows a few ways you can use it. Check it out, and learn how to:

  • Read data from Coda tables and write back to them
  • Build a one-way sync from one Coda doc to another
  • Automate reminders
  • Sync your Google Calendar to Coda

Using the API

Coda's REST API is designed to be straightforward to use. You can use the language and platform of your choice to make requests. To get a feel for the API, you can also use a tool like Postman or Insomnia.

API Endpoint

This API uses a base path of https://coda.io/apis/v1beta1.

Rate Limiting

The Coda API sets a reasonable limit on the number of requests that can be made per minute. Once this limit is reached, calls to the API will start returning errors with an HTTP status code of 429. If you find yourself hitting rate limits and would like your individual rate to be raised, please contact us at help+api@coda.io.

Consistency

While edits made in Coda are shared with other collaborators in real-time, it can take a few seconds for them to become available via the API. You may also notice that changes made via the API, such as updating a row, are not immediate. These endpoints all return an HTTP 202 status code, instead of a standard 200, indicating that the edit has been accepted and queued for processing. This generally takes a few seconds, and the edit may fail if invalid. In the future, we may provide a way to acknowledge edits.

Volatile Formulas

Coda exposes a number of "volatile" formulas, as as Today(), Now(), and User(). When used in a live Coda doc, these formulas affect what's visible in realtime, tailored to the current user.

Such formulas behave differently with the API. Time-based values may only be current to the last edit made to the doc. User-based values may be blank or invalid.

Examples

To help you get started, this documentation provides code examples in Python, Unix shell, and Google Apps Script. These examples are based on a simple doc that looks something like this:

Python examples

These examples use Python 3.6+. If you don't already have the requests module, use pip or easy_install to get it.

Shell examples

The shell examples are intended to be run in a Unix shell. If you're on Windows, you will need to install WSL.

These examples use the standard cURL utility to pull from the API, and then process it with jq to extract and format example output. If you don't already have it, you can either install it or run the command without it to see the raw JSON output.

Google Apps Script examples

Google Apps Script makes it easy to write code in a JavaScript-like syntax and easily access many Google products with built-in libraries. You can set up your scripts to run periodically, which makes it a good environment for writing tools without maintaining your own server.

Coda provides a library for Google Apps Script. To use it, go into Resources -> Libraries... and enter the following library ID: 15IQuWOk8MqT50FDWomh57UqWGH23gjsWVWYFms3ton6L-UHmefYHS9Vl. If you want to see the library's source code, it's available here.

Google provides autocomplete for API functions as well as generated docs. You can access these docs via the Libraries dialog by clicking on the library name. Required parameters that would be included in the URL path are positional arguments in each of these functions, followed by the request body, if applicable. All remaining parameters can be specified in the options object.

OpenAPI/Swagger Spec

In an effort to standardize our API and make it accessible, we offer an OpenAPI 3.0 specification:

Swagger 2.0

We also offer a downgraded Swagger 2.0 version of our specification. This may be useful for a number of tools that haven't yet been adapted to OpenAPI 3.0. Here are the links:

Postman collection

To get started with prototyping the API quickly in Postman, you can use one of links above to import the Coda API into a collection. You'll then need to set the appropriate header and environment variables.

Client libraries

We do not currently support client libraries apart from Google Apps Script. To work with the Coda API, you can either use standard network libraries for your language, or use the appropriate Swagger Generator tool to auto-generate Coda API client libraries for your language of choice. We do not provide any guarantees that these autogenerated libraries are compatible with our API (e.g., some libraries may not work with Bearer authentication).

OpenAPI 3.0

Swagger Generator 3 (that link takes you to the docs for the generator API) can generate client libraries for these languages. It's relatively new and thus only has support for a limited set of languages at this time.

Swagger 2.0

Swagger Generator takes in a legacy Swagger 2.0 specification, but can generate client libraries for more languages. You can also use local CLI tools to generate these libraries.

Third-party client libraries

Some members of our amazing community have written libraries to work with our API. These aren't officially supported by Coda, but are listed here for convenience. (Please let us know if you've written a library and would like to have it included here.)

  • PHP by Daniel Stieber

Authentication

Bearer

The Coda API can be accessed using an API token, which can be obtained from My account in Coda. This token should be specified by setting a header as follows.

Authorization: Bearer <api_token>

Keep your token safe, as anyone who gets access to it can access your account.

If you're logged into Coda, you can also query the API directly using your browser.

Security scheme type: HTTP
HTTP Authorization Scheme bearer
Bearer format "UUID"

Docs

Coda docs are foundational, top-level collaborative projects that contain sections organized into folders. The API lets you list and search your docs to obtain basic metadata like titles and ownership information.

List available docs

get /docs
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs

Returns a list of Coda docs accessible by the user. These are returned in the same order as on the docs page: reverse chronological by the latest event relevant to the user (last viewed, edited, or shared).

Authorizations:
query Parameters
isOwner
boolean

Show only docs owned by the user.

query
string

Search term used to filter down results.

sourceDoc
string

Show only docs copied from the specified doc ID.

limit
integer
Example: 10

Maximum number of results to return in this query.

pageToken
string
Example: 20

An opaque token used to fetch the next page of results.

Responses

200

List of Coda docs matching the query.

401

The API token is invalid or has expired.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = 'https://coda.io/apis/v1beta1/docs'
params = {
  'isOwner': True,
  'query': 'New',
}
res = requests.get(uri, headers=headers, params=params).json()

print(f'First doc is: {res["items"][0]["name"]}')
# => First doc is: New Document

Response samples

application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "href": "https://coda.io/apis/v1beta1/docs?limit=20",
  • "nextPageToken": "20",
  • "nextPageLink": "https://coda.io/apis/v1beta1/docs?limit=20&pageToken=20"
}

Create a doc

post /docs
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs

Creates a new Coda doc, optionally copying an existing doc.

Authorizations:
Request Body schema: application/json
title
string

Title of the new doc. Defaults to 'Untitled'.

sourceDoc
string

An optional doc ID from which to create a copy.

Responses

201

Info about the created doc.

400

The request parameters did not conform to expectations.

401

The API token is invalid or has expired.

429

The client has sent too many requests.

Request samples

application/json
Copy
Expand all Collapse all
{
  • "title": "Project Tracker",
  • "sourceDoc": "iJKlm_noPq"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "AbCDeFGH",
  • "type": "doc",
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH",
  • "browserLink": "https://coda.io/d/_dAbCDeFGH",
  • "name": "Product Launch Hub",
  • "owner": "user@example.com",
  • "sourceDoc":
    {
    },
  • "createdAt": "2018-04-11T00:18:57.946Z",
  • "updatedAt": "2018-04-11T00:18:57.946Z"
}

Get info about a doc

get /docs/{docId}
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}

Returns metadata for the specified doc.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

Responses

200

Basic Coda doc metadata.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>'
res = requests.get(uri, headers=headers).json()

print(f'The name of the doc is {res["name"]}')
# => The name of the doc is New Document

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "AbCDeFGH",
  • "type": "doc",
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH",
  • "browserLink": "https://coda.io/d/_dAbCDeFGH",
  • "name": "Product Launch Hub",
  • "owner": "user@example.com",
  • "sourceDoc":
    {
    },
  • "createdAt": "2018-04-11T00:18:57.946Z",
  • "updatedAt": "2018-04-11T00:18:57.946Z"
}

Sections

Sections in Coda offer canvases containing rich text, tables, controls, and other objects. At this time, this API lets you list and access sections in a doc.

List sections

get /docs/{docId}/sections
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/sections

Returns a list of sections in a Coda doc.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

query Parameters
limit
integer
Example: 10

Maximum number of results to return in this query.

pageToken
string
Example: 20

An opaque token used to fetch the next page of results.

Responses

200

List of sections.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/sections'
res = requests.get(uri, headers=headers).json()

print(f'The name of the first section is {res["items"][0]["name"]}')
# => The name of the first section is Section 1

Response samples

application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/sections?limit=20",
  • "nextPageToken": "20",
  • "nextPageLink": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/sections?limit=20&pageToken=20"
}

Get a section

get /docs/{docId}/sections/{sectionIdOrName}
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/sections/{sectionIdOrName}

Returns details about a section.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

sectionIdOrName
required
string
Example: "canvas-IjkLmnO"

ID or name of the section. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

Responses

200

Info about a section.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

410

The resource has been deleted.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/sections/<section ID>'
res = requests.get(uri, headers=headers).json()

print(f'The name of this section is {res["name"]}')
# => The name of this section is Section 1

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "canvas-IjkLmnO",
  • "type": "section",
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/sections/canvas-IjkLmnO",
  • "name": "Launch Status",
  • "browserLink": "https://coda.io/d/_dAbCDeFGH/Launch-Status_sumnO",
  • "parent":
    {
    }
}

Folders

Folders provide a way to group sections in a Coda doc. This API lets you list all folders in a doc and the sections contained in each one.

List folders

get /docs/{docId}/folders
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/folders

Returns a list of folders in a Coda doc.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

query Parameters
limit
integer
Example: 10

Maximum number of results to return in this query.

pageToken
string
Example: 20

An opaque token used to fetch the next page of results.

Responses

200

List of folders.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/folders'
res = requests.get(uri, headers=headers).json()

print(f'The name of the first folder is {res["items"][0]["name"]}')
# => The name of the first folder is Personal

Response samples

application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/folders?limit=20",
  • "nextPageToken": "20",
  • "nextPageLink": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/folders?limit=20&pageToken=20"
}

Get a folder

get /docs/{docId}/folders/{folderIdOrName}
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/folders/{folderIdOrName}

Returns details about a folder.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

folderIdOrName
required
string
Example: "section-IjkLmnO"

ID or name of the folder. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

Responses

200

Info about a folder.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

410

The resource has been deleted.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/folders/<folder ID>'
res = requests.get(uri, headers=headers).json()

print(f'There are {len(res["children"])} sections in {res["name"]}')
# => There are 2 sections in Personal

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "section-IjkLmnO",
  • "type": "folder",
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/folders/section-IjkLmnO",
  • "name": "Company Info",
  • "children":
    [
    ]
}

Tables

If you're here, you know the power of tables in Coda. This API lets you list the tables in a Coda doc (views are currently not supported) and obtain basic schema information.

List tables

get /docs/{docId}/tables
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables

Returns a list of tables in a Coda doc.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

query Parameters
limit
integer
Example: 10

Maximum number of results to return in this query.

pageToken
string
Example: 20

An opaque token used to fetch the next page of results.

Responses

200

List of tables in a doc.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/tables'
res = requests.get(uri, headers=headers).json()

print(f'The name of the first table is {res["items"][0]["name"]}')
# => The name of the first table is To-do List

Response samples

application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables?limit=20",
  • "nextPageToken": "20",
  • "nextPageLink": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables?limit=20&pageToken=20"
}

Get a table

get /docs/{docId}/tables/{tableIdOrName}
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}

Returns details about a specific table.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

tableIdOrName
required
string
Example: "grid-pqRst-U"

ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

Responses

200

Info about a table.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/tables/<table ID>'
res = requests.get(uri, headers=headers).json()

print(f'Table {res["name"]} has {res["rowCount"]} rows')
# => Table To-do List has 2 rows

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "grid-pqRst-U",
  • "type": "table",
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables/grid-pqRst-U",
  • "name": "Tasks",
  • "browserLink": "https://coda.io/d/_dAbCDeFGH/#Teams-and-Tasks_tpqRst-U",
  • "displayColumn":
    {
    },
  • "rowCount": 130,
  • "sorts":
    [
    ],
  • "layout": "default",
  • "createdAt": "2018-04-11T00:18:57.946Z",
  • "updatedAt": "2018-04-11T00:18:57.946Z"
}

Columns

While columns in Coda have user-friendly names, they also have immutable IDs that are used when reading and writing rows. These endpoints let you query the columns in a table and get basic information about them.

List columns

get /docs/{docId}/tables/{tableIdOrName}/columns
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}/columns

Returns a list of columns in a table.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

tableIdOrName
required
string
Example: "grid-pqRst-U"

ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

query Parameters
limit
integer
Example: 10

Maximum number of results to return in this query.

pageToken
string
Example: 20

An opaque token used to fetch the next page of results.

Responses

200

List of columns in the table.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/tables/<table ID>/columns'
res = requests.get(uri, headers=headers).json()

print(f'This table\'s columns: {", ".join(c["name"] for c in res["items"])}')
# => This table's columns: Task, Duration (hr), Duration (min)

Response samples

application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables/grid-pqRst-U/columns?limit=20",
  • "nextPageToken": "20",
  • "nextPageLink": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables/grid-pqRst-U/columns?limit=20&pageToken=20"
}

Get a column

get /docs/{docId}/tables/{tableIdOrName}/columns/{columnIdOrName}
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}/columns/{columnIdOrName}

Returns details about a column in a table.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

tableIdOrName
required
string
Example: "grid-pqRst-U"

ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

columnIdOrName
required
string
Example: "c-tuVwxYz"

ID or name of the column. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

Responses

200

Info about a column.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/tables/<table ID>/columns/<column ID>'
res = requests.get(uri, headers=headers).json()

is_default = res.get("display", False)
print(f'Column {res["name"]} {"is" if is_default else "is not"} the display column')
# => Column Task is the display column

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "c-tuVwxYz",
  • "type": "column",
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables/grid-pqRst-U/columns/c-tuVwxYz",
  • "name": "Completed",
  • "display": true,
  • "calculated": true,
  • "parent":
    {
    }
}

Rows

You'll likely use this part of the API the most. These endpoints let you retrieve row data from tables in Coda as well as create, upsert, update, and delete them.

List rows

get /docs/{docId}/tables/{tableIdOrName}/rows
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}/rows

Returns a list of rows in a table.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

tableIdOrName
required
string
Example: "grid-pqRst-U"

ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

query Parameters
query
string
Example: "c-tuVwxYz:\"Apple\""

Query used to filter returned rows, specified as <column_id_or_name>:<value>. If you'd like to use a column name instead of an ID, you must quote it (e.g., "My Column":123). Also note that value is a JSON value; if you'd like to use a string, you must surround it in quotes (e.g., "groceries").

useColumnNames
boolean
Example: true

Use column names instead of column IDs in the returned output. This is generally discouraged as it is fragile. If columns are renamed, code using original names may throw errors.

limit
integer
Example: 10

Maximum number of results to return in this query.

pageToken
string
Example: 20

An opaque token used to fetch the next page of results.

Responses

200

List of rows in the table.

400

The request parameters did not conform to expectations.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/tables/<table ID>/rows'
params = {
  'query': '<column ID>:"Work out"',
}
req = requests.get(uri, headers=headers, params=params)
req.raise_for_status() # Throw if there was an error.
res = req.json()

print(f'Matching rows: {len(res["items"])}')
# => Matching rows: 1

Response samples

application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables/grid-pqRst-U/rows?limit=20",
  • "nextPageToken": "20",
  • "nextPageLink": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables/grid-pqRst-U/rows?limit=20&pageToken=20"
}

Insert/upsert rows

post /docs/{docId}/tables/{tableIdOrName}/rows
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}/rows

Inserts rows into a table, optionally updating existing rows if any upsert key columns are provided. This endpoint will always return a 202, so long as the doc and table exist and are accessible (and the update is structurally valid). Row inserts/upserts are generally processed within several seconds. When upserting, if multiple rows match the specified key column(s), they will all be updated with the specified value.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

tableIdOrName
required
string
Example: "grid-pqRst-U"

ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

Request Body schema: application/json
rows
required
Array of object (RowEdit)
keyColumns
Array of string

Optional column IDs, URLs, or names (fragile and discouraged), specifying columns to be used as upsert keys.

Responses

202

A result indicating that the upsert was queued for processing.

400

The request parameters did not conform to expectations.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

application/json
Copy
Expand all Collapse all
{
  • "rows":
    [
    ],
  • "keyColumns":
    [
    ]
}

Response samples

application/json
Copy
Expand all Collapse all
{ }

Get a row

get /docs/{docId}/tables/{tableIdOrName}/rows/{rowIdOrName}
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}/rows/{rowIdOrName}

Returns details about a row in a table.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

tableIdOrName
required
string
Example: "grid-pqRst-U"

ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

rowIdOrName
required
string
Example: "i-tuVwxYz"

ID or name of the row. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If there are multiple rows with the same value in the identifying column, an arbitrary one will be selected.

query Parameters
useColumnNames
boolean
Example: true

Use column names instead of column IDs in the returned output. This is generally discouraged as it is fragile. If columns are renamed, code using original names may throw errors.

Responses

200

Info about a row. If this row was retrieved by name, only one matching row will be returned, with no guarantees as to which one it is.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

Copy
import requests

headers = {'Authorization': 'Bearer <your API token>'}
uri = f'https://coda.io/apis/v1beta1/docs/<doc ID>/tables/<table ID>/rows/<row ID>'
req = requests.get(uri, headers=headers)
req.raise_for_status() # Throw if there was an error.
res = req.json()

print(f'Row values are: {", ".join(str(v) for v in res["values"].values())}')
# => Row values are: Get groceries, 1, 60

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "i-tuVwxYz",
  • "type": "row",
  • "href": "https://coda.io/apis/v1beta1/docs/AbCDeFGH/tables/grid-pqRst-U/rows/i-RstUv-W",
  • "name": "Apple",
  • "index": 7,
  • "browserLink": "https://coda.io/d/_dAbCDeFGH#Teams-and-Tasks_tpqRst-U/_rui-tuVwxYz",
  • "createdAt": "2018-04-11T00:18:57.946Z",
  • "updatedAt": "2018-04-11T00:18:57.946Z",
  • "values":
    {
    },
  • "parent":
    {
    }
}

Update row

put /docs/{docId}/tables/{tableIdOrName}/rows/{rowIdOrName}
Coda API (v1beta1)
/https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}/rows/{rowIdOrName}

Updates the specified row in the table. This endpoint will always return a 202, so long as the row exists and is accessible (and the update is structurally valid). Row updates are generally processed within several seconds. When updating using a name as opposed to an ID, an arbitrary row will be affected.

Authorizations:
path Parameters
docId
required
string
Example: "AbCDeFGH"

ID of the doc.

tableIdOrName
required
string
Example: "grid-pqRst-U"

ID or name of the table. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it.

rowIdOrName
required
string
Example: "i-tuVwxYz"

ID or name of the row. Names are discouraged because they're easily prone to being changed by users. If you're using a name, be sure to URI-encode it. If there are multiple rows with the same value in the identifying column, an arbitrary one will be selected.

Request Body schema: application/json
row
required
object (RowEdit)

An edit made to a particular row.

Responses

202

A result indicating that the update was queued for processing.

400

The request parameters did not conform to expectations.

401

The API token is invalid or has expired.

404

The resource could not be located with the current API token.

429

The client has sent too many requests.

Request samples

application/json
Copy
Expand all Collapse all
{
  • "row":
    {
    }<