List scripts
GET https://rest.haasapi.com/v1/scripts
Returns the user’s own HaasScripts as lean rows (no source text), sorted by script_id and paged by a keyset cursor. The script_id is the join key the script endpoints and POST /v1/bots take.
Requires the read scope.
Query parameters
Section titled “Query parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | no | Page size, 1–500. Defaults to 100. |
cursor |
string | no | Opaque cursor from a previous response’s next_cursor. |
Example request
Section titled “Example request”curl "https://rest.haasapi.com/v1/scripts?limit=100" \ -H "Authorization: Bearer hk_live_YOUR_KEY"Response
Section titled “Response”200 OK. Returns a ScriptsPage.
{ "data": [ { "script_id": "31d13ffedae14ebda69871d28e8f1260", "name": "Cypress Monaco Seed 1788034085413", "description": "Auto-seeded by monaco-edit-save spec", "type": "lua", "is_valid": false, "created_at": "2026-08-29T20:08:09Z", "updated_at": "2026-08-29T20:08:23Z" } ], "next_cursor": null}Fields
Section titled “Fields”ScriptsPage
Section titled “ScriptsPage”| Field | Type | Description |
|---|---|---|
data |
array of Script | One page of the user’s own scripts, sorted by script_id. |
next_cursor |
string, nullable | Pass as cursor to fetch the next page; null on the last page. Opaque - never construct or decode one. |
Script
Section titled “Script”| Field | Type | Description |
|---|---|---|
script_id |
string | Script identifier - the id the script endpoints and POST /v1/bots accept. Copy it from this endpoint; never construct one. |
name |
string | User-chosen script name. |
description |
string, nullable | User-chosen description. null when the script has none. |
type |
string | Script kind: lua (a HaasScript source script) or visual (built in the visual editor). Scripts created through this API are always lua. |
is_valid |
boolean | Whether the script’s last compile succeeded. Only valid scripts can run on a bot. |
created_at |
string, nullable | When the script was created, RFC 3339 UTC. null when unknown. |
updated_at |
string, nullable | When the script was last updated, RFC 3339 UTC. null when unknown. |
Errors
Section titled “Errors”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) |
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"}