{
 "openapi": "3.0.3",
 "info": {
  "title": "RosterProof Exclusions API",
  "version": "1.0.0",
  "description": "Screen NPIs, people and organizations against the unified exclusion dataset (OIG LEIE, SAM.gov, FDA lists, 40 state Medicaid lists + DC). Weekly snapshot; every response carries a verify-before-adverse-action notice and source attribution. Not a fraud detector."
 },
 "servers": [
  {
   "url": "https://api.rosterproof.com"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "API key rp_live_… from POST /v1/keys"
   }
  }
 },
 "paths": {
  "/v1/status": {
   "get": {
    "summary": "Snapshot status and limits",
    "responses": {
     "200": {
      "description": "as_of, counts, limits"
     }
    }
   }
  },
  "/v1/keys": {
   "post": {
    "summary": "Issue an API key (free plan: 500 lookups per calendar month, 100 queries per request)",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "email": "you@organization.com",
        "org": "Example Health"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "{api_key} — shown once"
     }
    }
   }
  },
  "/v1/npi/{npi}": {
   "get": {
    "summary": "All records for one NPI",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "npi",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^\\d{10}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{npi, matches[]}"
     }
    }
   }
  },
  "/v1/screen": {
   "post": {
    "summary": "Batch screen (up to the plan's max queries per request; free plan 100)",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "examples": {
        "npis": {
         "value": {
          "npis": [
           "1891616215",
           "1234567893"
          ]
         }
        },
        "names": {
         "value": {
          "names": [
           {
            "last": "Smith",
            "first": "John",
            "state": "CA"
           }
          ]
         }
        },
        "organizations": {
         "value": {
          "organizations": [
           {
            "name": "Quality Poultry and Seafood Inc."
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{as_of, plan, results[], lookups, notice}"
     },
     "400": {
      "description": "more queries than the plan allows per request"
     },
     "429": {
      "description": "monthly plan limit reached: {error, message, plan, limit, resets_at}"
     }
    }
   }
  },
  "/v1/changes": {
   "get": {
    "summary": "Change feed (last 90 days)",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "since",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 1000,
       "maximum": 5000
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{changes[], next_cursor}"
     }
    }
   }
  }
 }
}