The API's last answer said a text: its detail (a refusal's reason, "Incorrect email or password"), or the text of the answer when it has no detail. Letter case and white space do not count.
Examples
Then the API should have said "Incorrect email or password"
Then the API should have said "Not authenticated"
And the API should have said "Item not found"
Then the API should have said "The user with this email already exists in the system"
But the API should have said "Could not validate credentials"
Pattern
Then(/^the API should have said "([^"]*)"$/, …)
Part of @webship-js/fastapi-steps (github.com/webship/fastapi-steps), a step pack for Webship-js 2.0.x.