Can I create a custom API endpoint

Topic Labels: API
2660 2
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

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?

2 Replies 2
7 - App Architect
7 - App Architect

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 :slightly_smiling_face:

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.