Skip to main content
All CollectionsData sources
Glide Tables API: A Non-Developer Guide
Glide Tables API: A Non-Developer Guide

Use Full API Capabilities for Business and Enterprise Plans

Updated over 6 months ago

Glide API extends the capabilities of Glide Tables, allowing you to automate data management tasks and integrate with your own applications. With Glide API you can manipulate Glide tables from outside the Glide builder. By contrast, Call API is used to make changes from within Glide. This guide delves into how you can use the API for various operations such as adding rows, setting column values, deleting rows, and performing complex SQL queries.

Mutations

Perform actions like adding, modifying, or deleting data in your Glide tables.

You send a request containing a JSON body specifying the type of mutation (e.g., add-row, set-columns, delete-row) and the necessary details like table name and values. JSON (JavaScript Object Notation) is the most common way to store and work with data through APIs, and it’s structure in key-value pairs.

Example:

{
"appID": "APP-ID",
"mutations": [
{
"kind": "add-row-to-table",
"tableName": "YourTableName",
"columnValues": {
"columnName": "Value"
}
}
]
}
  • appID: This is your Glide application's unique identifier, which tells the API which app the request is for. You can find this in the app URL.

  • mutations: an array containing details of one or more operations you wish to perform on your data. Each object within the mutations array specifies a distinct action to be taken, such as adding a row, updating column values, or deleting a row.

  • kind: This field specifies the type of operation you want to perform on the table. It determines the action that the API will execute.
    Values for kind are:

    • add-row-to-table: This command adds a new row to the specified table.

    • set-columns-in-row: This updates one or more column values in an existing row.

    • delete-row: This removes a row from the table.

  • tableName: This is the name of the table in your Glide app where the mutation will be applied. It directs the API to the specific table that you want to modify.

  • columnValues: This is used with the add-row-to-table and set-columns-in-row mutations. It is a JSON object where each key represents a column name in the specified table, and each value represents the new data you want to enter or update in that column. This parameter lets you specify what data should be added or changed in the table.

Once added to Glide's queue, the mutations are processed asynchronously. The request returns immediately, and the actions are completed in the background.

Get Rows

Retrieve rows from a specified table.

Get Rows is only available on Business and Enterprise plans

  1. In Glide, click "Data" to open the Data Editor of your app.

  2. Find the table you want to access and either click on "Show API" at the bottom right corner of the table or right-click on the table and select "Show API."

  3. Copy the API Key (shown as “Copy secret token”). This key is unique and acts like a password to access your table's API, so keep it safe and do not share it.

  4. Copy the Endpoint URL provided in the API details. This URL is where you will send your API requests to retrieve rows. The URL should look like this:

    https://api.glideapp.io/api/function/queryTables

  5. Prepare the JSON Data for the request. Here is a simple example:

    {
    "appID": "YourAppID",
    "queries": [
    {
    "tableName": "YourTableName",
    "options": {
    "limit": 10 // Optional: Define how many rows to fetch
    }
    }
    ]
    }

    • appID: Replace "YourAppID" with the actual ID of your app. Your app ID will populate automatically if you copy the code from the Glide API modal.

    • tableName: Replace "YourTableName" with the actual name of the table from which you are retrieving rows. Your table name will populate automatically if you copy the code from the Glide API modal.

    • Options: This field is optional and allows you to specify additional parameters like how many rows to retrieve (limit), or other filtering and sorting options.

  6. Configure your API tool or command line to use the POST method, set the appropriate headers for authorization (using your API key) and content type (application/json), and include the JSON data payload.

  7. Send the API Request using the endpoint URL. Make sure that you modify the URL with the actual appID and tableName as needed.

If successful, the API returns the requested rows. The response will include a JSON array containing the row data, which you can then use as needed in your application. If there are more rows than the limit specified or the API can handle in a single response, the response might include a continuation token to fetch the next set of rows.

Add Rows

Add a new row to a specified table.

  1. In Glide, click "Data" to open the Data Editor of your app."

  2. Find the table you want to work with and either click on "Show API" at the bottom right corner of the table or right-click on the table and select "Show API."

  3. Copy the API Key (this is shown as “Copy secret token”.) This key is unique and acts like a password to access your table's API, so keep it safe and do not share it.

  4. Copy the Endpoint URL provided in the API details. This URL is where you will send your API requests. The URL should look like this:
    https://api.glideapp.io/api/function/mutateTables

  5. Create a JSON object that describes the row you want to add. Here is a simple example:

    {
    "kind": "add-row-to-table",
    "tableName": "YourTableName",
    "columnValues": {
    "ColumnName1": "Value1",
    "ColumnName2": "Value2"
    }
    }
  • Kind: This is always "add-row-to-table" for adding a new row.

  • TableName: Replace "YourTableName" with the name of the table you are adding rows to.

  • ColumnValues: This is where you put the column names and the values you want to add. Replace "ColumnName1", "ColumnName2" with your actual column names and "Value1", "Value2" with the data you want to insert.


If successful, the API returns the ID of the newly added row, allowing you to reference or modify it later if needed.

Edit Rows

Modify existing rows by setting new values for one or more columns.

  1. In Glide, click "Data" to open the Data Editor of your app."

  2. Find the table you want to work with and either click on "Show API" at the bottom right corner of the table or right-click on the table and select "Show API."

  3. Copy the API Key (this is shown as “Copy secret token”.) This key is unique and acts like a password to access your table's API, so keep it safe and do not share it.

  4. Copy the Endpoint URL provided in the API details. This URL is where you will send your API requests. The URL should look like this:
    https://api.glideapp.io/api/function/mutateTables

  5. Prepare the JSON Data for the Request. Here is a simple example:

    { 
    "kind": "set-columns-in-row",
    "tableName": "YourTableName",
    "columnValues": {
    "ColumnName1": "NewValue1",
    "ColumnName2": "NewValue2"
    },
    "rowID": "SpecificRowID"
    }

    • Kind: Always set to "set-columns-in-row" for updating existing rows.

    • TableName: Replace "YourTableName" with the actual name of the table where the row exists.

    • ColumnValues: Include the column names that you wish to update and their new values. Replace "ColumnName1", "ColumnName2" with your actual column names and "NewValue1", "NewValue2" with the new data you want to insert.

    • RowID: Specify the ID of the row that you want to update. This ensures that the correct row is modified.

  6. Configure your API tool or command line to use the POST method, set the appropriate headers for authorization (using your API key) and content type (application/json), and include the JSON data payload.

  7. Use the endpoint URL modified with the actual tableId and rowId.

Delete Rows

Remove existing rows from a specified table.

  1. In Glide, click "Data" to open the Data Editor of your app."

  2. Find the table you want to work with and either click on "Show API" at the bottom right corner of the table or right-click on the table icon and select "Show API."

  3. Copy the API Key (shown as “Copy secret token”). This key is unique and acts like a password to access your table's API, so keep it safe and do not share it.

  4. Copy the Endpoint URL provided in the API details. This URL is where you will send your API requests to delete rows. The URL should look like this:
    https://api.glideapp.io/api/function/mutateTables

  5. Prepare the JSON Data for the Request. Here is a simple example:

    {
    "kind": "delete-row",
    "tableName": "YourTableName",
    "rowID": "SpecificRowID"
    }

    • Kind: Always set to "delete-row" when deleting existing rows.

    • TableName: Replace "YourTableName" with the actual name of the table from which you are removing rows.

    • RowID: Specify the ID of the row that you want to delete. This ensures that the correct row is targeted for deletion.

  6. Configure your API tool or command line to use the POST method, set the appropriate headers for authorization (using your API key) and content type (application/json), and include the JSON data payload.

  7. Use the endpoint URL modified with the actual tableId and rowId.

If successful, the API does not typically return the details of the deleted row but will confirm the deletion was processed.

Querying with SQL in Big Tables:

If you have a Business or Enterprise plan, you gain the ability to query Big Tables using SQL.

Perform filtered queries to retrieve specific data sets based on complex conditions.

  • The API supports a simplified version of SQL to ensure security and performance. For instance, you can only select entire tables (SELECT *), apply filters, and use LIMIT to control data volume.

  • To query data, structure your SQL query as a JSON object within the API request. For example, to retrieve data from a specific table where a column meets a particular value, you would use:

{
"sql": "SELECT * FROM 'TableName' WHERE 'Column' = $1 LIMIT 1000",
"params": ["Value"]
}
  • The API may return a continuation token for large datasets to retrieve additional data in subsequent requests.

Further Learning about APIs

Troubleshooting Common Issues with the Glide API

What should I do if my API call is not working?

If your API call is returning errors, make sure to check the spelling and case sensitivity of your parameters. A common issue is incorrect capitalization, such as using rowId instead of rowID. Ensuring that you use the exact field names as expected by the API can resolve many issues.

My API call is successful, but the changes aren't reflected. What's wrong?

If your API request returns a successful status code but the expected changes aren't visible:
Propagation Delay: There might be a slight delay in data propagation. Give it a moment and check again.
Caching: If you're using a frontend that caches data, ensure that the cache is refreshed or invalidated after making the API call.

How do I troubleshoot data not updating correctly after an API call?

Verify Payload: Recheck the payload of your request to make sure the data fields and values are correct.
Check API Response: Look at the API response to ensure it doesn't contain any errors or messages indicating why the data might not update.
Permissions: Ensure that your API key has the necessary permissions to perform data update operations.

Check the workflow: If you are trying to run an API call and an action at the same time, they will not process simultaneously in Glide's backend. The API call may process faster than the action, causing the workflow to fail silently.

Did this answer your question?