# API Reference

## Get stack chart payload with version segments

> Returns token amounts for each allocation version segment so the frontend can build accurate historical charts across allocation edits. Includes a \`segments\` array with time ranges and per-version base amounts, plus a backwards-compatible \`tokens\` field with the current allocation.<br>

```json
{"openapi":"3.0.3","info":{"title":"Indexify API","version":"0.1.12-beta"},"servers":[{"url":"https://api.indexify.finance","description":"Production"}],"security":[],"paths":{"/api/charts.php?action=stack-chart-payload":{"get":{"operationId":"getStackChartPayload","summary":"Get stack chart payload with version segments","description":"Returns token amounts for each allocation version segment so the frontend can build accurate historical charts across allocation edits. Includes a `segments` array with time ranges and per-version base amounts, plus a backwards-compatible `tokens` field with the current allocation.\n","parameters":[{"name":"slug","in":"query","schema":{"type":"string"},"description":"Stack slug (either slug or stack_id required)."},{"name":"stack_id","in":"query","schema":{"type":"integer"},"description":"Stack ID (either slug or stack_id required)."},{"name":"bucket","in":"query","schema":{"type":"string","enum":["1s","1m","5m","30m","1h","24h"],"default":"5m"},"description":"Chart candle bucket size."},{"name":"endTime","in":"query","schema":{"type":"integer"},"description":"End timestamp for pagination."},{"name":"includeTokenValues","in":"query","schema":{"type":"string","enum":["true","false"]},"description":"Whether to include per-token values in the chart response."}],"responses":{"200":{"description":"Chart payload with version segments.","content":{"application/json":{"schema":{"type":"object","properties":{"stack_id":{"type":"integer"},"payload":{"type":"object","properties":{"segments":{"type":"array","description":"Version segments ordered chronologically. Each segment represents one allocation version with its time range and token base amounts.\n","items":{"type":"object","properties":{"version":{"type":"integer","description":"Version number (matches version_history endpoint)."},"start":{"type":"integer","description":"Unix timestamp when this allocation became active."},"end":{"type":"integer","nullable":true,"description":"Unix timestamp when this allocation was replaced. null for the current live allocation.\n"},"tokens":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string","description":"Solana token address."},"amount":{"type":"number","description":"Base token amount for this version."}}}}}}},"tokens":{"type":"array","description":"Current base token amounts (backwards compatibility).","items":{"type":"object","properties":{"address":{"type":"string"},"amount":{"type":"number"}}}},"bucket":{"type":"string"},"limit":{"type":"integer"},"includeTokenValues":{"type":"boolean"}}}}}}}},"400":{"description":"Missing parameters or invalid bucket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Stack not found or no base token amounts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}
```

## Get chart markers for a stack

> Returns buy/sell/inception/closed/allocation\_change markers for overlay on stack price charts. Requires authentication for buy/sell markers. Allocation change markers are included at each version transition point.<br>

```json
{"openapi":"3.0.3","info":{"title":"Indexify API","version":"0.1.12-beta"},"servers":[{"url":"https://api.indexify.finance","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key with the `ix_` prefix. You can generate an API Key by navigating to Settings -> API Key in the web app. Pass it in the `X-API-KEY` header on every request."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}},"paths":{"/api/charts.php?action=chart-markers":{"get":{"operationId":"getChartMarkers","summary":"Get chart markers for a stack","description":"Returns buy/sell/inception/closed/allocation_change markers for overlay on stack price charts. Requires authentication for buy/sell markers. Allocation change markers are included at each version transition point.\n","parameters":[{"name":"slug","in":"query","schema":{"type":"string"},"description":"Stack slug (either slug or stack_id required)."},{"name":"stack_id","in":"query","schema":{"type":"integer"},"description":"Stack ID (either slug or stack_id required)."},{"name":"start","in":"query","schema":{"type":"integer"},"description":"Start of time range (unix timestamp). Defaults to 30 days ago."},{"name":"end","in":"query","schema":{"type":"integer"},"description":"End of time range (unix timestamp). Defaults to now."}],"responses":{"200":{"description":"Chart markers within the requested time range.","content":{"application/json":{"schema":{"type":"object","properties":{"stack_id":{"type":"integer"},"start":{"type":"integer"},"end":{"type":"integer"},"markers":{"type":"array","items":{"type":"object","required":["type","time","time_iso"],"properties":{"type":{"type":"string","enum":["inception","closed","buy","sell","allocation_change"]},"time":{"type":"integer","description":"Unix timestamp."},"time_iso":{"type":"string","description":"ISO 8601 timestamp."},"order_id":{"type":"integer","description":"Present on buy/sell markers only."},"amount_usdc":{"type":"number","nullable":true,"description":"USDC amount, present on buy/sell markers only."},"status":{"type":"string","description":"Order status, present on buy/sell markers only."},"version":{"type":"integer","description":"The version that became active at this point. Present on allocation_change markers only.\n"},"creator_note":{"type":"string","nullable":true,"description":"Creator's note about the allocation change. Present on allocation_change markers only.\n"}}}}}}}}},"400":{"description":"Missing slug/stack_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Stack not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
