Get Example
get_exampleRetrieve a runnable API request example for any UniFi endpoint in your chosen language and mode, with placeholders to fill in. Get authoritative code samples directly from Ubiquiti's documentation.
Instructions
Get a runnable request for one endpoint, in one language, as published by Ubiquiti.
Returns a heading naming the endpoint, language and mode, followed by a single code block. The request shape is authoritative; host addresses, site ids and API keys are placeholders to fill in. Bodies show the schema's default values, not a worked example — combine with get_endpoint or get_field_schema when the payload matters. If the requested language and mode pair does not exist, the reply lists the pairs that do instead of failing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'local' addresses the console directly (https://<console-ip>/proxy/…); 'remote' goes through the UniFi cloud API (api.ui.com). Defaults to 'local', except for the cloud-only applications — site-manager, mobility and carrier-fabric — which have no local form and default to 'remote'. | |
| slug | Yes | Endpoint identifier, app-qualified or bare when unambiguous. | |
| language | No | One of curl, go, nodejs, python, ansible. | curl |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |