getstream api
The universal command. Every Stream API endpoint is callable by name.
getstream api <EndpointName> [flags]Endpoint names are SDK client methods, also the OpenAPI operation ids. They are case-sensitive. Each call uses the initialized project's credentials by default; pass --app-id to target another app you own.
Discovery
Endpoints are grouped by product. Browse them with --help:
getstream api --help # all endpoints, grouped by product
getstream api chat --help # Chat endpoints
getstream api QueryChannels --schema # the full request body schemaA few endpoint names exist in more than one product (for example CastPollVote in both Chat and Feeds). The bare name errors instead of picking one; add the product prefix:
getstream api chat CastPollVote --request '{...}'
getstream api feeds CastPollVote --request '{...}'Parameters
| Form | Use |
|---|---|
--<name> |
Path parameters, shown as required flags (for example --id, --type). |
--request '<json>' |
The request body, as a JSON string. |
Path parameters and the body are separate. --help on any endpoint lists its path-parameter flags; --schema prints the body it accepts.
getstream api QueryChannels --request '{"filter_conditions":{"member_count":{"$gte":50}},"limit":10}'
getstream api GetMessage --id 8f3a2c1e-...
getstream api DeleteChannel --type messaging --id general --request '{"hard_delete":true}'Flags
| Flag | Effect |
|---|---|
--request <json> |
The request body as JSON. |
--jq <expr> |
Apply a jq expression to the parsed response before output. |
--schema |
Print the full request body schema and exit, without making a call. |
--app-id <id> |
Target an app you own instead of the initialized project. Requires login. |
--verbose |
Print the API request and full error details. Works on every command. |
Environment variables
| Variable | Effect |
|---|---|
STREAM_BASE_URL |
Target a non-production API host, such as staging. |
STREAM_HTTP_TIMEOUT |
HTTP timeout for API calls, as a whole number of seconds. |
Output
Responses are formatted JSON on stdout. Errors are written to stderr with a non-zero exit. There are no table or id output modes.
When stdin is a terminal the response prints in full - pipes and redirects included. When stdin is not a terminal (CI steps, agent calls, anything detached), or NONINTERACTIVE is set, long arrays are shortened to 25 items, with a Long arrays truncated notice on stderr. --jq results always print in full, so scripts should select values with --jq rather than parse the raw response.
See also
- Endpoint catalog: finding the right endpoint name
- Filter operators: building
filter_conditionsbodies - jq expressions: what to pass to
--jq - Projects and credentials: how
--app-idresolves