Can I create a custom API endpoint

I want to create an API end point to delete records based on a user_id (or any field other than the records’ id). In other words, the equivalent of SQL DELETE FROM {table} WHERE user_id = {x}.
Airtable’s built-in API only allows to delete records based on their ID, not on any other field.
Is this possible?

One way to do this is to use our service, Sync Inc, to quickly query for all the records:

SELECT id FROM {table} WHERE user_id = {X}

Then, use our proxy to delete the specific records.

This will be a two step process either way - but at least its easier with SQL :slight_smile:

1 Like

Welcome to the Airtable community!

You can create an automation that is triggered by a webhook. Send the user id (or record id or other identifying info) in the post body. Then run a scripting action that deletes the record. If you want to delete records based on something other than the record id, you can have the script identify the record based on whatever field you like.

2 Likes

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.