# Error "Unable to decode playboook"

**URL:** <https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315>\
**Category:** Troubleshooting\
**Created:** [March 9, 2023, 12:04pm UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315 "2023-03-09T12:04:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/mdb/32/6488_2.png) [@mdb](https://forum.mattermost.com/u/mdb)\
**Post date:** [March 9, 2023, 12:04pm UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/1 "2023-03-09T12:04:25Z")

</div>

For feature requests, please see: [https://mattermost.com/suggestions/](https://mattermost.com/suggestions/).

For troubleshooting questions, please post in the following format:

**Summary**  
I cannot create a playbook using the API.

**Steps to reproduce**  
How can we reproduce the issue (what version are you using?)

I’ve converted the cURL request in the API docs to a Python Request and try use it to create a new playbook.

```auto
headers = {
    'Authorization': 'Bearer OOOO'
}

data = '{"title": "Cloud PlaybookRuns", "member_ids": [{"XXX"]},"team_id": "YYY","create_public_playbook_run": true,"reminder_timer_default_seconds": 10,"checklists": [{"title": "Triage issue","items": [{"title": "Gather information from customer."}]}]}'
response = requests.post('https://collab.enavvarje.se/plugins/playbooks/api/v0/playbooks', headers=headers, data=data)

```

**Expected behavior**  
I would expect the get a new playbook. I’m at a loss to solve this as the same code worked on the preview instance i tried

**Observed behavior**  
\<Response [400]\>  
{“error”:“unable to decode playbook”}

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [March 10, 2023, 5:01am UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/2 "2023-03-10T05:01:21Z")

</div>

Hi @mdb ,

there’s a problem with the syntax in your payload, this part of the JSON doesn’t validate:

> [@mdb](#):
>
> `"member_ids": [{"XXX"]},`

It probably should read:

```json
"member_ids": ["XXX"],

```

Can you check that?

---

<div class="post-metadata">

**Author:** ![mdb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/mdb/32/6488_2.png) [@mdb](https://forum.mattermost.com/u/mdb)\
**Post date:** [March 10, 2023, 9:16am UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/3 "2023-03-10T09:16:01Z")

</div>

thank you so much for that! bit embarrasing on my part.  
However, once i changed that I now get that I am not authorized.

The same user can create playbooks in the web gui.

---

<div class="post-metadata">

**Author:** ![mdb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/mdb/32/6488_2.png) [@mdb](https://forum.mattermost.com/u/mdb)\
**Post date:** [March 10, 2023, 11:18am UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/4 "2023-03-10T11:18:22Z")

</div>

I reverted to just trying via cURL with this

```auto
curl -X POST 'https://collab.enavvarje.se/plugins/playbooks/api/v0/playbooks' -H 'Authorization: Bearer tokenjjj' -d '{"title": "Cloud PlaybookRuns", "description": "A playbook to follow when there is a playbook run regarding the availability of the cloud service.", "reminder_timer_default_seconds": 10, "team_id": "teamid","create_public_playbook_run": true,"checklists": [{"title": "Triage issue","items": [{"title": "Gather information from customer."}]}]}'

```

and get “not authorized” still. The same token can list playbooks via the api and create in the web gui… i’m sure it’s a detail i’m missing here

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [March 13, 2023, 6:52am UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/5 "2023-03-13T06:52:56Z")

</div>

Hi again,

I just recognized that the API documentation for playbooks is in a pretty bad state, so you don’t even have a fair chance to get this fixed on your own ☹ I was also unable to create a playbook using your payload on my local system, also always only got the `Not authorized` message until I found out that this is a licensing issue and you have to add the undocumented `public` parameter to the payload and set it to true.  
Here are two examples of minimal payloads, the first one showing the `Not authorized` message and the second one working (creating a playbook without title, which is possible for whatever reason…):

```json
{
  "team_id": "q44oy1r8s7ybxxo58zx4a5qmdr",
  "reminder_timer_default_seconds": 10
}

```

→ Not authorized.

```json
{
  "team_id": "q44oy1r8s7ybxxo58zx4a5qmdr",
  "reminder_timer_default_seconds": 10,
  "public": true
}

```

→ Working

---

<div class="post-metadata">

**Author:** ![mdb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/mdb/32/6488_2.png) [@mdb](https://forum.mattermost.com/u/mdb)\
**Post date:** [March 13, 2023, 12:32pm UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/6 "2023-03-13T12:32:02Z")

</div>

Thank you so much! Adding the public-parameter enabled me to create the playbook. However, this poses a new question that maybe this is the wrong forum-section for. But I’m running the team/free-version at this time. Is it not supposed to work in that version?

thanks

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [March 13, 2023, 1:07pm UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/7 "2023-03-13T13:07:20Z")

</div>

From what I found out, private playbooks seem to be a paid feature, but when I found out about the discrepancy today, I already alerted the docs team and am waiting for their feedback. As soon as I know what’s going on, I’ll let you know.

---

<div class="post-metadata">

**Author:** ![mdb](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/mdb/32/6488_2.png) [@mdb](https://forum.mattermost.com/u/mdb)\
**Post date:** [March 13, 2023, 1:20pm UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/8 "2023-03-13T13:20:07Z")

</div>

as long as i get a playbook via API i’m happy - doesn’t have to be private  
thank you for alerting me to the public-paramter

cheers  
martin

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [March 13, 2023, 6:04pm UTC](https://forum.mattermost.com/t/error-unable-to-decode-playboook/15315/9 "2023-03-13T18:04:20Z")

</div>

You’re welcome 🙂 Not sure how fast the feedback will come (if any) so I’m marking this issue as solved now. If I ever get more info, I’ll post it here.
