Skip to content
Latchkey

What Is a REST API? Resource-Oriented Web APIs

A REST API is a web interface that exposes resources at URLs and manipulates them with standard HTTP methods, returning structured data like JSON.

REST, short for Representational State Transfer, is the dominant style for web APIs. Resources such as users, builds, or deployments each have a URL, and you act on them with GET, POST, PUT, and DELETE. Most CI tooling automates a platform by calling its REST API, so understanding REST helps you read and debug pipeline integrations.

Resources and URLs

In REST, every entity is a resource identified by a URL, like /deployments/42. You operate on it with HTTP methods rather than calling named functions, which keeps the interface predictable.

Methods map to actions

  • GET reads a resource.
  • POST creates a new one.
  • PUT or PATCH updates an existing one.
  • DELETE removes it.

Status codes carry meaning

REST leans on HTTP status codes to report outcomes: 200 for success, 201 for created, 400 for a bad request, 401 or 403 for auth problems, 404 for not found, and 5xx for server errors. A pipeline reads these to decide whether to proceed or fail.

Authentication

REST APIs usually require a token, often a bearer token or an OAuth credential, sent in an Authorization header. CI stores that token as a secret and attaches it to each call.

REST APIs in CI/CD

Triggering a deploy, creating a release, posting a status check, or querying a build result are all REST calls in many pipelines. A non-2xx response is the signal that the step should fail or retry.

Handling flaky API calls

A 5xx or a dropped connection on an idempotent GET is usually safe to retry; a 4xx means your request is wrong and retrying will not help. Latchkey runners automatically retry transient network failures to common API endpoints so brief upstream hiccups do not break a deploy step.

Key takeaways

  • REST exposes resources at URLs and acts on them with standard HTTP methods.
  • Status codes report outcomes, so non-2xx responses drive pipeline decisions.
  • Retry idempotent calls on 5xx or network errors, but never on a 4xx.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →