POST /v1/vials

Service: clinical · operationId: (none)

Create a reconstituted vial record for a user

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "user_id": {
      "type": "string",
      "minLength": 1
    },
    "peptide_id": {
      "type": "string",
      "minLength": 1
    },
    "reconstituted_at": {
      "type": "string",
      "format": "date-time"
    },
    "current_volume_ml": {
      "type": "number",
      "minimum": 0
    }
  },
  "required": [
    "user_id",
    "peptide_id",
    "reconstituted_at",
    "current_volume_ml"
  ]
}

Responses

201 Vial created

{
  "type": "object",
  "properties": {
    "vial_id": {
      "type": "string",
      "format": "uuid"
    },
    "user_id": {
      "type": "string"
    },
    "peptide_id": {
      "type": "string"
    },
    "reconstituted_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "discarded_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "current_volume_ml": {
      "type": "number",
      "minimum": 0
    }
  },
  "required": [
    "vial_id",
    "user_id",
    "peptide_id",
    "reconstituted_at",
    "expires_at",
    "discarded_at",
    "current_volume_ml"
  ]
}

400 Validation error

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

403 Forbidden

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

500 Internal server error

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

Example

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