How to modify table rows in Notion page using API with column-based filtering?

I need help with using the Notion API to modify specific rows in a table that exists inside a Notion page. My goal is to filter rows based on a column called Environment and then update three other columns (Last Deploy Date, Deployed User, and Deploy Branch) for the matching row.

I attempted to use this API call to filter rows by the Environment column:

FILTER_RESULT=$(curl -s -X POST "https://api.notion.com/v1/databases/$DB_ID/query" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Notion-Version: 2022-06-28" \
  -d '{
    "filter": {
      "property": "Environment",
      "rich_text": {
        "equals": "'"$ENV_VALUE"'"
      }
    }
  }')

But I think this approach is wrong because I’m using the database query endpoint when my table is actually embedded within a page, not a standalone database. I’m confused about the correct API endpoint and method to filter and update rows in a page-based table versus a database table.

What’s the proper way to filter and update table rows that are embedded within a Notion page using the API?

The confusion happens because Notion treats tables as databases in the API. Your filtering looks right, but you’re missing something crucial - you need the actual database ID, not the page ID where the table sits. Check your table’s URL or use the search endpoint to find the database object. Once you’ve got the right database ID, your filter should return matching rows as page objects. To update those rows, make separate PATCH requests to https://api.notion.com/v1/pages/{page_id} for each result. The page_id comes from your query’s results array. Make sure your table is actually a database with proper properties (not just a simple table) - you can test this by trying to add property types like select, date, or person to your columns.

You’re hitting a common misconception about Notion’s API. Those ‘embedded’ tables? They’re actually full databases on Notion’s backend - there’s no separate endpoint for embedded vs standalone tables. Your curl command should work fine if the table was created as a database. The problem might be that you’re dealing with a ‘simple table’ (made with /table command) instead of a database table. Simple tables can’t be queried through the API at all. Check if your table has property types and can convert to a full database view. If it’s a proper database, your filtering looks right, but you’ll need separate PATCH requests to update each row after getting the filtered results. Use the page ID from your query results. The database query gives you page objects representing your table rows, and you update them through the pages endpoint.

yeah, you’re def dealing with a simple table vs database issue. Notion has two types of tables - only db ones work with the API. Try adding properties to your table first. If you can add dropdowns, dates, etc., then it’s a db. if not, you’ll need to convert it using the ‘db’ option in the table menu. once that’s done, your filter should work. just remember the db ID isn’t the same as the page ID where the table lives.