I have Create API Token on this url Atlassian account | security | api tokens with scopes “write:deployment-info:jira”, and I want to post data through deployment rest api "/rest/deployments/0.1/bulk" (https://developer.atlassian.com/cloud/jira/software/rest/api-group-deployments/#api-rest-deployments-0-1-bulk-post) However, it’s not work. Always shows below error.
Client must be authenticated to access this resource
And I use httpbasicauth(Email and token) for authorization
Anyone have advice on it? Many thanks.
Best Regards,
Miles
Hello @Miles Mai
The issue here is likely the authentication method rather than the token itself. The Deployments API is a bit unique; it doesn't usually play nice with standard Basic Auth (email + API token). Instead, Atlassian expects this specific endpoint to be called using OAuth 2.0.
Even if your token has the right scopes, the "Client must be authenticated" error is Jira's way of saying it was expecting a Bearer token from an OAuth, not your personal API credentials. To fix this, you’ll need to create OAuth 2.0 credentials in Jira, exchange your client_id and client_secret for an access token, and then use that in your header as Authorization: Bearer <access_token>.
You'll also need to tweak your URL. For OAuth integrations, you should be hitting the global Atlassian API gateway rather than your site URL directly:
POST https://api.atlassian.com/jira/deployments/0.1/cloud/<cloudId>/bulk
If you just want to verify your current API token is active, try a quick GET request to /rest/api/3/myself. If that works but the deployment endpoint fails, you definitely need to switch over to the OAuth flow to get those deployments syncing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.