---
title: "Allocate"
method: POST
path: "/v1/optimizers/{optimizer}/allocate"
tags: ["Optimizers"]
---

# Allocate

`POST /v1/optimizers/{optimizer}/allocate`

## Request

- Base URL: `https://api.ensemble.markets` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ensemble.markets/v1/optimizers/{optimizer}/allocate`
- Auth: HTTP bearer

Run the class over the trailing common history of the given tickers
and/or model IDs and return its weights. Tickers see the same
backfill-spliced history a backtest would.

## Path parameters

- `optimizer` string, required: Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)

## Request body

- AllocateRequest: Run a stored optimizer over a mix of tickers and model IDs.
  - `symbols` string[], required: Tickers and/or model IDs (model_... or legacy m-...) to allocate across, at most 50
  - `lookback` integer: Trailing common trading days to feed the optimizer
  - `as_of` string, nullable: Inclusive YYYY-MM-DD cutoff; defaults to the latest common bar

## Response `200`

Successful Response

- Allocation
  - `optimizer` AllocateOptimizerRef, required
    - `id` string, required
    - `name` string, required
  - `as_of` string, required
  - `lookback` integer, required
  - `rows_used` integer, required
  - `weights` object, required
  - `inputs` AllocateInput[], required
    - `symbol` string, required
    - `kind` 'asset' | 'model', required
    - `name` string, nullable
    - `first_date` string, nullable

## Other responses

- `4XX`: The request was refused; `error.type` says why
- `5XX`: The server failed; quote `X-Request-Id` when reporting it

---

[API](https://skmtc.dev/ensemble/apis/ensemble-api.md) · [All operations](https://skmtc.dev/ensemble/apis/ensemble-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ensemble/apis/ensemble-api/revisions/4c0fbd80c197?raw)
