SoftwareTestPilot
API TestingPublished: 13 min read

Types of API Testing: 12 Kinds Explained With One Example

The main types of API testing explained: functional, contract, integration, security, load, negative and more, each shown on one orders API with a test plan.

SoftwareTestPilot
QA Editorial Team
Share:XLinkedInWhatsApp
Types of API Testing: 12 Kinds Explained With One Example: API Testing article cover, SoftwareTestPilot.com
Types of API Testing: 12 Kinds Explained With One Example: API Testing article cover, SoftwareTestPilot.com

Short answer

The main types of API testing are functional, validation, negative, integration, contract, end-to-end, security, performance (load, stress, spike, soak), reliability, fuzz, regression and smoke testing. They fall into three families: tests that check the API works, tests that check it holds up under pressure, and tests that check it is safe.

Below, each type gets a plain definition, what it catches, when to use it and its limits. Then all of them are applied to one example endpoint, so you can see how a real API test plan is built.

First, what is being tested?

An API (application programming interface) is the contract one program offers another: send this request, get that response. In API testing you skip the screen and send requests straight to the endpoint, then check the status code, response body, headers, response time and side effects (for example, a row created in the database).

Because there is no UI, API tests run fast and break less often than UI tests, which is why most teams put far more of them in their suite. If you are new to the basics, start with our API testing tutorial, then come back here.

Types of API testing at a glance

TypeQuestion it answersTypical toolsWhen it pays off most
FunctionalDoes the endpoint do what the spec says?Postman, REST Assured, PlaywrightEvery endpoint, every release
ValidationIs the response shape, type and format correct?JSON Schema checks in any frameworkPublic or widely used APIs
NegativeDoes bad input get a clear, safe error?Same as functionalForms, payments, anything user-driven
IntegrationDo real services work together?Framework tests in a shared environmentCalls to databases, queues, other services
ContractDoes provider still match what consumers expect?Pact, OpenAPI diff toolsMicroservices with separate teams
End-to-endDoes a full business flow work across APIs?Chained requests in any frameworkCheckout, sign-up, money movement
SecurityCan someone access or change what they should not?OWASP ZAP, Burp Suite, manual checksAnything with user data or auth
PerformanceHow fast is it, and where does it break?k6, JMeter, GatlingHigh-traffic or time-critical endpoints
ReliabilityDoes it recover from timeouts and failures?Fault injection, chaos toolsSystems that call unreliable services
FuzzDoes random or malformed input crash it?Schemathesis, RESTler, ZAP fuzzerParsers, public endpoints
RegressionDid a change break something that worked?Your whole automated suite in CIEvery merge
SmokeIs the build alive enough to test?A handful of fast checksRight after each deployment

Family 1: does the API work?

1. Functional testing

Sends valid requests and checks the API returns the right result. For a POST /orders that means: status 201 Created, an order id in the body, the right total, and the order actually saved. This is the base layer; every other type assumes it passes.

Limit: it proves the documented behaviour, not behaviour nobody thought to document.

2. Validation testing

Checks the shape of the response: required fields present, correct types (total is a number, not a string), date formats, enum values, headers such as Content-Type: application/json. A JSON Schema assertion covers most of this in one line, and catches the "a developer renamed a field" class of bug.

3. Negative testing

Sends requests that should fail: missing fields, wrong types, values out of range, unknown ids, expired tokens. The API should return a clear 4xx error (usually 400, 401, 403, 404 or 422) with a useful message, and never a 500 or a stack trace. Status code meanings are defined in RFC 9110.

Negative tests are where boundary value analysis and equivalence partitioning earn their keep; see worked test scenario and test case examples for how to derive them.

4. Integration testing

Runs the API against its real dependencies (database, message queue, payment sandbox) and checks they cooperate: the order is written, the stock is reduced, the event is published. It catches configuration and wiring faults that mocks hide.

Limit: slower and more fragile because it depends on shared environments.

5. Contract testing

Checks that a provider API still honours what its consumers rely on, without running both together. In consumer-driven contract testing, each consumer records the requests it sends and the fields it reads; the provider's build replays those expectations. Our Pact consumer and provider guide walks through a full example.

Contract vs integration: contract tests ask "do we still agree on the format?" and run fast in each team's own pipeline. Integration tests ask "does the whole thing actually work together?" You usually want both.

6. End-to-end API testing

Chains several calls into one business flow: create user, log in, add to cart, place order, check order history. It proves the journey works, but a failure tells you less about where the problem is, so keep these few and focused on critical paths.

Family 2: does the API hold up?

7. Performance testing

Performance is an umbrella for several distinct tests. Choose by the question you need answered:

Sub-typeWhat you doWhat you learn
LoadSend expected peak traffic for a fixed timeResponse times and error rate at normal peak
StressKeep increasing traffic past the expected peakWhere it breaks, and whether it fails cleanly
SpikeJump suddenly from low to very high trafficWhether scaling and queues cope with bursts
Soak (endurance)Hold moderate traffic for hoursMemory leaks, connection pool exhaustion, slow drift

Report percentiles (p95, p99), not just averages: an average of 200 ms can hide 1 in 20 users waiting several seconds. For tooling and scripts, see the performance testing guide.

Limit: results only mean something on an environment that resembles production. Never run them against a shared environment without warning the team.

8. Reliability testing

Checks behaviour when things go wrong around the API: a dependency times out, the database restarts, the network drops packets. Good APIs retry safely, time out instead of hanging, and return a clear 503 rather than corrupt data.

9. Fuzz testing

Generates large numbers of random or malformed inputs (huge strings, odd Unicode, nulls, nested JSON) to find crashes. Schema-driven fuzzers such as Schemathesis read your OpenAPI file and create the inputs for you, which makes fuzzing cheap to start.

Family 3: is the API safe?

10. Security testing

For APIs the biggest risk is usually authorisation, not clever hacking. Item one of the OWASP API Security Top 10 (2023) is Broken Object Level Authorization: user A changes an id in the URL and reads user B's order.

A practical checklist:

  • Authentication: no token, expired token, tampered token all get 401.
  • Object-level access: user A requesting user B's resource gets 403 or 404, never the data.
  • Function-level access: a normal user calling an admin endpoint is refused.
  • Input handling: injection payloads in fields and parameters are rejected, not executed.
  • Data exposure: responses do not leak fields the client does not need (password hashes, internal ids, other users' emails).
  • Rate limiting: repeated login attempts are throttled.

Token handling has its own pitfalls; our guide to testing JWT authentication covers them with code.

Keeping it working: regression and smoke

11. Regression testing

Re-runs existing API tests after every change to confirm nothing that worked has broken. In practice this is your functional, validation and negative suite running in CI on each merge. It is less a separate test and more a habit.

12. Smoke testing

A handful of fast checks run right after deployment: health endpoint returns 200, login works, one key read works. If smoke fails, stop; deeper testing on a broken build only produces noise.

You will also see UI-less "API monitoring" (scheduled smoke checks in production) and interoperability testing (checking clients in different languages or versions) listed as types. They are useful, but they are variations on the twelve above.

Worked example: one endpoint, every type

Illustrative example on a fictional API. Endpoint: POST /orders. A signed-in customer sends a product id and quantity; the API checks stock, charges a saved card through a payment service and returns the order.

POST /orders
Authorization: Bearer <customer-token>
Content-Type: application/json

{ "productId": "P-1001", "quantity": 2 }

201 Created
{ "orderId": "O-5531", "status": "PAID", "total": 1998.00, "currency": "INR" }
TypeExample check on POST /orders
FunctionalValid request returns 201, correct total (price x quantity), order appears in GET /orders/O-5531
ValidationBody matches schema: orderId string, total number, currency is one of the allowed codes
Negativequantity 0, -1, "two" and missing productId each return 400/422 with a message; unknown product returns 404
IntegrationStock for P-1001 drops by 2; payment sandbox shows one charge
ContractThe mobile app's recorded expectation (orderId, status, total) still passes against the provider build
End-to-endLog in, add to cart, POST /orders, then order history lists the new order
SecurityNo token gives 401; customer A cannot GET customer B's order; injection text in productId is rejected
PerformanceLoad test at expected peak keeps p95 under the team's agreed target with no errors
ReliabilityPayment service timeout returns a clear error and does not create a PAID order
FuzzSchema-driven fuzzing of the body produces no 500 responses
RegressionAll of the above automated checks run on every merge
SmokeAfter deploy, one valid order on a test account returns 201

Notice the reliability row: a timeout that still creates a PAID order means a customer is charged without knowing. That single check is often worth more than dozens of happy-path tests, and it only appears when you think in types.

Which types should you run first?

  1. Functional, validation and negative on every endpoint. Cheap to write, fast to run, find most defects.
  2. Security (authorisation) on anything touching user data. One missing ownership check can expose every customer.
  3. Integration and a few end-to-end flows for money, sign-up and other critical journeys.
  4. Contract once several teams or apps depend on the same API.
  5. Performance, reliability and fuzz when traffic, uptime or public exposure make them a real risk.
  6. Wire everything into CI so it becomes your regression suite, plus a short smoke set after deploys.

Common mistakes

  • Asserting only 200: a response can be 200 and still have the wrong total.
  • Skipping negative tests because "the frontend validates it" (attackers and other clients skip your frontend).
  • Testing authorisation with a single user account, which can never reveal cross-user access.
  • Reporting average response times instead of percentiles.
  • Hardcoding ids and tokens so tests fail on every new environment.

Interview-ready answer

"I group API testing into three families. To check it works: functional, validation, negative, integration, contract and end-to-end tests. To check it holds up: load, stress, spike, soak, reliability and fuzz testing. To check it is safe: security testing, especially authentication and object-level authorisation. Regression and smoke runs keep it all working over time. I start with functional and negative tests, then add the others based on risk."

Likely follow-ups: What is the difference between contract and integration testing? Which status code for a validation error? How would you test that one user cannot see another's data? More practice in our API testing interview questions.

Frequently asked questions

How many types of API testing are there?

There is no official number. Lists range from about seven to fifteen depending on whether sub-types such as load and stress are counted separately. Focus on what each type checks rather than the count.

Is API testing manual or automated?

Both. Exploring a new endpoint in a tool like Postman is manual; the functional, negative and regression checks you keep are usually automated. See our Postman API testing tutorial for both styles.

Does GraphQL need different types of testing?

The same families apply, but details change: most responses return 200 with errors in the body, and query depth limits matter for security. Our GraphQL API testing guide covers the differences.

Next step: practise each type

Reading about types only goes so far. Open the free API Playground and try them on a practice API: send a valid request (functional), break the body (negative), and try reading another workspace's data (security). If you want a structured path from there, the API testing course builds an automated suite step by step. Got a type you are unsure how to test? Ask it in the QA community.

Key takeaways

  1. 1Start with functional, validation and negative tests: they find the most defects for the least effort.
  2. 2Contract tests protect the agreement between services; integration tests check that real services work together. They are not the same thing.
  3. 3Load, stress and soak tests answer different questions, so pick one based on the risk you are worried about.
  4. 4Security testing for APIs is mostly about authorisation: can user A read or change user B's data?
  5. 5You rarely need every type on every endpoint. Match the type to the risk.

Common mistakes to avoid

  • Checking only the status code and never the response body or headers.
  • Testing only the happy path, so missing-field and wrong-type requests are never sent.
  • Running load tests against a shared environment without telling anyone.
  • Calling a contract test an integration test (or the reverse) and leaving a gap.