API Testing

SaaS API Testing: Real Test Cases Every QA Engineer Should Know

Practical SaaS API test cases for authentication, authorization, tenant isolation, CRUD, validation, pagination, idempotency, limits, and error contracts.

JobFitPilot Editorial · Practical career guides17 min read
In this guide

SaaS API testing must protect more than an endpoint. It must protect each tenant’s data, role boundaries, workflows, quotas, and integrations while many customers share the service.

The cases below are reusable prompts, not universal expected values. Bind status codes, field rules, rate limits, retention, and retry behavior to the actual API contract.

Start with the SaaS contract and tenant model

Map resources, operations, roles, tenant identifiers, authentication method, authorization rules, ownership, state transitions, quotas, and asynchronous effects. Prepare at least two isolated tenants and multiple roles so access tests are meaningful.

  • Tenant A and Tenant B each have identifiable records.
  • Admin, standard, read-only, and unauthenticated actors exist as applicable.
  • Tokens can be valid, expired, revoked, malformed, and issued for the wrong audience.
  • Resource identifiers are known across tenants.
  • The documented error schema and correlation mechanism are available.

Core SaaS API test-case matrix

Adapt every expected result to the API specification and business rules
ScenarioRequest/InputExpected ResultWhy It Matters
Valid authenticationValid token for Tenant ARequest succeeds only within the token scopeEstablishes the trusted baseline
Missing authenticationNo token or session credentialDocumented authentication error; no protected dataPrevents anonymous access
Expired or revoked tokenPreviously valid tokenRequest is rejected and no state changesProtects terminated sessions
Role authorizationRead-only user attempts create/update/deleteOperation is denied without a side effectEnforces least privilege
Cross-tenant readTenant A token requests Tenant B resource IDNo Tenant B data is disclosedPrevents a critical isolation failure
Cross-tenant writeTenant A token updates Tenant B resource IDNo Tenant B state changesProtects customer integrity
Create valid recordComplete valid payloadContract-defined success, identifier, and persisted recordValidates the primary write path
Missing required fieldOmit one required propertyValidation error identifies the safe, useful field contextProtects data quality
Malformed and wrong typeInvalid JSON or string where number is requiredDefined client error; service remains stableTests parser and schema defenses
Null and empty valuesnull, empty string, empty list, or omitted fieldEach follows its distinct contract meaningFinds ambiguous validation
Boundary inputMinimum, maximum, just below, just aboveOnly allowed values persistFinds off-by-one defects
Duplicate createSame logical request sent twiceContract-defined duplicate or idempotent behaviorPrevents duplicate business records
Idempotency replaySame idempotency key and same payloadOne side effect and a consistent responseMakes safe retries possible
Idempotency conflictSame key with a different payloadDefined conflict; original result is not overwrittenPrevents key misuse
PaginationFirst, middle, last, empty, and invalid cursor/pageStable boundaries with no unintended gaps or repeatsProtects collection traversal
Filter and sortValid combinations plus unsupported field/orderCorrect deterministic subset or documented errorPrevents silent query mistakes
Rate limitExceed the documented tenant/user limitDefined limit response and recovery headers/behaviorProtects fairness and client recovery
Downstream failureDependency timeout or error in controlled testDefined failure or fallback; no uncertain duplicate stateTests resilience
Response schemaValid and error responsesRequired fields, types, enums, and error shape match contractProtects consumers
Delete lifecycleDelete then read/update/delete againRetention and repeat behavior match the contractClarifies soft-delete and cleanup rules

Authentication, tokens, and session boundaries

Test token issuance and use separately. Cover correct and incorrect credentials, token expiry, refresh rotation, revocation, changed roles, changed tenant membership, issuer and audience validation, and concurrent sessions if supported.

Authorization test request headers
Authorization: Bearer <tenant-a-read-only-token>
X-Correlation-ID: qa-authz-001

Authorization and tenant isolation

Run an access matrix for every sensitive operation: actor role × owning tenant × resource tenant × state. Do not test isolation only on GET. Include list, search, export, counts, updates, deletes, batch operations, files, events, and indirect identifiers.

CRUD, validation, and state transitions

For create, read, update, and delete, verify both the response and authoritative persisted state. Test partial versus full updates, immutable fields, defaults, computed fields, version conflicts, forbidden transitions, and repeated deletion.

  • Unknown fields are rejected or ignored exactly as specified.
  • Omitted, null, empty, and default values remain distinguishable.
  • Failed requests do not partially persist data.
  • Updates cannot change tenant ownership or immutable identifiers.
  • Concurrent updates follow the versioning or conflict contract.
  • Soft-deleted records do not leak into normal collections.

Collections: pagination, filtering, and sorting

Seed enough deterministic data to cross a page boundary. Verify default and maximum page size, next/previous navigation, empty pages, cursor expiry if defined, stable sorting, tie-breakers, combined filters, special characters, and tenant-scoped totals.

Duplicates, idempotency, and request chaining

Use idempotency only where the contract supports it. Send the same key concurrently and sequentially, retry after a timeout, and compare the resulting resource and side effects. For chained workflows, pass created identifiers forward and verify cleanup when an intermediate step fails.

Idempotent create example
POST /v1/invoices
Idempotency-Key: qa-invoice-2026-09-20-001

{"customerId":"cust-a-17","amount":2500,"currency":"USD"}

Rate limits, quotas, and asynchronous work

Confirm whether limits apply per user, token, tenant, endpoint, or plan. Test just below, at, and above the documented boundary, then recovery after the defined window. For jobs and webhooks, test accepted, running, succeeded, failed, duplicated, delayed, and out-of-order states.

Schema and error-contract validation

Validate media type, required response fields, types, formats, enums, nullable fields, backward compatibility, and the standard error envelope. Check that errors include a stable machine-readable code and correlation evidence when the contract promises them.

  • Success and error bodies match their documented schemas.
  • Status codes align with the API contract and actual outcome.
  • No stack trace, secret, query, or cross-tenant detail is exposed.
  • Field-level validation remains deterministic and actionable.
  • Unknown enum values are handled safely by consumers.

Separate universal checks from API-specific checks

Authentication failures, authorization boundaries, input parsing, tenant isolation, error safety, and schema consistency are broadly reusable. Exact status codes, required fields, pagination style, idempotency support, quotas, retention, and workflow transitions belong to the specific API contract.

Use principles broadly, but derive expected values from the contract
Broadly reusableAPI-specific
No protected data without valid authorizationWhich roles may perform each operation
Malformed input must not crash the serviceWhich fields, formats, and limits are valid
One tenant must not access another tenantHow tenant context is represented
Errors must not expose sensitive internalsThe exact error code and message schema
State-changing retries need deliberate handlingWhich operations support idempotency and for how long
Question 11

How would you explain SaaS API testing in an interview?

Short answer

I test the endpoint contract and the SaaS boundaries around it. I prepare multiple tenants and roles, then cover authentication, authorization, tenant isolation, CRUD, validation, state transitions, pagination, filtering, sorting, duplicates, idempotency, rate limits, asynchronous work, schemas, and safe errors. I verify persisted and downstream effects, not only status codes, and I treat exact expectations as contract-specific.

Related guides