Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Can I create a custom API endpoint

Topic Labels: API
517 2
cancel
Showing results for 
Search instead for 
Did you mean: 

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

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.