---
title: "Give every response one shape · Agent Wranglers"
url: https://agentwranglers.se/playbook/api-design/requests-and-responses/response-shape
updated: 2026-10-20
licence: "All rights reserved"
---

# Give every response one shape

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Requests and responses](https://agentwranglers.se/playbook/api-design/requests-and-responses)
- Rule: Return the same fields of the same types every time, and describe them in the contract. Leave out a field only when the contract says it is optional.
- How: Decide per field whether it is required. Never switch a field between an object, a list and `null`. See [one return type](https://agentwranglers.se/playbook/architecture/data-shapes/one-return-type). Return only the fields a caller may see, as in [only needed fields](https://agentwranglers.se/playbook/adversarial-testing/data-and-secrets/only-needed-fields).
- Check: Contract tests validate every response against its schema with `additionalProperties: false`, and they pass. Schemas built with `allOf` use `unevaluatedProperties: false` instead, because `additionalProperties` can't see fields from the other parts.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/requests-and-responses/response-shape`.

- Previous: [Send IDs as strings](https://agentwranglers.se/playbook/api-design/requests-and-responses/string-ids)
- Next: [Use enums for fixed values](https://agentwranglers.se/playbook/api-design/requests-and-responses/api-enums)
- [Requests and responses](https://agentwranglers.se/playbook/api-design/requests-and-responses)
