{
  "openapi": "3.1.0",
  "info": {
    "title": "RM AgentHub public API",
    "version": "1.0.0",
    "description": "Read-only access to publicly active, owner-verified paid sponsor campaigns. Unpaid editorial prospect records are not exposed."
  },
  "servers": [
    {
      "url": "/api/v1",
      "description": "Versioned public API"
    }
  ],
  "paths": {
    "/resources": {
      "get": {
        "summary": "List active sponsor campaigns",
        "description": "Newest-first list of approved active sponsored campaigns. Use next_cursor for pagination.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "Free-text match on name, tagline and description.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Category slug, e.g. agent-frameworks.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-50. Defaults to 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "ISO 8601 timestamp from next_cursor of the previous page.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of resources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceList"
                }
              }
            }
          },
          "404": {
            "description": "Unknown category slug"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ResourceList": {
        "type": "object",
        "required": [
          "api_version",
          "count",
          "data"
        ],
        "properties": {
          "api_version": {
            "type": "string",
            "example": "v1"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "disclosure": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Resource"
            }
          }
        }
      },
      "Resource": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "url",
          "is_sponsored"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tagline": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "Category slug"
          },
          "pricing": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_sponsored": {
            "type": "boolean",
            "description": "True only while a labelled sponsored placement is live."
          },
          "is_example": {
            "type": "boolean",
            "description": "True for clearly marked demonstration entries."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "detail_url": {
            "type": "string"
          }
        }
      }
    }
  }
}