We use cookies to improve our service. Learn more.

Reference / Data Sources

Glide Tables API

Explore what you can do with the Glide Tables API

The Glide Tables API is available to anyone with the Pro, Business, or Enterprise plan. Connecting to your Glide Tables via the API allows you to automate your data management and integrate it with your own applications.

What you can do with Glide Tables API

The API gives you the ability to:

  • Add rows to tables
  • Set columns in rows
  • Delete rows

If you have the Business or Enterprise plan, you also have access to get all rows.

How to access Glide Tables API

After connecting to your data source, you can take the following steps to show the API calls.

  1. In your project, go to the Data Editor.
  2. Find the table you want to manage using the API.
  3. Right-click on the table and select Show API.
Opening the API instructions for your table
Opening the API instructions for your table

The API Instructions screen displays the calls to use to take the available actions.

Available API calls for tables
Available API calls for tables

How to use the API calls

If you’re already experienced with using APIs, explore the sections below for specific details about each call.

New to APIs? If you want a step-by-step guide for setting up an API automation tool and using each call, see Glide Tables API for Beginners.

Mutations

The mutateTables call in each Glide curl statement adds one or more mutation operations for tables in an app in Glide’s queue. After they’re added to the queue, they can be processed anytime after the call returns the actions.

This call takes a JSON body of the following form:

1 {
2     "appID": "APP-ID",
3     "mutations": [MUTATION, ...]
4 }

At least one mutation must be given. Although there is no definite or enforced upper bound on the number of mutations, it is recommended to keep them below 100.

The call will succeed if all mutations succeed. It will fail if even one mutation fails. It will return a JSON response that’s an array of results - one for each mutation. If a mutation fails, then its result has a property error which is an error message.

Keep in mind…

  • Actions that are enqueued are not guaranteed to succeed. For example, an action to delete a row that does not exist might successfully be queued. However, it will not be processed successfully since there is nothing to delete against.
  • Actions are not guaranteed to be processed in sequence. For example, two added rows will not necessarily be added in the order they are given in the mutations array.

Mutations available in the Glide Tables API include add-row-to-table, set-columns-in-row, and delete-row.

Add rows

The add-row-to-table mutation adds one row to your table.

1 {
2     "kind": "add-row-to-table",
3     "tableName": "TABLE-NAME",
4     "columnValues": {
5         "COLUMN-NAME": "COLUMN-VALUE",
6         ...
7     }
8 }

If the table has a Row ID column and the call is successful, the result will have a property rowID with the row ID of the row to be added.

Not all columns have to be specified. Columns that are not set will remain empty or unchanged.

Set columns

The set-columns-in-row mutation sets one or more columns in an existing row in your table.

1 {
2     "kind": "set-columns-in-row",
3     "tableName": "TABLE-NAME",
4     "columnValues": {
5         "COLUMN-NAME": "COLUMN-VALUE",
6         ...
7     },
8 
9     ROW-ID-OR-INDEX
10 }

The ROW-ID-OR-INDEX is one of the following:

  • "rowID": "ROW-ID"
  • "rowIndex": ROW-INDEX"

ROW-INDEX should only be used for Google Sheet tables. It must be a number, and it’s zero-based, i.e. the first row in the sheet has index 0.

Delete rows

The delete-row mutation deletes an existing row from your table.

1. {
2.     "kind": "delete-row",
3.     "tableName": "TABLE-NAME",
4.     ROW-ID-OR-INDEX
5. }

ROW-ID-OR-INDEX is interpreted identically to set-columns-in-row.

Queries

If you have a Business or Enterprise plan, you will also have access to a call that allows you to query your tables. This option is not available to Glide users with the Pro plan.

The queryTables call takes a list of table names and returns all the rows in those tables.

It takes a JSON body of the following form:

1. {
2.     "appID": "jD5sfkQujM9ywabItn0l",
3.     "queries": [QUERY, ...]
5. }

Each query looks like this:

1. {
2.     "tableName": "TABLE-NAME"
5. }

The call returns an array with one element for each query. Each element has all the rows for the table queried.

Learn Glide Tables API

Want to see the API in action? Explore the resources below.

Updated 2 weeks ago
Previous
Excel
Was this helpful?