What Is a Schema?
A schema describes:- What your Action does (e.g., get an order, create a ticket)
- What parameters it needs (e.g., order number, email)
- What responses it expects (e.g., success, not found, server error)
The Required Minimum Structure
Your schema must contain five core sections:| Section | Purpose |
|---|---|
| openapi | Defines the OpenAPI version |
| info | Describes your Action |
| servers | Lists API base URLs |
| paths | Lists available endpoints and their parameters |
| components | Defines reusable objects and response examples |
Choosing Parameter Locations
Parameters tell your API what data you’re sending. They can live in paths, queries, or headers.Path Parameters
Used for identifying specific resources directly in the URL. Example:Query Parameters
Used for filtering or adding optional details. Example:Header Parameters
Used for authentication or metadata. Example:Authentication headers don’t go inside your schema in Watermelon — they’re added separately under Authentication Settings when creating the Action.
Defining Responses
Your schema must include response definitions for key status codes. Each tells the AI Agent what kind of reply to expect from the API.| Status Code | Meaning | Required? |
|---|---|---|
| 200 | Successful response | |
| 400 | Bad request (missing or invalid parameter) | Recommended |
| 404 | Not found | Recommended |
| 500 | Server error | Recommended |
Common YAML Mistakes
Small syntax errors can make your schema invalid. Here’s what to watch for:| Mistake | Description | Example |
|---|---|---|
| Wrong indentation | YAML is sensitive to spaces — use 2 spaces, no tabs | info:<br> title: test |
| Type mismatch | Wrong data type for a field | type: string for a number |
| Missing quotes | Special characters need quotes | ’3.0.0’ not 3.0.0 |
| Missing required fields | Missing openapi, info, or paths | |
| Inconsistent naming | Different field names in paths and components | |
| Enums or examples not matching actual data | Example data should reflect real structure |
Validation Flow in Watermelon
How to Validate
- In your Action setup, click Validate Schema.
- Watermelon checks:
- Syntax validity
- Required fields
- Correct parameter structure
- Supported OpenAPI version (3.0+)

What happens Next
- Valid Schema: You’ll see the available actions listed automatically. They’re now ready to use.
-
Invalid Schema:
You’ll get an error message with:
- The line number
- The column number
- The error type (e.g., missing field, bad indentation)
Quick Checklist Before You Publish
| Check | Description |
|---|---|
| ✔ OpenAPI version | Use at least 3.0.0 |
| ✔ Info section | Includes title, version, description |
| ✔ Servers | URL(s) defined correctly |
| ✔ Paths | Each path has summary, parameters, responses |
| ✔ Components | All references resolved with examples |
| ✔ Indentation | Two spaces per level, no tabs |
| ✔ Validation passed | Schema tested in Watermelon |
| ✔ Responses realistic | 200, 400, 404, 500 all defined |

