Midjourney API Error 403: How to Fix
Updated 10/29/2026
Midjourney does not offer an official, public developer API. Because of this, developers and teams use third-party API wrappers, automated Discord bots, or browser scripts to generate images programmatically. When your integration returns a 403 Forbidden error, it means the server understands your request but refuses to authorize it.
Since this error stems from authorization, permission, or scraping blocks, you must identify where the breakdown is occurring between your code, the third-party gateway, and Discord's servers. Follow these steps to diagnose and resolve the issue.
1. Verify and Refresh Discord User Tokens
Most unofficial Midjourney APIs rely on a Discord User Token (not a standard Discord Bot Token) to mimic human interactions with the Midjourney Bot. If this token is invalid or has expired, Discord will reject the request with a 403 error.
- Check for Password Changes: If you recently changed the password of the Discord account running your Midjourney subscription, Discord immediately invalidates all active user tokens. You must extract and configure a new token.
- Extract the Token Manually: Log into Discord in a desktop browser, open Developer Tools (F12), navigate to the Network tab, send a message in any channel, look for the /messages request, and copy the value from the Authorization request header.
- Update Your Environment Variables: Replace the old token in your integration's .env file or config dashboard. Never hardcode this token in public repositories.
Agent Builder turns a task you repeat into a reusable assistant with setup text for each app.
Tickd is independent and not affiliated with any AI company.
2. Check Discord Channel and Role Permissions
If your API script attempts to send slash commands (/imagine) to a specific Discord channel, but the associated account lacks the proper permissions for that channel, Discord's API will drop the request with a 403 status.
- Open Channel Settings: Navigate to the Discord server and channel you are targeting.
- Edit Permissions: Ensure the account associated with your API token has the following permissions enabled in that specific channel:
- *View Channel*
- *Send Messages*
- *Use Application Commands* (essential for triggering /imagine)
- *Read Message History*
- Test Manually: Log into the target Discord account in a browser and try to manually run the /imagine command in that exact channel. If it fails manually, your bot script will also fail.
3. Resolve IP Blocks and Cloudflare Captchas
Both Discord and Midjourney use Cloudflare to prevent DDoS attacks, scraping, and unauthorized automation. If your API requests originate from a flagged IP range (such as AWS, DigitalOcean, or Heroku data centers), Cloudflare may challenge the connection, resulting in a 403 Forbidden response.
- Use Residential Proxies: If your script is hosted on a cloud VPS, route your API requests through a high-quality residential proxy pool. Datacenter IPs are almost always flagged and blocked.
- Rotate User-Agents: Ensure your request headers contain a realistic, modern User-Agent string. A missing or generic User-Agent (like python-requests/2.28) is an immediate trigger for a 403 block.
- Implement Request Throttling: Rapid, consecutive requests look like bot activity. Introduce randomized delays (jitter) between 5 to 15 seconds between your API calls to mimic human behavior.
4. Unblock Discord Accounts and Clear Captchas
Discord frequently flags accounts that show automated behavior. If Discord places a temporary lock or a phone-verification check on your account, all automated API requests will fail with a 403 error.
- Log in via Browser: Open a private browsing window and log into the Discord account manually.
- Solve Pending Captchas: Look for any prompts requiring you to verify your identity, verify your phone number, or solve a hCaptcha.
- Verify Subscription Status: Ensure your Midjourney subscription is active and has not been suspended for violating the terms of service (TOS) regarding automated self-bots.
When to Escalate
Because Midjourney does not officially support developer API integrations, do not contact Midjourney's official Discord support team about API or code-level 403 errors, as using self-bots or unofficial APIs violates Discord's Terms of Service and can lead to account termination.
Instead, if you are using a commercial third-party API provider (like ImagineAPI, Userby, or Midjourney API wrappers on RapidAPI), contact that provider's support team directly or check their system status page to see if they are experiencing global IP bans or routing failures.