> For the complete documentation index, see [llms.txt](https://howto.indexify.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://howto.indexify.finance/indexify-api-documentation/stacks.md).

# Stacks

## Stack information, discovery, management, and holdings

> Unified endpoint for all stack operations. The \`action\` query parameter selects the sub-operation. Request/response shapes vary by action.<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":{"StackObject":{"type":"object","description":"Canonical stack representation returned by discovery and fetch actions. Exact fields may vary by context (discovery vs portfolio vs trending).\n","properties":{"id":{"type":"integer"},"stack_name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"topic":{"type":"string","nullable":true,"description":"Stack risk/duration category."},"creator_fee":{"type":"number"},"price":{"type":"number","nullable":true},"weighted_market_cap":{"type":"number","nullable":true},"change4H":{"type":"number","nullable":true},"change1D":{"type":"number","nullable":true},"change1W":{"type":"number","nullable":true},"change1M":{"type":"number","nullable":true},"changeAll":{"type":"number","nullable":true},"token_count":{"type":"integer"},"investor_count":{"type":"integer"},"is_company_stack":{"type":"boolean"},"archived":{"type":"boolean"},"show_creator_holdings":{"type":"boolean"},"created_at":{"type":"integer","description":"Unix timestamp."},"time_p":{"type":"integer","nullable":true,"description":"Unix timestamp of last price update."},"tvl":{"type":"number","nullable":true,"description":"Total Value Locked in USD. Only present when tvl=true in request."},"user":{"type":"object","description":"Public creator profile.","properties":{"username":{"type":"string"},"avatar":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true},"stacks_count":{"type":"integer"},"telegram":{"type":"string","nullable":true},"discord":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"linkedin":{"type":"string","nullable":true},"personal":{"type":"string","nullable":true}}},"tokens":{"type":"array","description":"Token allocations within the stack.","items":{"type":"object","properties":{"address":{"type":"string"},"symbol":{"type":"string"},"name":{"type":"string"},"image_url":{"type":"string","nullable":true},"weight":{"type":"number"},"is_verified":{"type":"boolean"}}}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}},"paths":{"/api/stack_info.php":{"post":{"tags":["Stacks"],"summary":"Stack information, discovery, management, and holdings","description":"Unified endpoint for all stack operations. The `action` query parameter selects the sub-operation. Request/response shapes vary by action.\n","parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","enum":["paginated_list","trending","official","related_stacks","fetch","my_stacks","create","update","close","edit_allocation","version_history","check_name","check_description","user_stack_holdings","get_creator_holdings","investors","followers"]},"description":"The sub-action to invoke."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"title":"paginated_list","type":"object","required":["limit","offset"],"properties":{"limit":{"type":"integer","description":"Number of stacks to return."},"offset":{"type":"integer","description":"Pagination offset."},"sort":{"type":"string","enum":["change4H","change1D","change1W","change1M","changeAll","newest","oldest","price","mcap","time_p","stackIds"],"description":"Sort field."},"order":{"type":"string","enum":["ASC","DESC"],"description":"Sort direction."},"categories":{"type":"array","items":{"type":"string"},"description":"Filter by stack risk categories."},"token_categories":{"type":"array","items":{"type":"string"},"description":"Filter by token categories."},"token_categories_match_all":{"type":"boolean","description":"When true, stack must contain tokens matching ALL listed token_categories."},"following":{"type":"string","enum":["all","following","not_following"],"description":"Filter by follow status (requires auth)."},"userIds":{"type":"array","items":{"type":"integer"},"description":"Filter by creator user IDs."},"usernames":{"type":"array","items":{"type":"string"},"description":"Filter by creator usernames."},"stackIds":{"type":"array","items":{"type":"integer"},"description":"Filter by specific stack IDs."},"slugs":{"type":"array","items":{"type":"string"},"description":"Filter by stack slugs."},"price_min":{"type":"number","description":"Minimum stack price filter."},"price_max":{"type":"number","description":"Maximum stack price filter."},"mcap_min":{"type":"number","description":"Minimum weighted market cap filter."},"mcap_max":{"type":"number","description":"Maximum weighted market cap filter."},"token_count_from":{"type":"integer","description":"Minimum number of tokens in the stack."},"archived":{"type":"boolean","description":"Include archived stacks."},"closed":{"type":"boolean","description":"Include closed stacks."},"tvl":{"type":"boolean","description":"Include TVL (Total Value Locked) in response."},"context":{"type":"string","enum":["discovery","portfolio","trending","my_stacks","search","admin","auto"],"description":"Response context hint. Defaults to auto."}}},{"title":"trending","type":"object","properties":{"limit":{"type":"integer","maximum":50,"description":"Max results (capped at 50)."},"offset":{"type":"integer","description":"Pagination offset."},"categories":{"type":"array","items":{"type":"string"}},"token_categories":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}},"userIds":{"type":"array","items":{"type":"integer"}},"following":{"type":"string","enum":["all","following","not_following"]},"mcap_min":{"type":"number"},"mcap_max":{"type":"number"},"price_min":{"type":"number"},"price_max":{"type":"number"},"token_count_from":{"type":"integer"}}},{"title":"official","type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"sort":{"type":"string"},"order":{"type":"string","enum":["ASC","DESC"]},"categories":{"type":"array","items":{"type":"string"}},"token_categories":{"type":"array","items":{"type":"string"}}}},{"title":"related_stacks","type":"object","required":["token_address"],"properties":{"token_address":{"type":"string","description":"Solana token address."},"limit":{"type":"integer","default":10},"offset":{"type":"integer","default":0}}},{"title":"fetch","type":"object","properties":{"stackIds":{"type":"array","items":{"type":"integer"}},"slugs":{"type":"array","items":{"type":"string"}},"userIds":{"type":"array","items":{"type":"integer"}},"usernames":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer"},"offset":{"type":"integer"},"sort":{"type":"string"},"order":{"type":"string","enum":["ASC","DESC"]},"following":{"type":"string","enum":["all","following","not_following"]},"categories":{"type":"array","items":{"type":"string"}},"token_categories":{"type":"array","items":{"type":"string"}},"tvl":{"type":"boolean"},"context":{"type":"string","enum":["discovery","portfolio","trending","my_stacks","search","admin","auto"]}}},{"title":"my_stacks","type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"sort":{"type":"string"},"order":{"type":"string","enum":["ASC","DESC"]},"following":{"type":"string","enum":["all","following","not_following"]},"categories":{"type":"array","items":{"type":"string"}},"token_categories":{"type":"array","items":{"type":"string"}}}},{"title":"create","type":"object","required":["stackName","stackTokenInfo","creatorFee","description","category","socialLinks"],"properties":{"stackName":{"type":"string","description":"Display name for the stack."},"stackTokenInfo":{"type":"object","additionalProperties":{"type":"number"},"description":"Map of token address to weight (integer percentages that must sum to 100). Example: `{\"So11...\": 60, \"EPjF...\": 40}`.\n"},"creatorFee":{"type":"number","description":"Creator fee percentage (server-enforced min/max bounds)."},"description":{"type":"string","maxLength":500,"description":"Stack description (max 500 characters)."},"category":{"type":"string","enum":["high_risk_short","high_risk_long","medium_risk_short","medium_risk_long","low_risk_short","low_risk_long"],"description":"Risk/duration category."},"socialLinks":{"type":"object","description":"Social media links associated with the stack."},"showCreatorHoldings":{"type":"boolean","description":"Whether to publicly display the creator's holdings. Defaults to false."}}},{"title":"update","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer","description":"ID of the stack to update."},"stackName":{"type":"string"},"description":{"type":"string","maxLength":500},"category":{"type":"string","enum":["high_risk_short","high_risk_long","medium_risk_short","medium_risk_long","low_risk_short","low_risk_long"]},"showCreatorHoldings":{"type":"boolean"}}},{"title":"close","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer","description":"ID of the stack to permanently close."},"creator_note":{"type":"string","description":"Optional note from the creator explaining the closure."}}},{"title":"edit_allocation","type":"object","required":["stack_id","stackTokenInfo"],"properties":{"stack_id":{"type":"integer","description":"ID of the stack to edit."},"stackTokenInfo":{"type":"object","additionalProperties":{"type":"integer"},"description":"Map of token_address to weight (integer). Weights must sum to 100."},"creator_note":{"type":"string","maxLength":500,"description":"Optional note explaining the allocation change."}}},{"title":"check_name","type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Proposed stack name to validate."}}},{"title":"check_description","type":"object","required":["description"],"properties":{"description":{"type":"string","description":"Proposed stack description to validate."}}},{"title":"user_stack_holdings","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer","description":"Stack ID to retrieve authenticated user's holdings for."}}},{"title":"get_creator_holdings","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer","description":"Stack ID to retrieve creator's holdings for."}}},{"title":"investors","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer"}}},{"title":"followers","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer"}}},{"title":"version_history","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer","description":"ID of the stack to retrieve allocation version history for."}}}]}}}},"responses":{"200":{"description":"Successful response. Shape varies by action.","content":{"application/json":{"schema":{"oneOf":[{"title":"PaginatedListResponse","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StackObject"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"total":{"type":"integer"}}}}},{"title":"StackArrayResponse","type":"array","items":{"$ref":"#/components/schemas/StackObject"}},{"title":"RelatedStacksResponse","type":"object","properties":{"stacks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"stack_name":{"type":"string"},"slug":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"integer"},"username":{"type":"string"},"avatar":{"type":"string","nullable":true}}},"price":{"type":"number"},"change1D":{"type":"number","nullable":true},"weighted_market_cap":{"type":"number","nullable":true},"token_allocation_percentage":{"type":"number"},"creator_fee":{"type":"number"}}}},"total_count":{"type":"integer"}}},{"title":"MyStacksResponse","type":"array","items":{"allOf":[{"$ref":"#/components/schemas/StackObject"},{"type":"object","properties":{"metrics":{"type":"object","properties":{"total_trades":{"type":"integer"},"total_value_following":{"type":"number"},"trading_volume":{"type":"number"},"comments":{"type":"integer"},"pct_returned":{"type":"number"},"generated_fees":{"type":"number"}}}}}]}},{"title":"CreateResponse","type":"object","properties":{"success":{"type":"boolean"},"stack_id":{"type":"integer"}}},{"title":"UpdateResponse","type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"integer"},"stack_name":{"type":"string"},"description":{"type":"string","nullable":true},"topic":{"type":"string","nullable":true},"show_creator_holdings":{"type":"boolean"}}}}},{"title":"CloseResponse","type":"object","properties":{"success":{"type":"boolean"},"stack_id":{"type":"integer"},"stack_name":{"type":"string"},"closed_at":{"type":"integer","description":"Unix timestamp of closure."},"close_price":{"type":"number"},"creator_note":{"type":"string","nullable":true},"message":{"type":"string"}}},{"title":"EditAllocationResponse","type":"object","properties":{"success":{"type":"boolean"},"stack_id":{"type":"integer"},"version":{"type":"integer","description":"The version number of the snapshot that was saved (previous allocation)."},"nav":{"type":"number","description":"The stack NAV at time of edit (unchanged before and after)."},"message":{"type":"string"}}},{"title":"NameCheckResponse","type":"object","properties":{"status":{"type":"string","enum":["OK","TAKEN","BADWORD","INVALID"]}}},{"title":"DescriptionCheckResponse","type":"object","properties":{"status":{"type":"string","enum":["OK","BADWORD","INVALID"]}}},{"title":"HoldingsResponse","type":"object","properties":{"total_usdc":{"type":"number"},"total_invested":{"type":"number"},"total_cost_basis":{"type":"number"},"stack_id":{"type":"integer"},"amounts":{"type":"array","items":{"type":"object","properties":{"token":{"type":"object","description":"Token metadata object."},"total":{"type":"number","description":"Raw token amount."},"total_standard":{"type":"number","description":"Human-readable token amount (adjusted for decimals)."},"invested_usdc":{"type":"number"},"usdc_value":{"type":"number"},"avg_cost":{"type":"number"},"realized_pnl":{"type":"number"},"unrealized_pnl":{"type":"number"},"total_pnl":{"type":"number"},"unrealized_pnl_percent":{"type":"number","nullable":true},"total_pnl_percent":{"type":"number","nullable":true},"weight":{"type":"number"},"is_verified":{"type":"boolean"}}}},"pnl":{"type":"object","properties":{"profit_loss":{"type":"number"},"realized_pnl":{"type":"number"},"unrealized_pnl":{"type":"number"},"profit_loss_percent":{"type":"number","nullable":true},"unrealized_pnl_percent":{"type":"number","nullable":true}}}}},{"title":"InvestorsResponse","type":"object","properties":{"investor_count":{"type":"integer"}}},{"title":"FollowersResponse","type":"integer","description":"Plain integer representing follower count."},{"title":"VersionHistoryResponse","type":"object","properties":{"stack_id":{"type":"integer"},"current_version":{"type":"integer","description":"The latest (live) version number."},"versions":{"type":"array","description":"Version records in reverse-chronological order.","items":{"type":"object","properties":{"version":{"type":"integer"},"is_current":{"type":"boolean","description":"True only for the live allocation."},"created_at":{"type":"integer","nullable":true,"description":"Unix timestamp of the edit. Null for current version."},"creator_note":{"type":"string","nullable":true,"description":"Note from the edit. Null for current and V1 on unedited stacks."},"nav_at_edit":{"type":"number","nullable":true,"description":"Stack price when this allocation was replaced. Null for current."},"allocation":{"type":"array","items":{"type":"object","properties":{"token_id":{"type":"integer"},"symbol":{"type":"string"},"name":{"type":"string"},"address":{"type":"string"},"image_url":{"type":"string"},"weight":{"type":"integer"},"token_price":{"type":"number","description":"Spot price at time of edit. Present on historical versions only."}}}},"changes":{"type":"object","nullable":true,"description":"Null for V1. For V2+, describes changes from previous version.","properties":{"tokens_added":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"symbol":{"type":"string"},"weight":{"type":"integer"}}}},"tokens_removed":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"symbol":{"type":"string"},"weight":{"type":"integer"}}}},"weight_changes":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"symbol":{"type":"string"},"previous_weight":{"type":"integer"},"new_weight":{"type":"integer"}}}}}}}}}}}]}}}},"400":{"description":"Bad request (missing or invalid parameters).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication required or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (not the stack owner or insufficient permissions).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Stack or token not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://howto.indexify.finance/indexify-api-documentation/stacks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
