Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

A REST API is an HTTP interface organized around resources and standard web methods, but the phrase is often used more loosely for any API called over HTTP. To use one reliably, understand what methods promise, what status codes report, how authentication differs from authorization, and what an OpenAPI contract actually describes. This glossary explains those terms and shows how to assess whether an API’s documented behavior matches its implementation.

What is a REST API?

REST, or Representational State Transfer, is a set of architectural constraints intended to support efficient, reliable, scalable distributed systems. A REST API exposes resources and lets a client request or change representations of them through operations. In everyday development, however, “REST API” often means an HTTP service called with standard web libraries and tools; not every HTTP API satisfies every REST constraint.

That distinction matters when evaluating an API. HTTP tells you what methods and status codes mean, but the API owner must still define its resource model, data formats, pagination, error format, and other project-specific conventions. A familiar HTTP interface is not by itself proof that an API is fully RESTful.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Resource, representation, and operation

  • Resource: The thing or collection an API makes addressable, such as a user or a set of reports.
  • URI: The identifier the client targets to interact with a resource.
  • Representation: Data describing the resource, exchanged in a format such as JSON when the API supports it.
  • Operation: The action the client performs on a target, usually expressed by an HTTP method and path.

For example, a hypothetical API might use /reports/42 as the URI for one report. The URI alone does not say whether a request reads it, replaces it, or applies a partial change; the method and the API contract provide that context.

HTTP methods: what each request asks for

HTTP methods are not interchangeable labels. Their semantics shape client behavior, including whether a request is expected to change state and whether an identical request can safely be repeated.

Method Purpose Safe? Idempotent?
GET Requests a representation of the target resource. Yes Yes
HEAD Requests the metadata a GET response would provide, without transferring its response body. Yes Yes
POST Submits content for resource-specific processing; often used when processing changes state. No Not guaranteed
PUT Replaces the target resource’s current representation with the request content. No Yes
DELETE Requests deletion of the target resource. No Yes, by intended effect
PATCH Applies partial modifications to the target resource. No Not guaranteed
OPTIONS Asks about communication options for the target resource. Yes Yes
CONNECT Establishes a tunnel to the server identified by the target resource. No No
TRACE Requests a message loop-back test. Yes Yes

These are HTTP method semantics, not a guarantee that a particular API implements every method or uses it correctly. Read the API contract for the operations it supports and the effects each operation has.

Safe, idempotent, and retryable are different questions

Safe means no requested state change

A method is safe when the client does not ask the server to change state. GET and HEAD are safe: they request information rather than asking for a resource change. A server may still record incidental information, such as access logs; safety concerns the action requested by the client, not whether the system can have any side effects at all.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Idempotent means repeating has the same intended effect

A method is idempotent if one request and repeated identical requests have the same intended effect on the server. GET, HEAD, PUT, DELETE, OPTIONS, and TRACE are defined as idempotent. POST and PATCH are not guaranteed to be. Idempotency does not require identical responses: repeating a DELETE, for example, may produce a different response after the resource has already been removed, even though the intended end state is the same.

Use method semantics when planning retries

Idempotency is useful when a client cannot tell whether a request reached the server—for example, if a connection fails before a response arrives. Repeating an idempotent request should not change the intended outcome. Do not assume that repeating POST or PATCH is safe: the API may process the operation twice. Check whether the API documents a retry mechanism or an idempotency key before retrying operations that can create or modify state. The method’s standard semantics do not substitute for an API-specific contract.

Status codes: read the result class first

An HTTP response status code is a three-digit integer describing the result of a request. Its first digit identifies its class: 1xx informational, 2xx successful, 3xx redirection, 4xx client error, and 5xx server error. Valid HTTP status codes range from 100 through 599. The class remains meaningful even if a client does not recognize a particular code.

Code Meaning Common API use
200 OK The request succeeded. A successful operation with a response representation.
201 Created The request succeeded and created one or more resources. Often returned after a create operation; the new resource is normally identified by a Location header or the target URI.
202 Accepted The request was accepted, but processing is not complete. Often appropriate for work that continues asynchronously.
204 No Content The request succeeded and no response content is needed. A successful operation that does not need to return a representation.
400 Bad Request The request cannot be fulfilled because of a client-side syntax or input problem. Invalid request structure or input.
401 Unauthorized The origin challenges the client because authentication credentials are missing or invalid. Authentication is required or the supplied credentials are not valid; the response should include WWW-Authenticate.
403 Forbidden The credentials are understood but do not provide adequate access. The client is authenticated but lacks permission for the requested action.
404 Not Found The target resource was not found. The requested URI does not identify an available target resource.
409 Conflict A request conflicts with the current state. Use when the API’s documented condition genuinely matches this meaning.
429 Too Many Requests The client has sent too many requests in a given context. Use when the API’s documented rate-limit condition matches.
500 Internal Server Error The server encountered an unexpected condition. A server-side failure that matches the status’s semantics.

Do not choose 409, 429, or 500 merely because they seem broadly plausible. An API should document when it uses each code and what a client can do in response. A precise status helps clients distinguish, for instance, invalid input from missing permission or unfinished processing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

401 vs. 403: authentication is not authorization

HTTP authentication follows a challenge-and-response model. A protected origin commonly responds with 401 Unauthorized and a WWW-Authenticate challenge. The client then supplies credentials in an Authorization header. Despite the word “Unauthorized,” 401 is the status associated with missing or invalid authentication credentials.

403 Forbidden means the server understands the credentials but they are not sufficient for access. In practical terms, authentication establishes who or what the client is; authorization determines whether that identity may perform the requested operation. Treating a permission failure as a credential failure can send clients down the wrong recovery path.

Credentials sent in headers need a confidential connection and careful handling. Avoid exposing secrets in logs or other places where unintended readers could obtain them. OpenAPI can describe several authentication mechanisms, but the API owner’s contract must specify which mechanism a particular operation requires.

What is OpenAPI?

OpenAPI is a format for describing an HTTP API as a contract. It can record operations, inputs, response shapes, and security requirements so that developers and tools can inspect what an API says it accepts and returns. A specification is useful only to the extent that it accurately describes the running service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Core OpenAPI terms

  • Operation: A method-and-path action described in the contract.
  • Parameter: Input supplied in a path, query, header, or cookie location.
  • Request body: Content sent with an operation, commonly JSON for HTTP APIs.
  • Response object: A documented response associated with an HTTP status code. OpenAPI permits any HTTP status code as a response key.
  • Security scheme: A declared authentication mechanism, such as HTTP authentication, an API key, mutual TLS, OAuth 2.0, or OpenID Connect.
  • Schema: The shape and constraints of request or response data.

OpenAPI 3.1 can describe HTTP authentication, API keys in headers, cookies, or query parameters, mutual TLS, OAuth 2.0 flows, and OpenID Connect Discovery. Do not infer that a scheme is enabled simply because OpenAPI supports describing it: look at the API’s own security requirements.

Check whether the contract and implementation agree

When you read or review a specification, check the method and path for each operation, the location and required status of each parameter, the request body schema, the response codes, and the security requirements. Then compare those claims with the behavior clients actually encounter. A listed response code without an explanation, a schema that does not match returned data, or an authentication requirement that differs from the deployed service can undermine otherwise useful documentation.

ScreenshotNeo provides an OpenAPI specification for its screenshot API. Developers who need an HTTP endpoint to capture a page can also make a single GET request with a URL and receive an image or PDF. See ScreenshotNeo and its API documentation for the endpoint and supported parameters.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to compare REST API designs

“RESTful” is not a useful verdict by itself. Evaluate the decisions that affect clients, and check that the API contract explains them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Resource and URI modeling: Are targets addressable and are paths used consistently?
  • Method semantics and idempotency: Does each operation use a method whose standard meaning matches the intended action? Are repeat requests safe where clients may need retries?
  • Status-code accuracy: Do codes distinguish success, validation problems, authentication challenges, permission failures, and asynchronous work appropriately?
  • Authentication and authorization: Is the required credential mechanism clear, and does the API distinguish invalid credentials from inadequate permissions?
  • Representation and schema consistency: Do request and response formats follow predictable structures that match their documented schemas?
  • Pagination and filtering: Are collection-query conventions documented? HTTP semantics alone do not establish a particular pagination or filtering scheme.
  • Error format: Can clients interpret error details consistently? The API owner must define its error envelope and fields.
  • Caching and conditional requests: Does the API explain whether and how responses may be cached or conditionally requested?
  • Contract fidelity: Does the OpenAPI description match the service clients actually use?

HTTP standards establish method and status-code semantics, and OpenAPI supplies contract concepts. They do not prescribe every project-level choice, such as pagination conventions, versioning rules, or a particular error envelope. Those choices belong in the API’s documentation.

Or skip the browser setup

If your REST API work involves capturing web pages for previews, reports, or agent workflows, ScreenshotNeo exposes a single-request alternative to setting up a browser. For example, this cURL command requests an image of Stripe:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners are accepted before capture and 60+ known consent platforms, newsletter popups, and chat widgets can be removed; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers indicating the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Does every HTTP API qualify as REST?

No. “REST API” is often used informally for HTTP APIs, but REST refers to architectural constraints; using HTTP alone does not establish that an API satisfies them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does idempotent mean every repeated request returns the same response?

No. It describes the request’s intended effect on server state. Response codes or bodies may differ between attempts.

Does OpenAPI define an API’s pagination rules?

No. OpenAPI can describe an API’s inputs and responses, but pagination conventions are a project-specific choice that the API owner must document.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.