> This page is for Trading.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.immix.xyz/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.immix.xyz/_mcp/server.

# Update an algo instance's upgrade policy

POST /algos/instances/{id}/upgrade-policy
Content-Type: application/json

Sets what a new version of the instance's algo does to it (`algos:manage`): `RESUME`, `RESTART` or `STOP` (the row's `upgradePolicy` says what each does). Legal in every state but `DELETED` (409 `ILLEGAL_TRANSITION`) and not a move: only `upgradePolicy` changes. Takes no `If-Match` (one refuses 400): no version stamp can refuse it. Answers the row; set it before a roll.

Reference: https://docs.immix.xyz/trading/api-reference/rest-api/algos/set-upgrade-policy

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (integer, required) — The instance's id — a positive 32-bit integer the platform minted; the value an algo's orders carry as `algoInstanceId`.

### Query parameters

- `minGlobalSequence` (string, optional) — A position you hold — an `X-Immix-Global-Sequence` you read, or a 202's `commandGlobalSequence`: this member answers only once it has folded the platform's stream through it, waiting up to its deadline, then 503 `PROJECTION_BEHIND` with `Retry-After`. Within that stream a read is never older than what you have seen; drop your positions after an announced stream cut. A retry stating its 202's position attaches to or replays that operation while the journal holds its key, never publishing twice. Stated once: one to nineteen digits, at most 9223372036854775807; else 400 `MALFORMED_REQUEST`.

### Headers

- `Idempotency-Key` (string, required) — Required on every write: a URL-safe string of 1 to 64 characters from `[A-Za-z0-9._~-]` (a UUID fits), scoped to you. It names one operation on one record, ever: a retry replays the stored outcome (`Idempotent-Replay: true`) or attaches to the live one, and reuse on another record refuses 409 `IDEMPOTENCY_KEY_REUSED`. Missing or malformed, 400.
- `X-Request-Id` (string, optional) — Your own id for the request: 8 to 128 of `[A-Za-z0-9._-]`. It becomes the request's id and is echoed on the response. A value off that grammar is replaced with a fresh id, never refused.

### Body (application/json)

This endpoint expects an object.

- `upgradePolicy` (enum, required) — What a new version of the instance's algo on its pool does to it: RESUME keeps its orders and resumes its state, or lands it ERROR with its orders cancelled when that state cannot be resumed, RESTART cancels its orders and starts afresh, STOP cancels its orders and stops it. UNKNOWN is the unset sentinel: outputs only — as input the field is required, and explicit UNKNOWN refuses 400. A consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict
  - Allowed values: `UNKNOWN`, `RESUME`, `RESTART`, `STOP`
- `instanceId` (integer, optional) — The instance whose upgrade policy is set.
- `remark` (string, optional) — Why — at most 256 bytes of UTF-8; empty when none is given. Optional in this body: absent or null reads as "" — no remark.

## Response

### 200

The instance as the platform now holds it after the write — the same row the read serves, with the answering change's position, the row's `ETag` and, on a replayed key, `Idempotent-Replay`.

- `algoVersionId` (integer, required) — The catalog version the instance runs (`GET /algos/versions`). When its pool's engines load a new version of the instance's algo, the instance moves to it: `lastCause` then names what the new version did to it.
- `appliedConfigSeq` (integer, required) — The document in force; 0 while none has been applied.
- `configSeq` (integer, required) — The latest staged document's sequence number — the `ETag`, and what `If-Match` takes on a config write.
- `createdAtNs` (string, required) — When it was created — epoch nanoseconds as a decimal string.
- `displayName` (string, required) — The instance's display name, as created.
- `globalSequence` (string, required) — The position as a decimal string — the last change this member had applied, orders, balance readings and algo instances included.
- `health` (AlgoInstanceHealth, required, nullable) — While the instance is `STARTED`: whether its orders are reaching the book, as its engine last stated it. `null` in every other status, and cleared by every change of status, so each run begins `OK`.
- `instanceId` (integer, required) — The instance's id — the value its orders carry as `algoInstanceId`.
- `lastCause` (enum, required) — Why it last moved: a command, the organisation's halt, its first document applied, the engine's fault trip or divergence check, a new version of its algo on its pool — `VERSION_RESUMED`, `VERSION_RESTARTED` or `VERSION_STOPPED`, the owner's record of its `upgradePolicy`, or `SCHEMA_MISMATCH` when the new version's params schema refused its document (then `ERROR`, or still `CREATED`) — or `STRATEGY` when its own algo stopped it: `STOPPED`, its state kept, so a start resumes it. The value set is append-only: read an unknown name as `UNKNOWN`.
  - Allowed values: `UNKNOWN`, `COMMAND`, `HALT`, `CONFIG_APPLIED`, `ENGINE_FAULT`, `DIVERGED`, `VERSION_RESUMED`, `VERSION_RESTARTED`, `VERSION_STOPPED`, `SCHEMA_MISMATCH`, `STRATEGY`
- `lastCommandKind` (enum, required) — The command behind the last move — a desk's, or the engine's report that moved it. The value set is append-only: read an unknown name as `UNKNOWN`.
  - Allowed values: `UNKNOWN`, `CREATE_ALGO_INSTANCE`, `SUBMIT_ALGO_CONFIG`, `START_ALGO_INSTANCE`, `STOP_ALGO_INSTANCE`, `DELETE_ALGO_INSTANCE`, `HALT_ALGOS`, `REPORT_ALGO_VERSIONS`, `REPORT_ALGO_CONFIG_OUTCOME`, `REPORT_ALGO_INSTANCE_FAULT`, `SET_ALGO_UPGRADE_POLICY`, `REPORT_ALGO_INSTANCE_STOP`, `REPORT_ALGO_INSTANCE_HEALTH`
- `lastDetail` (string, required) — What the change behind `lastCause` said of itself, at most 256 bytes: an algo's reason for stopping itself, the engine's description of a fault or of a divergence, the schema's refusal at a version move. Empty when it said nothing, as a command's change does.
- `lastUpdatedAtNs` (string, required) — When it last moved — epoch nanoseconds as a decimal string.
- `orgId` (integer, required) — The organisation that owns the instance.
- `pool` (string, required) — The engine pool the instance runs on, fixed at creation.
- `status` (enum, required) — Where the instance stands: `CREATED` until its first document is applied, `STOPPED` or `STARTED` under the desk, `ERROR` after the engine's fault trip (left only by a stop), `DELETED` terminal. `PENDING_APPROVAL` and `DISABLED` are reserved and never served today. The value set is append-only: read an unknown name as `UNKNOWN`.
  - Allowed values: `UNKNOWN`, `CREATED`, `STOPPED`, `STARTED`, `ERROR`, `DELETED`, `PENDING_APPROVAL`, `DISABLED`
- `transitionSeq` (integer, required) — The instance's transition number: 1 at creation, one more on every move.
- `upgradePolicy` (enum, required) — What a new version of the instance's algo on its pool does to it: `RESUME` keeps its orders and resumes its state, or lands it `ERROR` with its orders cancelled when that state cannot be resumed, `RESTART` cancels its orders and starts afresh, `STOP` cancels its orders and stops it. Set at creation (`RESUME` when not stated) and changed by `POST /algos/instances/{id}/upgrade-policy`. `UNKNOWN` is never served. The value set is append-only: read an unknown name as `UNKNOWN`.
  - Allowed values: `UNKNOWN`, `RESUME`, `RESTART`, `STOP`
- `createdBy` (Actor, optional) — Who created the instance — a member or an API key.
- `lastUpdatedBy` (Actor, optional, nullable) — Whose command last moved the instance — a member or an API key; null when the engine or the platform's own rule did — `lastCause` says which.
- `pendingByUserId` (integer, optional, nullable) — Reserved; always null.

## Errors

### 400 Set Upgrade Policy Algos Request Bad Request Error

Refused at the door — nothing reached the platform and the key was not journaled: a missing or malformed `Idempotency-Key`, a malformed `If-Match` (an absent one is 428 `PRECONDITION_REQUIRED`), malformed JSON, a body `actor` (or `userId`, its spelling before the actor), a body restating the path or `If-Match` differently, a money string off its `pattern` (an exponent, a plus sign, a bare point, surrounding whitespace) or past its `maxLength`, or one no value here can state (over 18 fractional digits, or past a 64-bit integer at its own scale), or any other value outside the schema.

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 401 Set Upgrade Policy Algos Request Unauthorized Error

No bearer token, or one that does not verify.

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 403 Set Upgrade Policy Algos Request Forbidden Error

`CAPABILITY_DENIED`: a read your capabilities do not cover, or a staging route without its propose bit (`accounts:propose`). `NOT_REGISTERED`: no row or open invitation at your verified address, an unknown organisation, or an unclaimed row (an administrator admits it). `EMAIL_UNVERIFIED`: verify, then sign in again. `INVITATION_EXPIRED`: an administrator re-invites. `FORBIDDEN_PRINCIPAL`: no `org_id`, a non-ASCII ref, a disabled user, a binding with no user. `ORG_NOT_ACTIVE`: disabled, pending or deleted. Owners' 403s carry the position header and `Idempotent-Replay`.

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 404 Set Upgrade Policy Algos Request Not Found Error

The door's `NOT_FOUND`: no such instance in your organisation — another organisation's is indistinguishable from an absent one; the position header says as of when, and nothing was journaled. Or the platform's own refusal, a fact on its stream that a retried key replays: `UNKNOWN_INSTANCE` (the instance vanished in the catch-up window) and, on a create, `UNKNOWN_ALGO_VERSION` (no catalog row under the version the body named).

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 409 Set Upgrade Policy Algos Request Conflict Error

The record owner's refusal, 409 for state or uniqueness and 422 for a field or reference, is a fact on the stream: it carries the position header and a retried key replays it. Door refusals ride the same statuses without the header, never journaled, so a retry takes fresh: 409 `IDEMPOTENCY_KEY_REUSED`; 422 `INSTRUMENT_NOT_LIVE` or `ACCOUNT_NOT_ACTIVE` on `POST /orders`, `REFERENCE_UNKNOWN_INSTRUMENT`, `REFERENCE_INSTRUMENT_NOT_LIVE` or `REFERENCE_UNKNOWN_ACCOUNT` in an algo document (every one answers a held key as its retry).

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 413 Set Upgrade Policy Algos Request Content Too Large Error

The request is too large: a body declared past 1 MB (`PAYLOAD_TOO_LARGE`), or a command past the platform's own bound (`TOO_LARGE`, not expected for any route here). Nothing was submitted; a retry takes fresh.

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 422 Set Upgrade Policy Algos Request Unprocessable Entity Error

The record owner's refusal, 409 for state or uniqueness and 422 for a field or reference, is a fact on the stream: it carries the position header and a retried key replays it. Door refusals ride the same statuses without the header, never journaled, so a retry takes fresh: 409 `IDEMPOTENCY_KEY_REUSED`; 422 `INSTRUMENT_NOT_LIVE` or `ACCOUNT_NOT_ACTIVE` on `POST /orders`, `REFERENCE_UNKNOWN_INSTRUMENT`, `REFERENCE_INSTRUMENT_NOT_LIVE` or `REFERENCE_UNKNOWN_ACCOUNT` in an algo document (every one answers a held key as its retry).

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 429 Set Upgrade Policy Algos Request Too Many Requests Error

Shed at once: `INBOX_FULL` or `IN_FLIGHT_FULL` (this member's bounds; nothing queued, the key not journaled), the intake's or the ticket route's `RATE_LIMITED`, or the orders owner's `RATE_CEILING` (the organisation's per-minute ceiling — a refusal on the stream, replayed like any, so its `retryable` is `false` and the order goes again under a fresh key). `Retry-After` says when.

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 500 Set Upgrade Policy Algos Request Internal Server Error

The gateway failed to serve (`INTERRUPTED`, `INTERNAL_ERROR`, `PROJECTION_MISS`); the operation record, if one exists, is still readable.

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

### 503 Set Upgrade Policy Algos Request Service Unavailable Error

This member cannot serve the algos surface now: `NOT_PRIMED` — it is still catching up; retry shortly — `PROJECTION_BEHIND` — behind your `minGlobalSequence`; retry after `Retry-After` — or `ALGOS_UNAVAILABLE` — it is deployed without the surface, because the algos owner is not released into its environment yet, so no instance is readable or commandable here and a retry changes nothing; every other route is unaffected. On a write also `NOT_SERVING`, `OWNER_ABSENT`, or the platform's own outcome for a command lost in transit — nothing journaled; retry against a serving member.

- `error` (ErrorBody, required) — What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.
- `currentVersion` (string, optional) — On 412 `VERSION_CONFLICT`, or `CONFIG_SEQ_CONFLICT` on an algo instance's config write: the row's current version (the `ETag` carries the same token) — re-read, reapply, retry.

## Types

### AlgoInstanceHealth

A started algo instance's health: a condition beside its status, never a status of its own. The engine counts an instance's orders per key: an account, an instrument and a side. A key whose orders are refused three times running — at the algo's own call, by the platform, or by the venue — is impaired until one of its orders rests or fills. `IMPAIRED` names the worst key; `OK` carries nothing else. It is restated when the reason changes, at 30, 300 and so on refusals, and when the key trades again, not at every refusal.

- `state` (enum, required) — `IMPAIRED` while at least one key is; `OK` otherwise. Read a value this list does not hold as unknown.
  - Allowed values: `UNKNOWN`, `OK`, `IMPAIRED`
- `kind` (enum, required, nullable) — The condition: `ORDERS_REFUSED`, the only one today; later conditions append values. `null` when `OK`.
  - Allowed values: `UNKNOWN`, `ORDERS_REFUSED`
- `reason` (enum, required, nullable) — The worst key's latest refusal: an order refusal's code, as `OrderRejected.reason` names it, or one of the engine's own — `UNROUTABLE` (no trading key pairs the account with the instrument's venue), `INVALID` (the order does not fit the instrument), `RISK_BLOCKED` (the account's risk posture blocks new orders), `VENUE_REJECTED` (the venue rejected an order the platform admitted). `null` when `OK`.
  - Allowed values: `UNKNOWN`, `CLIENT_ORDER_ID_CONFLICT`, `ORG_MISMATCH`, `ACCOUNT_NOT_ACTIVE`, `CAPABILITY_DENIED`, `INSTRUMENT_NOT_LIVE`, `CREDENTIAL_UNAVAILABLE`, `CONNECTION_DOWN`, `TRADING_POLICY_MISSING`, `TRADING_HALTED`, `INVALID_FIELD`, `UNSUPPORTED_AT_VENUE`, `NO_REFERENCE_PRICE`, `TICK_SIZE_VIOLATION`, `QTY_STEP_VIOLATION`, `QTY_BOUND_BREACH`, `MIN_NOTIONAL_BREACH`, `TICKET_QTY_CAP_EXCEEDED`, `TICKET_NOTIONAL_CAP_EXCEEDED`, `COLLAR_BREACH`, `OPEN_ORDER_CEILING`, `RATE_CEILING`, `UNKNOWN_ORDER`, `ORDER_TERMINAL`, `PRICE_BOUND_BREACH`, `ORDER_STATUS_UNKNOWN`, `ORG_NOT_ACTIVE`, `FILL_PRECISION_OVERFLOW`, `RISK_LIMIT_BREACHED`, `RISK_HEDGE_ONLY`, `UNROUTABLE`, `INVALID`, `RISK_BLOCKED`, `VENUE_REJECTED`
- `refusalClass` (enum, required, nullable) — What clears it. `STANDING`: someone changes a record — a trading policy, a key, an account. `ORDER_SHAPED`: the algo or its document changes, or the market moves. `TRANSIENT`: it passes by itself. `VENUE`: the venue rejected the order for its own reason. `null` when `OK`.
  - Allowed values: `UNKNOWN`, `STANDING`, `ORDER_SHAPED`, `TRANSIENT`, `VENUE`
- `side` (enum, required, nullable) — The worst key's side. `null` when `OK`.
  - Allowed values: `UNKNOWN`, `BUY`, `SELL`
- `accountId` (integer, required, nullable) — The worst key's account. `null` when `OK`.
- `instrumentId` (string, required, nullable) — The worst key's instrument, a decimal string. `null` when `OK`.
- `refusals` (integer, required) — The worst key's refusals since its last order that rested or filled. `0` when `OK`.
- `sinceNs` (string, required, nullable) — When the worst key's run of refusals began — epoch nanoseconds as a decimal string. `null` when `OK`.
- `impairedKeys` (integer, required) — How many keys are impaired. The worst is the one a person must clear, before one the algo or the market clears, before the venue's, before one that passes by itself; among equals, the longest-running. `0` when `OK`.

### Actor

Who acted — the principal behind a command, a row's maker or its concluder: a member (USER, id = the user id), an API key the organisation issued (API_KEY, id = the API key id), or the platform itself (MACHINE, id 0 — a connector's report, an algo instance's order, the door's own write). The kind's value set is append-only: a consumer READING an unknown kind treats the actor as unknown, never as an error.

- `kind` (enum, required) — The kind of principal; which id space `id` names.
  - Allowed values: `USER`, `API_KEY`, `MACHINE`
- `id` (integer, required) — The principal's id in its kind's space: a user id, an API key id, or 0 for the platform itself.

### ErrorBody

What a refusal states. Since `0.12.0` every refusal carries all four members; a member below it sends `code`, sometimes `message`, and neither of the others.

- `code` (string, required) — The code to branch on — stable and open (before 1.0.0 a minor may remove one, its changelog naming it): treat one you do not know by its HTTP status. The gateway's: - 400: `MALFORMED_REQUEST`, `MISSING_IDEMPOTENCY_KEY`, `INVALID_IDEMPOTENCY_KEY`, `INVALID_IF_MATCH`, `INVALID_CURSOR` - 401: `UNAUTHENTICATED` - 403: `FORBIDDEN_PRINCIPAL`, `NOT_REGISTERED`, `INVITATION_EXPIRED`, `EMAIL_UNVERIFIED`, `ORG_NOT_ACTIVE`, `CAPABILITY_DENIED` - 404: `NOT_FOUND`, `UNKNOWN_OPERATION`, `ROUTE_NOT_FOUND` (no route answers the path) - 405: `METHOD_NOT_ALLOWED` - 409: `IDEMPOTENCY_KEY_REUSED`, `INTAKE_KEY_REUSED`, `KEY_ALREADY_REGISTERED`, `CONNECTION_DOWN` (`POST /transfers`), `EXCEEDS_MARGIN_HEADROOM`, `HEADROOM_UNKNOWN` (a transfer's submit and its approval) - 413: `TOO_LARGE`, `PAYLOAD_TOO_LARGE`, `DOCUMENT_TOO_LARGE` - 422: a reference this member will not send: `INSTRUMENT_NOT_LIVE`, `ACCOUNT_NOT_ACTIVE` (`POST /orders`), `REFERENCE_UNKNOWN_INSTRUMENT`, `REFERENCE_INSTRUMENT_NOT_LIVE`, `REFERENCE_UNKNOWN_ACCOUNT` (an algo document); `VENUE_UNSUPPORTED`, `DEDICATED_KEY`, `DESTINATION_NOT_ALLOWED` - 428: `PRECONDITION_REQUIRED` - 429: `INBOX_FULL`, `IN_FLIGHT_FULL`, `RATE_LIMITED` - 500: `INTERRUPTED`, `INTERNAL_ERROR`, `PROJECTION_MISS` - 503: `NOT_PRIMED`, `NOT_SERVING`, `OWNER_ABSENT`, `INTAKE_UNAVAILABLE`, `BALANCES_UNAVAILABLE`, `POSITIONS_UNAVAILABLE`, `RISK_UNAVAILABLE`, `TRANSFERS_UNAVAILABLE`, `ALGOS_UNAVAILABLE`, `NOTIFICATIONS_UNAVAILABLE`, `TICKETS_UNAVAILABLE`, `REGISTRATION_PENDING`, `PROJECTION_BEHIND`, `LOST`, `REJECTED_NOT_REGISTERED`, `REJECTED_NOT_ACTIVE` The record owners' refusals ride verbatim — `OrgRegisterRejected.reason`, `OrderRejected.reason`, `AlgoRejected.reason`, `RiskLimitRejectReason`, `RiskAdjustmentRejectReason`, `ManualExecutionRejectReason`, `TransferRejectReason` and `NotificationEndpointRejected.reason` list them; the guide maps each to its status.
- `message` (string, required) — For display only; its wording may change at any time.
- `requestId` (string, required) — The request's id, also sent as X-Request-Id; quote it to support.
- `retryable` (boolean, required) — Whether sending the identical request again, its `Idempotency-Key` included, after `Retry-After` or a short pause, can succeed with nothing else changed. `false` where something must change first: the request, its key, its precondition, the caller's standing, or the platform's own records or deployment. A refusal the record owner judged is always `false`: it is the recorded answer to its key, which replays it.

## Examples

**Request**

```json
{
  "upgradePolicy": "UNKNOWN"
}
```

**Response**

```json
{
  "algoVersionId": 1,
  "appliedConfigSeq": 1,
  "configSeq": 1,
  "createdAtNs": "createdAtNs",
  "displayName": "displayName",
  "globalSequence": "globalSequence",
  "health": {
    "state": "UNKNOWN",
    "kind": "UNKNOWN",
    "reason": "UNKNOWN",
    "refusalClass": "UNKNOWN",
    "side": "UNKNOWN",
    "accountId": 1,
    "instrumentId": "instrumentId",
    "refusals": 1,
    "sinceNs": "sinceNs",
    "impairedKeys": 1
  },
  "instanceId": 1,
  "lastCause": "UNKNOWN",
  "lastCommandKind": "UNKNOWN",
  "lastDetail": "lastDetail",
  "lastUpdatedAtNs": "lastUpdatedAtNs",
  "orgId": 1,
  "pool": "pool",
  "status": "UNKNOWN",
  "transitionSeq": 1,
  "upgradePolicy": "UNKNOWN",
  "createdBy": {
    "kind": "USER",
    "id": 1
  },
  "lastUpdatedBy": {
    "kind": "USER",
    "id": 1
  },
  "pendingByUserId": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/algos/instances/1/upgrade-policy"

payload = { "upgradePolicy": "UNKNOWN" }
headers = {
    "Idempotency-Key": "Idempotency-Key",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/algos/instances/1/upgrade-policy';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'Idempotency-Key',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"upgradePolicy":"UNKNOWN"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/algos/instances/1/upgrade-policy"

	payload := strings.NewReader("{\n  \"upgradePolicy\": \"UNKNOWN\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/algos/instances/1/upgrade-policy")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'Idempotency-Key'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"upgradePolicy\": \"UNKNOWN\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/algos/instances/1/upgrade-policy")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"upgradePolicy\": \"UNKNOWN\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/algos/instances/1/upgrade-policy', [
  'body' => '{
  "upgradePolicy": "UNKNOWN"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'Idempotency-Key',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/algos/instances/1/upgrade-policy");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"upgradePolicy\": \"UNKNOWN\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "Idempotency-Key",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["upgradePolicy": "UNKNOWN"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/algos/instances/1/upgrade-policy")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```