Skip to main content
A schema is essentially a blueprint: if it’s clear and valid, your Action will run smoothly; if not, you’ll run into validation or response errors. This guide explains how to write a strong, valid schema that works seamlessly in Watermelon.

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)
Schemas in Watermelon use the OpenAPI 3.0 standard, which defines RESTful APIs in a structured way.

The Required Minimum Structure

Your schema must contain five core sections: Here’s the simplest valid example:
Use an editor that handles .yml files like Visual Studio Code. This will help you with the indentations

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. Example:

Common YAML Mistakes

Small syntax errors can make your schema invalid. Here’s what to watch for:
Test your schema in Swagger Editor before uploading — it catches indentation and type errors instantly.

Validation Flow in Watermelon

How to Validate

  1. In your Action setup, click Validate Schema.
  2. Watermelon checks:
    • Syntax validity
    • Required fields
    • Correct parameter structure
    • Supported OpenAPI version (3.0+)
Writing Validating Schema

What happens Next

  1. Valid Schema: You’ll see the available actions listed automatically. They’re now ready to use.
  2. Invalid Schema: You’ll get an error message with:
    • The line number
    • The column number
    • The error type (e.g., missing field, bad indentation)
Copy the YAML into Swagger Editor, fix the error, and paste it back into Watermelon.

Quick Checklist Before You Publish