💫

Connect to any API: DELETE request

The Data Library allows you to create API requests to any database or tool with an available REST API.

Here is how to create a DELETE request to delete data in the external data source from your app.

Example Database

Copy this Airtable as the database to delete data. We will follow Airtable's API documentation to set up the DELETE request below.

Airtable API documentation for DELETE request
Airtable API documentation for DELETE request

How to set up a DELETE request

  1. In Data Library, click + New Collection and select Custom API.
    1. If you're adding this request to an existing collection, skip to Step 3
    2. image
      To add a request to an existing collection created by the API Wizard, click on
      To add a request to an existing collection created by the API Wizard, click on Advanced view to enter Custom API mode.

  2. Enter the name of your collection and an optional description (we recommend putting the data source as the description, like Google Sheet).
  3. 💡

    A Collection is a group of API requests, usually for the same data source.

    image

  4. Edit the request name to help you identify it. Then change the request type to DELETE.
  5. image

  6. Input the DELETE request URL from the API of your choosing.
  7. In our example, we will take the DELETE request for a single record shown in the Airtable API documentation.

    image
    image

  8. Then, replace the single record ID at the end of the URL with ${id}. This will allow the request to delete whichever record the user selects.
  9. image

  10. The API documentation will specify the Headers you also need to enter the DELETE request. In our example, we'll show what Airtable requires.
  11. For Header: H "Authorization: Bearer YOUR_API_KEY"

    image
    Airtable DELETE request: Header input. (Remember to replace with your actual API key)
    Airtable DELETE request: Header input. (Remember to replace with your actual API key)

  12. For Parameters: we will input the data record id from the GET request, so that the DELETE request links itself to the remote data retrieved from the GET request.
  13. Key: id

    Value: data record ID from the GET request

    image
    Locate the data record ID in the GET request. Select it in "Received Data" if you haven't. Make sure the "Label" is changed to
    Locate the data record ID in the GET request. Select it in "Received Data" if you haven't. Make sure the "Label" is changed to id so it matches the DELETE request URL + Parameters.

  14. Press Send. You have successfully set up the DELETE request if:
    1. You receive a response list under Received Data.
    2. image

    3. The first record in your data source is deleted.
    4. image

      💡

      If you encounter any error message after clicking Send, screenshot it and post in the Bravo community or message us via the ? widget (for Olé and Bravissimo users).