Fixing Threads API publishing errors
I have been adding Threads support to my own posting setup, and the Threads API kept failing with an error that looked like a permissions problem.
The first one was code 100, error_subcode 33, "Object with ID ... does not exist", on every single post. The ID in that message is the user_id that comes back from the OAuth token exchange, and the Graph API doesn't accept it as a publishing target. I wasted time re-authorizing the account and toggling permissions because the message says "missing permissions", but that wording is boilerplate that shows up on code 100 whatever the token actually grants. What worked was asking Meta who the token belongs to and publishing as that.
curl "https://graph.threads.net/v1.0/me?fields=id,username&access_token=$TOKEN"
The id from /me published fine on the first try, and since then I refresh the stored id on every publish so an old row repairs itself.
Then a threaded post with an image failed with code 1, error_subcode 2207052, "Media download has failed". Meta downloads the image_url on their side when the container is created, and here their crawler couldn't fetch it. I pulled both files out of storage to compare and they were byte-identical, same MD5, one failed and the other published seconds later, so it's a flake and not something wrong with the image. I made the container creation retry with a freshly signed URL, and left that failure retryable so a scheduled post tries again instead of parking as failed.
The truncated error text never told me any of this. The full response body did, and the error_subcode is what showed me which of the two I was looking at.