Skip to content
IT glossary
TestingUpdated December 3, 2026

API testing

Тестирование API

API testing checks how software responds when another program calls it, including whether it returns the right data, carries out the requested action, and reports errors as expected.

What an API test tells you

When a user clicks Create task, the app might send a request to a backend service. An API test sends that request directly. It can tell you whether the service creates the task correctly, without depending on a browser or a finished user interface. It cannot tell you whether the button is visible or wired up correctly.

What to check

Start with the API contract: what callers can send and what they can expect back. For an HTTP API, an OpenAPI document can describe the method, path, parameters, and response schema. Product requirements often supply business rules that the schema alone cannot express, such as whether tasks can be added to an archived project.

Set up the data the test needs, make the request, and compare the result with those expectations. Check the HTTP status and any relevant headers, then check both the shape of the response and the values that matter. A response can match the schema and still contain the wrong task title. For operations that change data, check the effect too: a successful response doesn't prove the change was saved.

Example: creating a task

Suppose the contract says that POST /tasks creates a task and rejects an empty title. On a test instance, two cases might look like this:

POST /tasks {"title": "Draft release notes"}
Expect: 201 Created, a task ID, and the submitted title.
GET /tasks/{id}
Expect: 200 OK and the task just created.

POST /tasks {"title": ""}
Expect: 400 Bad Request and a validation error for title.

Use the status code specified by the API. Another service might return 422 for a well-formed request whose content fails validation. If the contract sets a maximum title length, test values at that limit and just beyond it.

Tools and common mistakes

Postman is a tool, not another name for API testing. It's useful for exploring requests manually and saving them in collections with assertions. Teams also write API tests with tools such as pytest and run them in CI to catch regressions.

Testing through an API describes how you interact with the system, not how much of the system is under test. A test with a real database can cover that integration; one with a stubbed database cannot. In either setup, give each test its own data where possible. If cases share a mutable record, they may pass individually but fail when run in a different order or in parallel.

In interviews

A common prompt is “How would you test this endpoint?” Start by clarifying the expected behavior, then give a small set of cases with concrete inputs and assertions. For task creation, explain how you'd distinguish a correctly formatted success response from a task that was actually saved.