{
  "openapi": "3.1.0",
  "info": {
    "title": "RallyProp API",
    "version": "1",
    "summary": "Read-only preview of federal innovation funding opportunities.",
    "description": "Custom read API. Postgres does the filtering and pagination. This document is generated from the schemas that validate those requests and responses.\n\nCall the API from your server. Send `Authorization: Bearer rp_live_...`. Do not put the key in browser JavaScript.\n\nCurated workflows:\n\n- **Find opportunities:** `GET /opportunities?status=open,pre_release&source=NSTXL,GOCOLOSSEUM&limit=25`\n- **Fetch changes since your last sync:** `GET /opportunities?updated_since=2026-10-01T00:00:00Z&limit=25`. Store the newest `updated_at` and send it next time. This is not a substitute for event history.\n- **Retrieve a full opportunity:** `GET /opportunities/{id}` using the RallyProp UUID. Send the previous `ETag` as `If-None-Match` to receive `304` when it has not changed.\n\n`description` may contain source HTML. `links.next` is not a URL to forward. Repeat the same filters and append `meta.next_cursor`."
  },
  "externalDocs": {
    "description": "Integrator documentation",
    "url": "https://rallyprop.ai/docs/api"
  },
  "servers": [
    {
      "url": "https://eoqbgibebefvxxzadphf.supabase.co/functions/v1/external-api/v1",
      "description": "Hosted preview"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Connectivity"
    },
    {
      "name": "Opportunities"
    },
    {
      "name": "Documentation"
    }
  ],
  "paths": {
    "/meta": {
      "get": {
        "tags": [
          "Connectivity"
        ],
        "operationId": "getMeta",
        "summary": "Service metadata",
        "security": [],
        "responses": {
          "200": {
            "description": "Service name, version, and clock.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meta"
                },
                "examples": {
                  "live": {
                    "summary": "Live metadata",
                    "value": {
                      "data": {
                        "name": "RallyProp External API",
                        "version": "1",
                        "status": "preview",
                        "service_time": "2026-10-02T14:25:39.154Z"
                      },
                      "meta": {
                        "request_id": "61861094-989a-4538-bf1c-7a1d076552fa"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sources": {
      "get": {
        "tags": [
          "Connectivity"
        ],
        "operationId": "listSources",
        "summary": "Source catalog",
        "description": "Current source codes. The list is open-ended; display a code even if it is not in this catalog.",
        "responses": {
          "200": {
            "description": "Source codes and display names.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Daily quota for this key. Trial, starter, and paid plans differ.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests in the current daily window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Unix timestamp when the daily window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "API-Version": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/opportunities": {
      "get": {
        "tags": [
          "Opportunities"
        ],
        "operationId": "listOpportunities",
        "summary": "Find opportunities",
        "description": "Filtered listing ordered by `updated_at` descending, then `id` descending. Use `updated_since` to poll for records changed after a previous sync.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Comma-separated statuses.",
            "schema": {
              "type": "string",
              "description": "forecast, pre_release, open, closing_soon, closed, awarded, cancelled, archived"
            },
            "examples": {
              "findOpportunities": {
                "summary": "Find opportunities",
                "value": "open,pre_release"
              }
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Comma-separated source codes.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "findOpportunities": {
                "summary": "Find opportunities",
                "value": "NSTXL,GOCOLOSSEUM"
              }
            }
          },
          {
            "name": "agency",
            "in": "query",
            "required": false,
            "description": "Partial agency name match.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "program_type",
            "in": "query",
            "required": false,
            "description": "Comma-separated program types.",
            "schema": {
              "type": "string",
              "description": "SBIR, STTR, BAA, RFI, RFP, OTA, GRANT, CONTRACT, PRIZE, CSO, CRADA, INDUSTRY_EVENT, OTHER"
            }
          },
          {
            "name": "source_opportunity_id",
            "in": "query",
            "required": false,
            "description": "Source identifier. Requires exactly one source value.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "RFC 3339 timestamp. Returns records changed after this instant.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "changesSinceLastSync": {
                "summary": "Fetch changes since last sync",
                "value": "2026-10-01T00:00:00Z"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Integer from 1 to 100. Default 25.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from meta.next_cursor. Do not parse or modify it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of opportunities.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Daily quota for this key. Trial, starter, and paid plans differ.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests in the current daily window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Unix timestamp when the daily window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "API-Version": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityList"
                },
                "examples": {
                  "findOpportunities": {
                    "summary": "Find opportunities",
                    "description": "Recorded 2026-10-02. Description and taxonomy are shortened.",
                    "value": {
                      "data": [
                        {
                          "id": "57c6b61e-2333-4737-8186-139cd27b929a",
                          "source": {
                            "code": "GRANTS_GOV",
                            "name": "Grants.gov",
                            "opportunity_id": "363614",
                            "url": "https://www.grants.gov/search-results-detail/363614"
                          },
                          "title": "Engineering (ENG): Civil, Mechanical and Manufacturing Innovation (CMMI)",
                          "summary": "NSF seeks foundational research in civil infrastructure, advanced manufacturing, intelligent systems, and materials science. Projects should be intellectually ambitious with potential for transformative breakthroughs, not requiring near-term commercial outcomes.",
                          "description": "<p>The U.S. National Science Foundation Directorate for Engineering (NSF ENG) supports foundational research projects for civil, mechanical, and manufacturing innovation.</p>",
                          "status": "open",
                          "status_display": null,
                          "organization": {
                            "agency": "U.S. National Science Foundation",
                            "sub_agency": "U.S. National Science Foundation",
                            "issuing_office": null
                          },
                          "program": {
                            "type": "GRANT",
                            "solicitation_id": null,
                            "solicitation_title": null,
                            "contract_class": "innovation"
                          },
                          "funding": {
                            "currency": "USD",
                            "amount_min": null,
                            "amount_max": "100000000.00",
                            "display": "Est. $100,000,000 total across 275 awards"
                          },
                          "dates": {
                            "posted_at": null,
                            "opens_at": "2026-08-17T04:00:00+00:00",
                            "closes_at": "2076-08-26T04:00:00+00:00",
                            "response_at": "2076-08-26T04:00:00+00:00"
                          },
                          "classifications": {
                            "keywords": [
                              "CFDA:47.041",
                              "Science and Technology and other Research and Development",
                              "NSF"
                            ],
                            "technology_areas": [],
                            "tech_taxonomy": [
                              "Energy, Materials & Manufacturing → Advanced Materials → Additive Manufacturing",
                              "Sustainment, Climate & Infrastructure → Infrastructure & Construction → Civil Engineering"
                            ],
                            "naics_codes": [],
                            "set_aside_types": []
                          },
                          "eligibility": {
                            "requirements": null,
                            "geographic_scope": null
                          },
                          "contacts": [
                            {
                              "name": "U.S. National Science Foundation",
                              "email": "grantsgovsupport@nsf.gov",
                              "phone": "703-292-4203",
                              "role": null
                            }
                          ],
                          "value_estimate": null,
                          "relationships": {
                            "parent_id": null,
                            "canonical_id": null
                          },
                          "created_at": "2026-08-17T17:05:40.226765+00:00",
                          "updated_at": "2026-10-02T13:04:04.387352+00:00"
                        }
                      ],
                      "meta": {
                        "request_id": "8a4c1668-43c7-49bd-9178-e5587916c58e",
                        "count": 1,
                        "has_more": true,
                        "next_cursor": "eyJ2ZXJzaW9uIjoxLCJ1cGRhdGVkQXQiOiIyMDI2LTEwLTAyVDEzOjA0OjAzLjU3NTExKzAwOjAwIiwiaWQiOiIyNzZkYzQxZS1iNjQzLTQ5YWMtYTc2Mi04MDhhNGE0NzE1NzYiLCJmaWx0ZXJIYXNoIjoiaDFmVDE4ZldTRFB6UWU0RnNnSEdxb2RzWFBPbW9HYXpYRDNNbUNxRkNzYyJ9.0f-WxjPlazwMqt-kX3OV3VIHhnaNQDps6Ev_5zLCzuw"
                      },
                      "links": {
                        "self": "https://eoqbgibebefvxxzadphf.supabase.co/functions/v1/external-api/v1/opportunities?status=open%2Cpre_release&limit=1",
                        "next": "https://eoqbgibebefvxxzadphf.supabase.co/functions/v1/external-api/v1/opportunities?status=open%2Cpre_release&limit=1&cursor=opaque"
                      }
                    }
                  },
                  "changesSinceLastSync": {
                    "summary": "Fetch changes since last sync",
                    "description": "Curated from the same capture. This record's updated_at is after 2026-10-01T00:00:00Z. Store the newest updated_at and send it as updated_since on the next poll.",
                    "value": {
                      "data": [
                        {
                          "id": "57c6b61e-2333-4737-8186-139cd27b929a",
                          "source": {
                            "code": "GRANTS_GOV",
                            "name": "Grants.gov",
                            "opportunity_id": "363614",
                            "url": "https://www.grants.gov/search-results-detail/363614"
                          },
                          "title": "Engineering (ENG): Civil, Mechanical and Manufacturing Innovation (CMMI)",
                          "summary": "NSF seeks foundational research in civil infrastructure, advanced manufacturing, intelligent systems, and materials science. Projects should be intellectually ambitious with potential for transformative breakthroughs, not requiring near-term commercial outcomes.",
                          "description": "<p>The U.S. National Science Foundation Directorate for Engineering (NSF ENG) supports foundational research projects for civil, mechanical, and manufacturing innovation.</p>",
                          "status": "open",
                          "status_display": null,
                          "organization": {
                            "agency": "U.S. National Science Foundation",
                            "sub_agency": "U.S. National Science Foundation",
                            "issuing_office": null
                          },
                          "program": {
                            "type": "GRANT",
                            "solicitation_id": null,
                            "solicitation_title": null,
                            "contract_class": "innovation"
                          },
                          "funding": {
                            "currency": "USD",
                            "amount_min": null,
                            "amount_max": "100000000.00",
                            "display": "Est. $100,000,000 total across 275 awards"
                          },
                          "dates": {
                            "posted_at": null,
                            "opens_at": "2026-08-17T04:00:00+00:00",
                            "closes_at": "2076-08-26T04:00:00+00:00",
                            "response_at": "2076-08-26T04:00:00+00:00"
                          },
                          "classifications": {
                            "keywords": [
                              "CFDA:47.041",
                              "Science and Technology and other Research and Development",
                              "NSF"
                            ],
                            "technology_areas": [],
                            "tech_taxonomy": [
                              "Energy, Materials & Manufacturing → Advanced Materials → Additive Manufacturing",
                              "Sustainment, Climate & Infrastructure → Infrastructure & Construction → Civil Engineering"
                            ],
                            "naics_codes": [],
                            "set_aside_types": []
                          },
                          "eligibility": {
                            "requirements": null,
                            "geographic_scope": null
                          },
                          "contacts": [
                            {
                              "name": "U.S. National Science Foundation",
                              "email": "grantsgovsupport@nsf.gov",
                              "phone": "703-292-4203",
                              "role": null
                            }
                          ],
                          "value_estimate": null,
                          "relationships": {
                            "parent_id": null,
                            "canonical_id": null
                          },
                          "created_at": "2026-08-17T17:05:40.226765+00:00",
                          "updated_at": "2026-10-02T13:04:04.387352+00:00"
                        }
                      ],
                      "meta": {
                        "request_id": "8a4c1668-43c7-49bd-9178-e5587916c58e",
                        "count": 1,
                        "has_more": false,
                        "next_cursor": null
                      },
                      "links": {
                        "self": "https://eoqbgibebefvxxzadphf.supabase.co/functions/v1/external-api/v1/opportunities?updated_since=2026-10-01T00%3A00%3A00Z&limit=25",
                        "next": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported query parameter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "Key is not tied to an active subscription.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Daily or per-minute limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "http",
            "label": "Find opportunities",
            "source": "GET /opportunities?status=open,pre_release&source=NSTXL,GOCOLOSSEUM&limit=25\nAuthorization: Bearer rp_live_...\nAccept: application/json\n"
          },
          {
            "lang": "http",
            "label": "Fetch changes since last sync",
            "source": "GET /opportunities?updated_since=2026-10-01T00:00:00Z&limit=25\nAuthorization: Bearer rp_live_...\nAccept: application/json\n"
          }
        ]
      }
    },
    "/opportunities/{id}": {
      "get": {
        "tags": [
          "Opportunities"
        ],
        "operationId": "getOpportunity",
        "summary": "Retrieve a full opportunity",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "RallyProp opportunity UUID. Not a source solicitation number.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "examples": {
              "fullOpportunity": {
                "summary": "Retrieve a full opportunity",
                "value": "57c6b61e-2333-4737-8186-139cd27b929a"
              }
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "Previous ETag. Returns 304 when the opportunity is unchanged.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The opportunity. Includes ETag and Last-Modified.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Daily quota for this key. Trial, starter, and paid plans differ.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests in the current daily window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Unix timestamp when the daily window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "API-Version": {
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityDetail"
                },
                "examples": {
                  "fullOpportunity": {
                    "summary": "Retrieve a full opportunity",
                    "description": "Recorded 2026-10-02 for 57c6b61e-2333-4737-8186-139cd27b929a. Description and taxonomy are shortened.",
                    "value": {
                      "data": {
                        "id": "57c6b61e-2333-4737-8186-139cd27b929a",
                        "source": {
                          "code": "GRANTS_GOV",
                          "name": "Grants.gov",
                          "opportunity_id": "363614",
                          "url": "https://www.grants.gov/search-results-detail/363614"
                        },
                        "title": "Engineering (ENG): Civil, Mechanical and Manufacturing Innovation (CMMI)",
                        "summary": "NSF seeks foundational research in civil infrastructure, advanced manufacturing, intelligent systems, and materials science. Projects should be intellectually ambitious with potential for transformative breakthroughs, not requiring near-term commercial outcomes.",
                        "description": "<p>The U.S. National Science Foundation Directorate for Engineering (NSF ENG) supports foundational research projects for civil, mechanical, and manufacturing innovation.</p>",
                        "status": "open",
                        "status_display": null,
                        "organization": {
                          "agency": "U.S. National Science Foundation",
                          "sub_agency": "U.S. National Science Foundation",
                          "issuing_office": null
                        },
                        "program": {
                          "type": "GRANT",
                          "solicitation_id": null,
                          "solicitation_title": null,
                          "contract_class": "innovation"
                        },
                        "funding": {
                          "currency": "USD",
                          "amount_min": null,
                          "amount_max": "100000000.00",
                          "display": "Est. $100,000,000 total across 275 awards"
                        },
                        "dates": {
                          "posted_at": null,
                          "opens_at": "2026-08-17T04:00:00+00:00",
                          "closes_at": "2076-08-26T04:00:00+00:00",
                          "response_at": "2076-08-26T04:00:00+00:00"
                        },
                        "classifications": {
                          "keywords": [
                            "CFDA:47.041",
                            "Science and Technology and other Research and Development",
                            "NSF"
                          ],
                          "technology_areas": [],
                          "tech_taxonomy": [
                            "Energy, Materials & Manufacturing → Advanced Materials → Additive Manufacturing",
                            "Sustainment, Climate & Infrastructure → Infrastructure & Construction → Civil Engineering"
                          ],
                          "naics_codes": [],
                          "set_aside_types": []
                        },
                        "eligibility": {
                          "requirements": null,
                          "geographic_scope": null
                        },
                        "contacts": [
                          {
                            "name": "U.S. National Science Foundation",
                            "email": "grantsgovsupport@nsf.gov",
                            "phone": "703-292-4203",
                            "role": null
                          }
                        ],
                        "value_estimate": null,
                        "relationships": {
                          "parent_id": null,
                          "canonical_id": null
                        },
                        "created_at": "2026-08-17T17:05:40.226765+00:00",
                        "updated_at": "2026-10-02T13:04:04.387352+00:00"
                      },
                      "meta": {
                        "request_id": "2a420f1f-6a9d-405a-8f2d-90254b06939a"
                      }
                    }
                  }
                }
              }
            }
          },
          "304": {
            "description": "Not modified. Empty body."
          },
          "400": {
            "description": "opportunity id is not a UUID.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No opportunity with that UUID.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "http",
            "label": "Retrieve a full opportunity",
            "source": "GET /opportunities/57c6b61e-2333-4737-8186-139cd27b929a\nAuthorization: Bearer rp_live_...\nAccept: application/json\n"
          }
        ]
      }
    },
    "/opportunities/{id}/events": {
      "get": {
        "tags": [
          "Opportunities"
        ],
        "operationId": "listOpportunityEvents",
        "summary": "Opportunity change history",
        "description": "Field-level history for one opportunity. Ordered by detected_at descending, then id descending. Noise and cosmetic events are omitted unless include_insignificant=true.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "RallyProp opportunity UUID. Not a source solicitation number.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "examples": {
              "fullOpportunity": {
                "summary": "Retrieve a full opportunity",
                "value": "57c6b61e-2333-4737-8186-139cd27b929a"
              }
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Comma-separated event types.",
            "schema": {
              "type": "string",
              "description": "opportunity_added, opportunity_removed, status_changed, date_changed, funding_changed, description_changed, qanda_updated, attachments_changed, field_updated"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "RFC 3339 timestamp.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_insignificant",
            "in": "query",
            "required": false,
            "description": "Include noise and cosmetic events. true or false. Default false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Integer from 1 to 100. Default 25.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from meta.next_cursor. Do not parse or modify it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of events.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Daily quota for this key. Trial, starter, and paid plans differ.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests in the current daily window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Unix timestamp when the daily window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "API-Version": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityEventList"
                },
                "examples": {
                  "fieldChange": {
                    "summary": "Material field change",
                    "value": {
                      "data": [
                        {
                          "id": "f75aa4ae-2170-4482-8a15-8c4b546354d2",
                          "opportunity_id": "57c6b61e-2333-4737-8186-139cd27b929a",
                          "type": "field_updated",
                          "severity": "material",
                          "summary": "Funding, eligibility, contact information changed.",
                          "changed_fields": [
                            "number_of_awards",
                            "estimated_funding"
                          ],
                          "changes": [
                            {
                              "field": "number_of_awards",
                              "previous": null,
                              "current": 275
                            },
                            {
                              "field": "estimated_funding",
                              "previous": null,
                              "current": 100000000
                            }
                          ],
                          "detected_at": "2026-10-02T13:04:04.756415+00:00"
                        }
                      ],
                      "meta": {
                        "request_id": "c2d8680c-6678-4a49-93d7-5162b6f3dac3",
                        "count": 1,
                        "has_more": true,
                        "next_cursor": "opaque-cursor"
                      },
                      "links": {
                        "self": "https://eoqbgibebefvxxzadphf.supabase.co/functions/v1/external-api/v1/opportunities/57c6b61e-2333-4737-8186-139cd27b929a/events?limit=1",
                        "next": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid event filter.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "No opportunity with that UUID.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "Documentation"
        ],
        "operationId": "getOpenApi",
        "summary": "This OpenAPI document",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document."
          }
        }
      }
    },
    "/docs": {
      "get": {
        "tags": [
          "Documentation"
        ],
        "operationId": "getDocs",
        "summary": "Interactive API reference",
        "security": [],
        "responses": {
          "200": {
            "description": "HTML reference rendered from this document.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "rp_live_",
        "description": "RallyProp API key for an active subscription."
      }
    },
    "schemas": {
      "Opportunity": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "source",
          "title",
          "summary",
          "description",
          "status",
          "status_display",
          "organization",
          "program",
          "funding",
          "dates",
          "classifications",
          "eligibility",
          "contacts",
          "value_estimate",
          "relationships",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "name",
              "opportunity_id",
              "url"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "opportunity_id": {
                "type": "string"
              },
              "url": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source text. May contain HTML. Sanitize before rendering."
          },
          "status": {
            "type": "string",
            "description": "Known values: forecast, pre_release, open, closing_soon, closed, awarded, cancelled, archived. Unknown values can appear; render them."
          },
          "status_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "organization": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "agency",
              "sub_agency",
              "issuing_office"
            ],
            "properties": {
              "agency": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sub_agency": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "issuing_office": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "program": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "solicitation_id",
              "solicitation_title",
              "contract_class"
            ],
            "properties": {
              "type": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "solicitation_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "solicitation_title": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "contract_class": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "funding": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "currency",
                  "amount_min",
                  "amount_max",
                  "display"
                ],
                "properties": {
                  "currency": {
                    "type": "string",
                    "const": "USD"
                  },
                  "amount_min": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_max": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "display": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            ]
          },
          "dates": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "posted_at",
              "opens_at",
              "closes_at",
              "response_at"
            ],
            "properties": {
              "posted_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "opens_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "closes_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "response_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "classifications": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "keywords",
              "technology_areas",
              "tech_taxonomy",
              "naics_codes",
              "set_aside_types"
            ],
            "properties": {
              "keywords": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "technology_areas": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tech_taxonomy": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "naics_codes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "set_aside_types": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "eligibility": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "requirements",
              "geographic_scope"
            ],
            "properties": {
              "requirements": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "geographic_scope": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "email",
                "phone",
                "role"
              ],
              "properties": {
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "phone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "role": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "value_estimate": {
            "const": null
          },
          "relationships": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "parent_id",
              "canonical_id"
            ],
            "properties": {
              "parent_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "canonical_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OpportunityEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "opportunity_id",
          "type",
          "severity",
          "summary",
          "changed_fields",
          "changes",
          "detected_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "opportunity_id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "description": "Known values: opportunity_added, opportunity_removed, status_changed, date_changed, funding_changed, description_changed, qanda_updated, attachments_changed, field_updated. An unrecognized stored type is returned as unknown."
          },
          "severity": {
            "type": "string",
            "description": "Known values: noise, cosmetic, informational, material, critical, unknown."
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "changed_fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "field",
                "previous",
                "current"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "previous": {},
                "current": {}
              }
            }
          },
          "detected_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Source": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "name",
          "description"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Problem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail",
          "instance",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "field",
                "reason"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RequestMeta": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "request_id"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          }
        }
      },
      "PageMeta": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "request_id",
          "count",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PageLinks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "self",
          "next"
        ],
        "properties": {
          "self": {
            "type": "string"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "OpportunityList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Opportunity"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PageMeta"
          },
          "links": {
            "$ref": "#/components/schemas/PageLinks"
          }
        }
      },
      "OpportunityDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Opportunity"
          },
          "meta": {
            "$ref": "#/components/schemas/RequestMeta"
          }
        }
      },
      "OpportunityEventList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta",
          "links"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpportunityEvent"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PageMeta"
          },
          "links": {
            "$ref": "#/components/schemas/PageLinks"
          }
        }
      },
      "SourceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/RequestMeta"
          }
        }
      },
      "Meta": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "version",
              "status",
              "service_time"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "service_time": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/RequestMeta"
          }
        }
      }
    }
  }
}
