API ReferenceapiclinicalPOST /v1/adverse-events

POST /v1/adverse-events

Service: clinical · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "patient_id": {
      "type": "string",
      "minLength": 1
    },
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "peptide_id": {
      "type": "string",
      "minLength": 1
    },
    "symptoms": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "minItems": 1
    },
    "severity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "notes": {
      "type": "string"
    },
    "photo_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 3
    },
    "reported_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "patient_id",
    "brand_id",
    "peptide_id",
    "symptoms",
    "severity",
    "reported_at"
  ]
}

Responses

201 Adverse event recorded

{
  "type": "object",
  "properties": {
    "event": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "patient_id": {
          "type": "string"
        },
        "brand_id": {
          "type": "string"
        },
        "peptide_id": {
          "type": "string"
        },
        "symptoms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "severity": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "photos": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "s3_key": {
                "type": "string"
              },
              "caption": {
                "type": "string"
              },
              "content_type": {
                "type": "string"
              }
            },
            "required": [
              "s3_key",
              "content_type"
            ]
          }
        },
        "status": {
          "type": "string"
        },
        "reviewed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewed_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "review_note": {
          "type": [
            "string",
            "null"
          ]
        },
        "reported_at": {
          "type": "string",
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "patient_id",
        "brand_id",
        "peptide_id",
        "symptoms",
        "severity",
        "notes",
        "photos",
        "status",
        "reviewed_at",
        "reviewed_by",
        "review_note",
        "reported_at",
        "created_at"
      ]
    },
    "upload_urls": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "upload_url": {
            "type": "string"
          },
          "s3_key": {
            "type": "string"
          }
        },
        "required": [
          "upload_url",
          "s3_key"
        ]
      }
    }
  },
  "required": [
    "event",
    "upload_urls"
  ]
}

500 Internal error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://clinical.platform.loop.health/v1/adverse-events \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'