---
title: "Use enums for fixed values · Agent Wranglers"
url: https://agentwranglers.se/playbook/api-design/requests-and-responses/api-enums
updated: 2026-10-20
licence: "All rights reserved"
---

# Use enums for fixed values

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

- Level: Recommended
- Chapter: [Requests and responses](https://agentwranglers.se/playbook/api-design/requests-and-responses)
- Rule: Give every field with a fixed set of values an enum in the contract, and document what each value means.
- How: Use stable lowercase strings, such as `"pending"` and `"shipped"`. Tell clients to treat an unknown value as a safe default, because you may add values later.
- Check: Every status or type field in the OpenAPI file has `enum`, and a client test with an unknown value does not crash.

**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/api-enums`.

- Previous: [Give every response one shape](https://agentwranglers.se/playbook/api-design/requests-and-responses/response-shape)
- Next: [Accept only fields you know](https://agentwranglers.se/playbook/api-design/requests-and-responses/strict-input)
- [Requests and responses](https://agentwranglers.se/playbook/api-design/requests-and-responses)
