Discord API · error code

Discord error 50019: Message can only be pinned to its own channel

Permanent - do not retryHTTP 400Validation and request shape

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
A message can only be pinned to the channel it was sent in

What error 50019 means

The pin endpoint is PUT /channels/{channel.id}/pins/{message.id}, and the channel in the path must be the channel the message actually belongs to. You passed a message ID from one channel with a different channel's ID in the route. Discord will not pin across channels; it only pins a message to the channel that owns it.

This is a plumbing bug, not a limit or permission. It appears when a starboard or highlight bot keeps a "pin to this channel" configuration and uses the configured channel in the path rather than the message's source channel, or when a thread message is pinned using the parent channel's ID. Threads are separate channels for this purpose, so a message in a thread must be pinned via the thread's ID.

What it looks like

{
  "message": "A message can only be pinned to the channel it was sent in",
  "code": 50019
}

Why it happens

  • Path channel ID taken from configuration instead of from message.channel_id
  • Thread message pinned with the parent channel's ID
  • Message and channel IDs stored in separate places and paired incorrectly
  • Attempt to "move" a pin from one channel to another via the pin endpoint

How to fix Discord error 50019

  1. 1Always use message.channel_id from the message object when building the pin URL
  2. 2For threads, use the thread ID (which is message.channel_id for messages inside it)
  3. 3If you want highlights in another channel, re-post or embed the message there and pin that copy
  4. 4Fetch the message (GET /channels/{id}/messages/{id}) to confirm its channel before pinning

How to stop it recurring

Pass whole message objects (or at least channel ID + message ID together) through your code rather than bare message IDs. A small helper pin(message) that derives the route from the message removes the possibility of mismatch.

The pin route's shape is the general lesson: any endpoint that takes two IDs will eventually receive a mismatched pair unless the pairing is enforced by the type system or the helper that builds the URL. Pin capacity per channel is on the Discord limits page, and a full pin list fails differently, with 30003.

Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.

Related codes

Error 50019 - quick answers

What does Discord error 50019 mean?

The pin endpoint is PUT /channels/{channel.id}/pins/{message.id}, and the channel in the path must be the channel the message actually belongs to. You passed a message ID from one channel with a different channel's ID in the route. Discord will not pin across channels; it only pins a message to the channel that owns it. This is a plumbing bug, not a limit or permission.

How do I fix Discord error 50019?

1. Always use message.channel_id from the message object when building the pin URL 2. For threads, use the thread ID (which is message.channel_id for messages inside it) 3. If you want highlights in another channel, re-post or embed the message there and pin that copy 4. Fetch the message (GET /channels/{id}/messages/{id}) to confirm its channel before pinning

Should I retry after error 50019?

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 Discord by hand

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