API ReferenceapiclinicalPOST /v1/user-stacks/{id}/fork

POST /v1/user-stacks/\{id\}/fork

Service: clinical · operationId: (none)

Fork a stack into the current user’s library

Required scopes

(no scope declared — review service config)

Path parameters

  • id (string) required

Responses

201 Forked stack

{
  "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 Source 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 POST https://clinical.platform.loop.health/v1/user-stacks/{id}/fork \
  -H "Authorization: Bearer $ACCESS_TOKEN"