# CypressError: cy.request() failed (Cypress)

Source: https://www.observeone.com/community/errors/cypress/cy-request-failed

[ObserveOne](/)[Features](/#features)[Pricing](/#pricing)[Blog](/blog)[CLI](/cli)[Docs](/docs)

[Sign in](https://app.observeone.com/auth?tab=signin)[Start Free](https://app.observeone.com/auth?tab=signup)

[Error Dictionary](/community/errors)/[Cypress](/community/errors/cypress)/cy-request-failedhigh

# CypressError: cy.request() failed

cy.request() failed because the server returned an error, the connection was refused, or the request timed out.

## Common Causes

- 1API server is down or unreachable
- 2Authentication token is missing or expired
- 3Request body is malformed
- 4CORS configuration blocks the request
- 5SSL certificate issues

## How to Fix

### Allow failures with failOnStatusCode

cy.request({
 url: '/api/data',
 failOnStatusCode: false,
}).then((response) => {
 expect(response.status).to.eq(404);
});When testing error cases, disable automatic failure on non-2xx status codes.

### Add authentication headers

cy.request({
 url: '/api/data',
 headers: {
 Authorization: `Bearer ${Cypress.env('API_TOKEN')}`,
 },
});Include auth headers for protected endpoints. Store tokens in Cypress environment variables.

## How ObserveOne Helps

ObserveOne monitors your API endpoints 24/7 and catches errors before they impact your test suite.

[Start Monitoring Free](https://app.observeone.com/auth?tab=signup)

## Related Errors

[CypressError: cy.visit() failedcy.visit() failed to load the target URL. The server may be unreachable, or the response status code indicates an error.](/community/errors/cypress/cy-visit-failed)[CypressError: Timed out retrying after 4000msA Cypress command timed out while retrying. Cypress automatically retries assertions until the timeout, then fails. The default is 4 seconds.](/community/errors/cypress/cy-timeout)[CypressError: Expected to find element but never found itCypress could not find any element matching the selector within the timeout period. The element may not exist, may have a different selector, or may not have been rendered yet.](/community/errors/cypress/cy-element-not-found)[CypressError: element has been detached from the DOMThe element that Cypress was interacting with was removed from the DOM and re-rendered. This is common in React/Vue/Angular apps where components re-render.](/community/errors/cypress/cy-detached-dom)[AssertionError: expected true to equal falseA Chai assertion in Cypress failed because the actual value did not match the expected value. This is the most common test failure type.](/community/errors/cypress/cy-assertion-failed)

ObserveOne

Agentic QA and synthetic monitoring built for engineering teams. Plan, generate, and run suites from the web UI. Connect to CI for reliable coverage across critical journeys.

### Product

- [Features](/#features)
- [Pricing](/#pricing)
- [QA Coverage](/qa-coverage)
- [API Monitoring](/api-monitoring)
- [Free Website Check](/free-website-check)

### Developers

- [CLI](/cli)
- [Docs](/docs)
- [For Agents](/agents)
- [Self-host (oo-workers)](/workers)
- [Status Pages](/status)
- [Netlify Extension](https://app.netlify.com/extensions/mzs1lgc3-observeone)

### Resources

- [Blog](/blog)
- [Bug Book](/bug-book)
- [Guides](/community/guides)
- [Tools](/community/tools)
- [Error Dictionary](/community/errors)

### Compare

- [Tool Comparisons](/compare)
- [Tool Alternatives](/alternatives)
- [Best by Category](/best)
- [Search](/search)

© 2026 ObserveOne. All rights reserved.

[About](/about)[Privacy Policy](/privacy)[Terms of Service](/terms)[Affiliates](/affiliates)[Become an Affiliate](/affiliate-terms)
