Update HubDb row via API

Hello dev community!
I am attempting to update a HubDb table row and receiving errors.
I’m able to read and create rows using my API key, but receive errors using the update/delete endoints.
I have included hubdb in my private app scope and read through the hubdb docs multiple times to sanity check but cannot find my mistake.
Does anyone have any idea why I can read/create rows but not update/delete rows?
// You can see the error response below:

// See request body:

// Source code for posterity

I appreciate your insight, I’m puzzled!
Zack

@ZLyons - The only issue I can see is tha the API call URL should end with ‘/draft’

I hope it’s that simple!

Steve

Hi @ZLyons :waving_hand:

I agree with @SteveHTM. You’ll need to use the “Updates an existing row” endpoint, then (if required) publish those changes using the “Publish a table from draft” endpoint. For example:

Update HubDB table row (i.e. draft change)

curl --location --request PATCH 'https://api.hubapi.com/cms/v3/hubdb/tables/:TABLE_ID/rows/:ROW_ID/draft' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer pat-eu1-abc-xyz' \
--data '{
 "values": {
 "column_name": "example text"
 }
}'

Publish drafted changes

curl --location --request POST 'https://api.hubapi.com/cms/v3/hubdb/tables/:TABLE_ID/draft/publish' \
--header 'Authorization: Bearer pat-eu1-abc-xyz'

I hope that proves helpful. Please let me know if you have any follow-up questions.

Hey Zach,
thank you for the help! I guess I got caught by the draft vs. live feature, I should be able to accomplish what I need to now!
I appreciate you helping me get unstuck, I was having fun learning about HubDb and the blocker was frustrating me, haha.
Hope you have a great new year,
another Zack

Hi Steve,
Thanks for the feedback! The live vs draft tables feature seems to have confused me, I had hoped to push to the live table and skip the /publish endpoint step, but it’s not a big deal to push to the draft table and then do the extra step of publishing it.
I appreciate you taking time to check out my problem,
happy new year!
Zack