Skip to content

Edit a bot

PUT https://rest.haasapi.com/v1/partner/users/{user_id}/bots/{bot_id}

Changes a bot’s configuration. config is a PARTIAL object - only the snake_case keys you send are changed. A RUNNING bot may only change fields the strategy marks editable (see GET /v1/partner/strategies); a stopped bot may change anything. Edits to a master bot cascade to its followers. Answers 204. A copy cannot be edited directly - edit its master.

Requires the partner scope.

{
"config": {
"grid_count": 30
}
}
Field Type Description
config object The config fields to change, by their snake_case keys. Only the keys present are updated.
Terminal window
curl "https://rest.haasapi.com/v1/partner/users/{user_id}/bots/{bot_id}" \
-X PUT \
-H "Authorization: Bearer hk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"config":{"grid_count":30}}'

204 Deleted - no content.

All errors are RFC 9457 problem documents.

Status Description
400 The request is malformed (invalid limit, unusable cursor, …). (code: invalid_request)
401 Missing, malformed, disabled, or revoked API key. (code: invalid_api_key)
404 No accessible bot with that id for this end-user. (code: bot_not_found)
409 The bot is a copy; edit its master instead. (code: cannot_edit) A request with this Idempotency-Key is still being processed. (code: idempotency_in_progress)
422 A change was rejected (a non-editable field on a running bot, or an invalid value). (code: invalid_config) The Idempotency-Key was already used with a different request. (code: idempotency_key_reuse)
500 An unexpected error inside the API. Nothing about the request caused it; retry, and quote the instance value if it persists. (code: internal_error)
502 An internal service answered in a way the API could not serve. Retry. (code: upstream_error)
503 The request could not be served right now. Retry with the same key - do not discard it. (code: temporarily_unavailable)
504 An internal service did not answer within the deadline. Retry with backoff. (code: upstream_timeout)
{
"type": "https://docs.haasapi.com/errors/invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "The request is malformed (invalid limit, unusable cursor, …).",
"code": "invalid_request"
}