Can't Update Goals via API

So I'm trying to issue an HTTP request to the API to update goals and I keep getting a 200 OK message, but none of the goal fields I tried to update are updating. Is this a bug or am I doing something wrong? Here's the HTTP request I'm sending:

 

PATCH /v1/budgets/<budget-id>/months/current/categories/<category-id> HTTP/1.1
Authorization: Bearer <auth-token>
Content-Type: application/json; charset=utf-8
Host: api.youneedabudget.com
Connection: close
User-Agent: Paw/3.1.8 (Macintosh; OS X/10.14.3) GCDHTTPRequest
Content-Length: 154

{"category":{"goal_type":"TBD","goal_target":"100000","goal_target_month":"2019-09-01","goal_creation_month":"2019-03-01","goal_percentage_complete":"0"}}

 

By contrast, the following request works just fine. This one only aims to update the budgeted amount instead of the goal information:

 

PATCH /v1/budgets/<budget-id>/months/current/categories/<category-id> HTTP/1.1
Authorization: Bearer <auth-token>
Content-Type: application/json; charset=utf-8
Host: api.youneedabudget.com
Connection: close
User-Agent: Paw/3.1.8 (Macintosh; OS X/10.14.3) GCDHTTPRequest
Content-Length: 154

{"category":{"budgeted":"1000"}}

 

Anyone have an idea as to what's wrong?

5replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Gonna bump this since I posted it in the middle of the night and there’s a chance no one really saw it. 

    Reply Like
  • Hi Gustavo. 

    PATCH /v1/budgets/{budget_id}/months/{month}/categories

    currently only supports updating "budgeted" amount.  We may support updating other fields in the future but currently only "budgeted" is supported.

    Reply Like
    • Hey Brady ,

      Thanks for taking the time to look at this post a couple of months ago. The reason I'm trying to use this API is to enable the ability for me to have annually recurring goals. The little app I'm writing would periodically scan my scheduled transactions for any that are recurring yearly and if there's no goal for the category of the corresponding transaction, it would create one.

      I've heard other people ask for annually recurring goals before, but if that's not on the roadmap any time soon, could you guys reevaluate adding support for updating these fields? I think goals customization is something pretty robust that could enable several different kinds of integrations with the YNAB service.

      Reply Like
    • Gustavo Poscidonio Ah - annual recurring goals. I love the way you're thinking! I know our design team is already well aware of the desire to have them natively in the app. The best way to let them know of your interest in changes to the API is to use our Feature Request form! There's a checkbox to specify a feature for the API :) 

      Reply Like
    • Gustavo Poscidonio I too would like to be able to set goals via the api. And I did submit a feature request. Here's hoping this changes. I would really like to eventually see full write access via the api but that would be a bit of an undertaking but setting goals should be simple for them to add.

      Reply Like
Like Follow
  • 2 wk agoLast active
  • 5Replies
  • 70Views
  • 5 Following