PATCH /v1/user-stacks/\{id\}
Service: clinical · operationId: (none)
Update a user stack
Required scopes
(no scope declared — review service config)
Path parameters
id(string) required —
Request body
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"description": {
"type": [
"string",
"null"
]
},
"goals": {
"type": "array",
"items": {
"type": "string"
}
},
"cycle_pattern": {
"type": [
"object",
"null"
],
"properties": {
"onWeeks": {
"type": "integer",
"exclusiveMinimum": 0
},
"offWeeks": {
"type": "integer",
"minimum": 0
}
},
"required": [
"onWeeks",
"offWeeks"
]
},
"duration_weeks": {
"type": [
"integer",
"null"
],
"exclusiveMinimum": 0
},
"status": {
"type": "string"
},
"peptides": {
"type": "array",
"items": {
"type": "object",
"properties": {
"peptideId": {
"type": "string",
"minLength": 1
},
"peptideName": {
"type": "string",
"minLength": 1
},
"dosing": {
"type": [
"object",
"null"
],
"properties": {
"doseMcg": {
"type": "number"
},
"frequencyPerWeek": {
"type": "number"
},
"route": {
"type": "string"
}
},
"required": [
"doseMcg",
"frequencyPerWeek",
"route"
]
},
"sortOrder": {
"type": "integer",
"minimum": 0
}
},
"required": [
"peptideId",
"peptideName"
]
}
}
}
}Responses
200 Stack updated
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"user_id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"goals": {
"type": "array",
"items": {
"type": "string"
}
},
"cycle_pattern": {
"type": [
"object",
"null"
],
"properties": {
"onWeeks": {
"type": "integer",
"exclusiveMinimum": 0
},
"offWeeks": {
"type": "integer",
"minimum": 0
}
},
"required": [
"onWeeks",
"offWeeks"
]
},
"duration_weeks": {
"type": [
"number",
"null"
]
},
"source_stack_id": {
"type": [
"string",
"null"
],
"format": "uuid"
},
"status": {
"type": "string"
},
"peptides": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"peptide_id": {
"type": "string"
},
"peptide_name": {
"type": "string"
},
"dosing": {
"type": [
"object",
"null"
],
"properties": {
"doseMcg": {
"type": "number"
},
"frequencyPerWeek": {
"type": "number"
},
"route": {
"type": "string"
}
},
"required": [
"doseMcg",
"frequencyPerWeek",
"route"
]
},
"sort_order": {
"type": "number"
}
},
"required": [
"id",
"peptide_id",
"peptide_name",
"sort_order"
]
}
},
"share_token": {
"type": [
"string",
"null"
]
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"user_id",
"name",
"description",
"goals",
"duration_weeks",
"source_stack_id",
"status",
"peptides",
"share_token",
"created_at",
"updated_at"
]
}403 Forbidden
{
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"error",
"message"
]
}404 Not found
{
"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 PATCH https://clinical.platform.loop.health/v1/user-stacks/{id} \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'Related
services/clinical— service overview- All endpoints — directory across services
- Auth model — how scopes are enforced