Slack API · error code

Slack error missing_post_type: POST body sent without a Content-Type header

Permanent - do not retryHTTP 200Message content & Block Kit

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.

What error missing_post_type means

Your request had a body but no Content-Type header, so Slack could not tell whether to parse it as JSON, form data or plain text. The documented wording is precise: it was a POST, it "included a data payload," and the header was absent.

Slack's Web API guide states that JSON is only interpreted when you explicitly set Content-type: application/json; without it, the body is not treated as JSON. So code that does fetch(url, {method: "POST", body: JSON.stringify(payload)}) with no headers, or a raw socket or curl --data-binary call that skips the header, ends here. Some HTTP clients also drop headers when you pass a pre-serialized string instead of an object.

Your token and arguments are unaffected. Add the header and the same body should be processed normally.

What it looks like

POST /api/chat.postMessage
Authorization: Bearer xoxb-...

{"channel":"C123ABC456","text":"hi"}

{"ok": false, "error": "missing_post_type"}

Why it happens

  • fetch or a similar client was called with a string body and no headers object.
  • A custom headers map replaced the library defaults and forgot Content-Type.
  • A proxy or serverless adapter stripped headers when forwarding the request.
  • A curl command used --data-binary without -H 'Content-type: ...'.

How to fix Slack error missing_post_type

  1. 1Add Content-type: application/json and send the token as Authorization: Bearer xoxb-....
  2. 2If merging custom headers, merge into the defaults rather than replacing them.
  3. 3Inspect the request at the edge (or via a request bin) to confirm the header survives any proxy.
  4. 4Re-run the same call with the official SDK to confirm the body itself is valid.

How to stop it recurring

Never call Slack with ad-hoc fetch snippets scattered through the codebase. Centralize requests in one function that always sets Content-Type and Authorization, and lint for direct calls to slack.com/api outside it. A test that inspects outgoing headers for every Slack call keeps it that way.

Official reference: Slack API reference - chat.postMessage errors. See all Slack error codes or the Slack limits and quotas.

Related codes

Error missing_post_type - quick answers

What does Slack error missing_post_type mean?

Your request had a body but no Content-Type header, so Slack could not tell whether to parse it as JSON, form data or plain text. The documented wording is precise: it was a POST, it "included a data payload," and the header was absent. Slack's Web API guide states that JSON is only interpreted when you explicitly set Content-type: application/json ; without it, the body is not treated as JSON.

How do I fix Slack error missing_post_type?

1. Add Content-type: application/json and send the token as Authorization: Bearer xoxb-.... 2. If merging custom headers, merge into the defaults rather than replacing them. 3. Inspect the request at the edge (or via a request bin) to confirm the header survives any proxy. 4. Re-run the same call with the official SDK to confirm the body itself is valid.

Should I retry after error missing_post_type?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging Slack by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.