> ## Documentation Index
> Fetch the complete documentation index at: https://watermelon.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ReadMe template

The ReadMe Custom Action connects your Agent to ReadMe so it can retrieve information from your ReadMe Guides and use it when answering customer questions.

This setup includes:

* A predefined OpenAPI schema for ReadMe
* Basic authentication
* The required ReadMe API BaseURL
* A health check configuration

After setting up the Action, you can validate it, activate it, and test it in the Playground.

## Set up the action

1. Go to **Actions** in Watermelon.
2. In the **Actions catalog**, click **Custom action**.
3. Click **Create new Action**.
4. Fill in the fields below.

### General details

**Action name**<br />`ReadMe Guide Retrieval`

**Description**<br />`This action lets you retrieve information from ReadMe Guides and use it when answering customer questions.`

**BaseURL**<br />`https://dash.readme.com/api/v1`

### Authentication

For **Authorization Header**, select **Basic**.

**Username**<br />`rdme_api_key`

Replace this with your ReadMe API key.

**Password**<br />Leave this field empty.

### Health check

**Health check URL**<br />`https://www.yourdomain.com/health_check`

Replace this URL with the health check endpoint you want Watermelon to use.

**Instruction**

> You should respond with the following message or a similar variation: Sorry, something went wrong on our end. Can I assist you with anything else? Please let me know how I can help.

### Schema

Paste the ReadMe schema into the **Schema** field:

```text theme={null}
openapi: 3.0.0
info:
  title: Custom Pages API
  version: "1.0.0"
servers:
  - url: https://dash.readme.com/api
paths:
  /docs/{slug}:
    get:
      summary: Search custom page 
      description: Search for information from the ReadMe API when user asks a question, try to formulate a title based on the input.
      parameters:
        - in: path
          name: slug
          required: true
          description: A URL-safe representation of the page title. Slugs must be all lowercase, and replace spaces with hyphens. For example, for the title "Getting Started", enter the slug "getting-started". Uses slug to search the database. 
          schema: 
            type: string
      responses:
        '200':
          description: The custom page exists and has been returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    type: string
                    description: Title of the custom page
                  content:
                    type: string
                    description: HTML or Markdown content of the custom page
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: "APIKEY_NOTFOUND"
                  message:
                    type: string
                    example: "We couldn't find your API key."
                  suggestion:
                    type: string
                    example: "The API key you passed in (ZWid...) isn't valid..."
                  docs:
                    type: string
                    example: "https://docs.readme.com/main/logs/c554008f-..."
                  help:
                    type: string
                    example: "https://docs.readme.com/main/reference"
                  poem:
                    type: array
                    items:
                      type: string
                    example:
                      - "The ancient gatekeeper declares:"
                      - "'To pass, reveal your API key.'"
                      - "'ZWid?...' you start to ramble."
                      - "'Oops, you remembered it poorly!'"
        '403':
          description: Forbidden - You lack permissions to access this resource.
        '404':
          description: The custom page could not be found.
```

Click **Validate** to check the schema.

### Example in Watermelon

<Frame>
  <img src="https://mintcdn.com/watermelon/U1o80ZmdmQTd06X6/images/ReadMe-action-template.png?fit=max&auto=format&n=U1o80ZmdmQTd06X6&q=85&s=5934d054471cc587bbf795b0b5442bdb" alt="Read Me Action Template" width="3840" height="1864" data-path="images/ReadMe-action-template.png" />
</Frame>

When everything is configured correctly, click **Save** and then **Activate**.

Finally, test the Action in the **Playground** to make sure your Agent can retrieve the expected information from ReadMe.

## Editing an Action Template

After setting up an Action, you can adjust it to your use case. For example, you can add endpoints to the schema, change parameters, or update the name and description.

Be careful when changing authentication settings or existing endpoints, as this can prevent the Action from connecting to the API.

## Troubleshooting

| Issue                                        | Likely cause                            | What to check                                             |
| :------------------------------------------- | :-------------------------------------- | :-------------------------------------------------------- |
| **Validation failed**                        | Invalid OpenAPI schema                  | Check the schema for missing or unsupported fields.       |
| **401 Unauthorized**                         | Incorrect ReadMe credentials            | Check your ReadMe API key.                                |
| **404 Not Found**                            | Incorrect endpoint                      | Check the BaseURL and endpoint path.                      |
| **Action does not return the expected data** | Schema or parameter mismatch            | Check the endpoint parameters and API response structure. |
| **Health check fails**                       | Health check endpoint cannot be reached | Check the Health check URL and authentication.            |
