# API Deadline

**URL:** <https://forum.beeminder.com/t/api-deadline/10666>\
**Category:** Tech\
**Created:** [December 12, 2022, 5:32pm UTC](https://forum.beeminder.com/t/api-deadline/10666 "2022-12-12T17:32:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgamer1](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cgamer1](https://forum.beeminder.com/u/cgamer1)\
**Post date:** [December 12, 2022, 5:32pm UTC](https://forum.beeminder.com/t/api-deadline/10666/1 "2022-12-12T17:32:51Z")

</div>

Hey Everyone,

I looked through the API docs and I did not see a way to update a goal’s deadline. Does anyone happen to know how to do it (e.g. add deadline param to PUT)?

---

<div class="post-metadata">

**Author:** ![rperce](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/rperce/32/4197_2.png) [@rperce](https://forum.beeminder.com/u/rperce)\
**Post date:** [December 12, 2022, 7:51pm UTC](https://forum.beeminder.com/t/api-deadline/10666/2 "2022-12-12T19:51:37Z")

</div>

It’s not specifically mentioned in the API docs for updating a goal, but most (all?) of the values described on the overall [Goal Resource](http://api.beeminder.com/#attributes-2)[apidoc] page are accepted by update requests, `deadline` being one of them:

```auto
╭─(robertp)───(awscmh3)───(~)
╰──╼ curl -sSL 'beeminder.com/api/v1/users/me/goals/coding.json?auth_token=[snip]' | jq '.deadline'
0
╭─(robertp)───(awscmh3)───(~)
╰──╼ curl -sSL -XPUT 'beeminder.com/api/v1/users/me/goals/coding.json' -d auth_token=[snip] -d deadline=3600 | jq .deadline
3600
╭─(robertp)───(awscmh3)───(~)
╰──╼ curl -sSL 'beeminder.com/api/v1/users/me/goals/coding.json?auth_token=[snip]' | jq '.deadline'
3600

```

(and I confirmed on the goal page in-browser that it _actually did work_, too!)

---

<div class="post-metadata">

**Author:** ![cgamer1](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cgamer1](https://forum.beeminder.com/u/cgamer1)\
**Post date:** [December 12, 2022, 10:24pm UTC](https://forum.beeminder.com/t/api-deadline/10666/3 "2022-12-12T22:24:37Z")

</div>

Nifty, thank you! I got it to work. I did not know that the params in Goal Resource are widely accessible for updating goals.

---

<div class="post-metadata">

**Author:** ![rperce](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/rperce/32/4197_2.png) [@rperce](https://forum.beeminder.com/u/rperce)\
**Post date:** [December 13, 2022, 4:37am UTC](https://forum.beeminder.com/t/api-deadline/10666/4 "2022-12-13T04:37:58Z")

</div>

@dreev, it might be worth putting a blurb on the “update” api pages that explicitly only calls out what (if any) attributes _can’t_ be updated and says that the rest _can_—right now there’s a list of the “special” ones like `roadall`, but it also includes a few “normal” parameters (like `title`) that make it look like ones _not_ mentioned (like `deadline`) _can’t_ be updated.

Also, lol, at first I thought I’d found a bug here, but actually it was just that I had genuinely forgotten to update this goal’s deadline, which I randomly selected as an example, when y’all introduced adjustable deadlines for toggl goals! 😃
