iGlow / Blog / statusCode: 401
SAP CPI error
HTTP operation failed invoking ... with statusCode: 401
Short answer: This error means the receiver answered but refused your login. It usually happens when the credential alias, the authentication type or the OAuth token settings in the HTTP receiver channel are wrong, or the token expired. To fix it, correct the credentials in Security Material and test the call outside CPI.
The problem
The call reaches the receiver and comes back refused. The log says only "statusCode: 401" and a URL. Is the password wrong, the alias wrong, the token expired or the scope off? You end up testing in a REST client, reading the channel settings and guessing which credential artifact the channel really uses.
What does statusCode: 401 mean?
HTTP status 401 means Unauthorized. CPI reached the receiver, the TLS handshake worked, and the receiver read the request. It then said it does not accept the identity that came with it. The text shows the URL that was called and the status code.
Full text in the log: org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://api.example.com/orders with statusCode: 401
Why does it happen?
The most common cause comes first.
- A wrong or expired user name or password in the User Credentials artifact.
- The channel points at the wrong credential alias, or uses Basic authentication where the server wants OAuth.
- An OAuth token with the wrong scope or audience. SAP describes a Microsoft API case in KBA 3720743.
- An OAuth 2.0 token that expires between calls. KBA 3266490 covers failures near the token's expiry time.
How do I fix statusCode: 401 in SAP CPI?
- Open the failed message in Monitor Message Processing and read the response body. Many servers explain the refusal.
- Repeat the call from a REST client with the same credentials. If it fails there too, the credentials are wrong.
- Check Authentication and Credential Name in the HTTP receiver channel.
- Update the artifact under Manage Security > Security Material and deploy it. Resend the message.
How do I confirm it is fixed?
Resend the message. The status turns Completed and the receiver step shows a 2xx response in the log.
Which adapter or step causes it?
The HTTP receiver adapter (and others that use HTTP, such as OData). The error appears at the receiver step.
Tips to avoid it next time
Keep one credential artifact per receiver system, and name it after the system, so the alias in the channel is easy to check. Note when passwords expire. With OAuth 2.0, do not copy tokens by hand: let the channel fetch them. If a 401 appears only now and then, think of token expiry before you think of a wrong password. For other receiver codes, see the 404 section in the full error guide.
Related errors
- PKIX path building failed (the certificate is not trusted)
- JSchException: Auth fail (the same idea for SFTP)
- Content is not allowed in prolog (a login page can cause it)
See all ten in the 10 most common SAP CPI errors and how to fix each for SAP Cloud Integration (SAP Integration Suite).
The easy way: fix a 401 error with iGlow
iGlow is an AI agent for SAP Integration Suite and CPI that runs as a Chrome extension side panel. The hunt above is what the Fix button does for you.
- Open the panel. The failed message is listed with a Fix button.
- Click Fix. iGlow reads the error, the receiver step, the URL and the response, then explains that the receiver refused the credentials.
- Follow the next steps: which alias and authentication type to check in the channel, and which credential artifact to update in Security Material. You make the change, because iGlow never sets a real password for you, and secret values are never shown to the AI.

Nothing is saved or deployed without your click, and tenants tagged PRD are never changed. See the Fix failed messages guide. Add iGlow to Chrome.
Questions
What does HTTP operation failed invoking with statusCode 401 mean?
The receiver server rejected the credentials CPI sent. The connection itself worked.
How do I fix statusCode 401 in SAP CPI?
Check the credential alias and authentication type in the receiver channel, test the same credentials in a REST client, then update the credential in Security Material.
Which adapter or step causes statusCode 401?
The HTTP receiver adapter, or any receiver adapter that calls an HTTP API, such as OData.