{
  "openapi": "3.0.3",
  "info": {
    "title": "Global Patient Safety pipeline",
    "version": "1",
    "description": "Registry facts from ClinicalTrials.gov. Not efficacy or safety conclusions. FAERS signals stay on https://faers.mobi/signals. VAERS signals stay on https://vaers.globalpatientsafety.com/signals (docs: https://vaers.globalpatientsafety.com/api)."
  },
  "servers": [
    {
      "url": "https://globalpatientsafety.com"
    }
  ],
  "paths": {
    "/pipeline": {
      "get": {
        "operationId": "getPipeline",
        "summary": "ClinicalTrials.gov studies for one sponsor",
        "parameters": [
          {
            "name": "sponsor",
            "in": "query",
            "required": true,
            "description": "Matched against the lead sponsor name unless role says otherwise. A family name that contains the query counts. Not expanded to other companies.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "description": "Default lead. collaborator is collaborator-only. any is lead or collaborator, the ClinicalTrials.gov sponsor search.",
            "schema": {
              "type": "string",
              "enum": [
                "lead",
                "collaborator",
                "any"
              ],
              "default": "lead"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Omitted means ongoing studies. ALL means every status.",
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "RECRUITING",
                "ENROLLING_BY_INVITATION",
                "NOT_YET_RECRUITING",
                "ACTIVE_NOT_RECRUITING",
                "COMPLETED",
                "SUSPENDED",
                "TERMINATED",
                "WITHDRAWN",
                "UNKNOWN",
                "AVAILABLE",
                "NO_LONGER_AVAILABLE",
                "TEMPORARILY_NOT_AVAILABLE",
                "APPROVED_FOR_MARKETING",
                "WITHHELD"
              ]
            }
          },
          {
            "name": "phase",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "EARLY_PHASE1",
                "PHASE1",
                "PHASE2",
                "PHASE3",
                "PHASE4",
                "NA"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "brief",
                "html"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Studies, an empty match, HTML, or a brief"
          },
          "400": {
            "description": "Missing sponsor or a bad filter"
          },
          "502": {
            "description": "ClinicalTrials.gov returned an error"
          },
          "503": {
            "description": "ClinicalTrials.gov did not respond"
          }
        }
      }
    }
  }
}
