curl --request PATCH \
--url https://api-staging.mystacks.ai/manager/stacks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated example stack",
"schedule": {
"preset": "weekly"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated example stack', schedule: {preset: 'weekly'}})
};
fetch('https://api-staging.mystacks.ai/manager/stacks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-staging.mystacks.ai/manager/stacks/{id}"
payload = {
"name": "Updated example stack",
"schedule": { "preset": "weekly" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "bf4bc5e9-0d9e-454c-bc1c-30abc120b074",
"current_revision_id": "e137435f-83ce-4b3c-86ae-75d6462487b6",
"name": "Updated example stack",
"allocation": [
{
"token_address": "0x117cc2133c37b721f49de2a7a74833232b3b4c0c",
"weight_bps": 6000
},
{
"token_address": "0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec",
"weight_bps": 4000
}
],
"schedule": {
"preset": "weekly"
}
}{
"code": "invalid_request",
"message": "invalid request body",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "unauthorized",
"message": "invalid manager credential",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "not_found",
"message": "stack not found",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "payload_too_large",
"message": "request body exceeds 262144 bytes",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "rate_limited",
"message": "manager verification rate limited",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "internal_error",
"message": "an unexpected error occurred",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "service_unavailable",
"message": "manager verification is unavailable",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}Update a stack
Save changes to a stack as a new revision.
curl --request PATCH \
--url https://api-staging.mystacks.ai/manager/stacks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated example stack",
"schedule": {
"preset": "weekly"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated example stack', schedule: {preset: 'weekly'}})
};
fetch('https://api-staging.mystacks.ai/manager/stacks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-staging.mystacks.ai/manager/stacks/{id}"
payload = {
"name": "Updated example stack",
"schedule": { "preset": "weekly" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "bf4bc5e9-0d9e-454c-bc1c-30abc120b074",
"current_revision_id": "e137435f-83ce-4b3c-86ae-75d6462487b6",
"name": "Updated example stack",
"allocation": [
{
"token_address": "0x117cc2133c37b721f49de2a7a74833232b3b4c0c",
"weight_bps": 6000
},
{
"token_address": "0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec",
"weight_bps": 4000
}
],
"schedule": {
"preset": "weekly"
}
}{
"code": "invalid_request",
"message": "invalid request body",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "unauthorized",
"message": "invalid manager credential",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "not_found",
"message": "stack not found",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "payload_too_large",
"message": "request body exceeds 262144 bytes",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "rate_limited",
"message": "manager verification rate limited",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "internal_error",
"message": "an unexpected error occurred",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}{
"code": "service_unavailable",
"message": "manager verification is unavailable",
"request_id": "d28e1ad4-2ca8-4f35-b590-8bf3b53abc81"
}allocation replaces the entire target list.
Omitting a token from that supplied list removes its allocation.
The replacement still needs weights totaling 10000.
An empty object is invalid.
Unknown fields and null field values are invalid.
Response
200 OK returns the complete stack response with the new current_revision_id.
The response includes the new quoted revision ID in ETag.
It also includes X-Request-Id.
The saved configuration is visible immediately.
An update does not trigger an immediate trade.
See schedules for preset meanings and the planned execution contract.
Revisions and concurrent updates
Every successfully saved update creates a revision. This includes an update that repeats the current values. Concurrent updates are saved in sequence. For each supplied field, the last successfully saved value wins. A delayed older request can overwrite a newer request that was saved first. Omitted fields are copied from the current configuration when the update is saved. NeitherIf-Match nor Idempotency-Key is required or enforced for this endpoint.
Sending them does not protect against overwrites or deduplicate a retry.
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | Invalid stack UUID, malformed JSON, empty patch, or invalid configuration. |
404 | not_found | Stack is missing or belongs to another manager. |
Authorizations
Enter the API key supplied by MyStacks. The playground adds the Authorization: Bearer prefix for you.
Headers
Optional request trace ID. A nonempty value is echoed in the response. Missing or empty values cause a UUID to be generated.
Path Parameters
UUID of a stack owned by this manager. Missing or unowned stacks return 404. Invalid UUIDs return 400.
Body
Supply at least one of name, allocation, or schedule. Omitted fields retain their saved values. A supplied allocation replaces the full target list. Unknown fields and null values are invalid. The request body must not exceed 262144 bytes.
Must contain non-whitespace text and must not contain U+0000. Accepted names retain their exact whitespace. No separate name-length limit applies within the body size limit.
1^(?![\s\S]*\u0000)[\s\S]*\S[\s\S]*$"Example stack"
The complete target allocation. Weights must total exactly 10000. Duplicate token identities are rejected after lowercase normalization. When supplied in PATCH, this list replaces the full saved allocation. Omitted tokens are removed.
1 - 30 elementsShow child attributes
Show child attributes
[
{
"token_address": "0x117cc2133c37b721f49de2a7a74833232b3b4c0c",
"weight_bps": 6000
},
{
"token_address": "0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec",
"weight_bps": 4000
}
]
Schedule configuration only. Saving a preset does not execute trades.
Show child attributes
Show child attributes
{ "preset": "daily" }
Response
Complete saved configuration with the new revision and ETag.
Current complete configuration. No subscriber, balance, performance, or execution data is included.
Stable stack identifier.
"bf4bc5e9-0d9e-454c-bc1c-30abc120b074"
Identifier of this complete saved configuration revision.
"e137435f-83ce-4b3c-86ae-75d6462487b6"
Must contain non-whitespace text and must not contain U+0000. Accepted names retain their exact whitespace. No separate name-length limit applies within the body size limit.
1^(?![\s\S]*\u0000)[\s\S]*\S[\s\S]*$"Example stack"
Complete saved allocation. Addresses are lowercase, unique, and ordered by token address. Weights total exactly 10000.
1 - 30 elementsShow child attributes
Show child attributes
[
{
"token_address": "0x117cc2133c37b721f49de2a7a74833232b3b4c0c",
"weight_bps": 6000
},
{
"token_address": "0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec",
"weight_bps": 4000
}
]
Schedule configuration only. Saving a preset does not execute trades.
Show child attributes
Show child attributes
{ "preset": "daily" }