NEW
Also known as: 200 OK
An HTTP success status indicating that the request succeeded and a response payload is returned.
DESCRIPTION
HTTP 200 OK signals a successful request and is commonly returned for GET, POST, and other methods when content is included in the response. It implies the server processed the request without errors. For GET, it typically returns a representation of the resource. For POST, it may return content, though 201 is often preferred for new resource creation. 200 responses can be cacheable depending on headers. Clear use of 200 improves API consistency and client behavior. Consider 204 when no body is needed. Proper status codes enhance observability and error handling across services.
ALTERNATIVE DEFINITIONS
MDN Web Docs
The HTTP 200 OK success status response code indicates that the request has succeeded.
Concise definition emphasizing success of the request.
IETF RFC
The 200 (OK) status code indicates that the request has succeeded.
Normative specification language for the status code.
RELATED TERMS
Status Codes HTTP 201 Created GET Method REST Caching Content Negotiation ETag API Gateway Idempotent Request
COMPETING TERMS
HTTP 204 No Content
KNOWLEDGE AREAS
Software Engineering Data Integration & Interoperability
TARGET AUDIENCE
Software Developer DevOps Engineer Cloud Architect Data Engineer
EXTERNAL SOURCES
- Wikipedia - List of HTTP status codes#2xx success
- MDN Web Docs - Comprehensive HTTP status overview
- IETF RFC - HTTP semantics specification
TOP QUESTIONS
When should an API return HTTP 200?
Return 200 when the request succeeded and the response includes a body. For resource creation, prefer 201; for no content, prefer 204.
Category: Requirements
Is HTTP 200 always cacheable?
Not inherently; cacheability depends on response headers like Cache-Control and ETag. Configure them to match data freshness requirements.
Category: Misunderstanding
What’s a common mistake with HTTP 200?
Returning 200 for validation or server errors obscures failures. Use appropriate 4xx or 5xx codes to signal issues clearly.
Category: Mistakes
How does HTTP 200 differ from HTTP 204?
200 returns a response body, while 204 indicates success without any content. Choose based on whether a payload is needed.
Category: Alternatives
Does HTTP 200 imply idempotency?
No, idempotency is about method semantics. 200 simply signals success; idempotency depends on the HTTP method and server behavior.
Category: Misunderstanding
How does observability benefit from precise use of HTTP 200?
Consistent status codes enable accurate success-rate metrics and SLOs. It simplifies alerting and error triage.
Category: Management
Can HTTP 200 be used for POST requests?
Yes, especially when returning a result or operation outcome. For new resources, 201 Created is typically preferred.
Category: Requirements
What’s a hot topic around HTTP 200 in APIs?
Using problem details (RFC 7807) with non-200 responses to standardize error payloads is increasingly common.
Category: Topic
How should clients handle HTTP 200 with unexpected payloads?
Validate content type and schema. Fail gracefully if the payload doesn’t match expectations to prevent downstream errors.
Category: Risk