Create Weighted Backend

Create a new Weighted backend

Request

POST /backends/weighted

Example Request

curl \
-X POST \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"backends":{"bkdhr_32ELHVckeVuUNCrvOOKGhxp33Gw":1,"bkdhr_32ELHaHUpqQPZiehAj7X99dgpY8":0},"description":"acme weighted","metadata":"{\"environment\": \"staging\"}"}' \
https://api.ngrok.com/backends/weighted

Parameters

NameTypeDescription
descriptionstringhuman-readable description of this backend. Optional
metadatastringarbitrary user-defined machine-readable data of this backend. Optional
backendsMap<string, int64>the ids of the child backends to their weights [0-10000]

Response

Returns a 201 response on success

Example Response

{
  "backends": {
    "bkdhr_32ELHVckeVuUNCrvOOKGhxp33Gw": 1,
    "bkdhr_32ELHaHUpqQPZiehAj7X99dgpY8": 0
  },
  "created_at": "2025-09-04T10:11:37Z",
  "description": "acme weighted",
  "id": "bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf",
  "metadata": "{\"environment\": \"staging\"}",
  "uri": "https://api.ngrok.com/backends/weighted/bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf"
}

Fields

NameTypeDescription
idstringunique identifier for this Weighted backend
uristringURI of the WeightedBackend API resource
created_atstringtimestamp when the backend was created, RFC 3339 format
descriptionstringhuman-readable description of this backend. Optional
metadatastringarbitrary user-defined machine-readable data of this backend. Optional
backendsMap<string, int64>the ids of the child backends to their weights [0-10000]

Delete Weighted Backend

Delete a Weighted backend by ID.

Request

DELETE /backends/weighted/{id}

Example Request

curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/backends/weighted/bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf

Response

Returns a 204 response with no body on success

Get Weighted Backend

Get detailed information about a Weighted backend by ID

Request

GET /backends/weighted/{id}

Example Request

curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/backends/weighted/bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf

Response

Returns a 200 response on success

Example Response

{
  "backends": {
    "bkdhr_32ELHVckeVuUNCrvOOKGhxp33Gw": 1,
    "bkdhr_32ELHaHUpqQPZiehAj7X99dgpY8": 0
  },
  "created_at": "2025-09-04T10:11:37Z",
  "description": "acme weighted",
  "id": "bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf",
  "metadata": "{\"environment\": \"staging\"}",
  "uri": "https://api.ngrok.com/backends/weighted/bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf"
}

Fields

NameTypeDescription
idstringunique identifier for this Weighted backend
uristringURI of the WeightedBackend API resource
created_atstringtimestamp when the backend was created, RFC 3339 format
descriptionstringhuman-readable description of this backend. Optional
metadatastringarbitrary user-defined machine-readable data of this backend. Optional
backendsMap<string, int64>the ids of the child backends to their weights [0-10000]

List Weighted Backends

List all Weighted backends on this account

Request

GET /backends/weighted

Example Request

curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/backends/weighted

Response

Returns a 200 response on success

Example Response

{
  "backends": [
    {
      "backends": {
        "bkdhr_32ELHVckeVuUNCrvOOKGhxp33Gw": 1,
        "bkdhr_32ELHaHUpqQPZiehAj7X99dgpY8": 0
      },
      "created_at": "2025-09-04T10:11:37Z",
      "description": "acme weighted",
      "id": "bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf",
      "metadata": "{\"environment\": \"staging\"}",
      "uri": "https://api.ngrok.com/backends/weighted/bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf"
    }
  ],
  "next_page_uri": null,
  "uri": "https://api.ngrok.com/backends/weighted"
}

Fields

NameTypeDescription
backendsWeightedBackendthe list of all Weighted backends on this account
uristringURI of the Weighted backends list API resource
next_page_uristringURI of the next page, or null if there is no next page

WeightedBackend fields

NameTypeDescription
idstringunique identifier for this Weighted backend
uristringURI of the WeightedBackend API resource
created_atstringtimestamp when the backend was created, RFC 3339 format
descriptionstringhuman-readable description of this backend. Optional
metadatastringarbitrary user-defined machine-readable data of this backend. Optional
backendsMap<string, int64>the ids of the child backends to their weights [0-10000]

Update Weighted Backend

Update Weighted backend by ID

Request

PATCH /backends/weighted/{id}

Example Request

curl \
-X PATCH \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"metadata":"{\"environment\": \"production\"}"}' \
https://api.ngrok.com/backends/weighted/bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf

Parameters

NameTypeDescription
idstring
descriptionstringhuman-readable description of this backend. Optional
metadatastringarbitrary user-defined machine-readable data of this backend. Optional
backendsMap<string, int64>the ids of the child backends to their weights [0-10000]

Response

Returns a 200 response on success

Example Response

{
  "backends": {},
  "created_at": "2025-09-04T10:11:37Z",
  "description": "acme weighted",
  "id": "bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf",
  "metadata": "{\"environment\": \"production\"}",
  "uri": "https://api.ngrok.com/backends/weighted/bkdwd_32ELHcDT2RYt50eSIeXINRyuhnf"
}

Fields

NameTypeDescription
idstringunique identifier for this Weighted backend
uristringURI of the WeightedBackend API resource
created_atstringtimestamp when the backend was created, RFC 3339 format
descriptionstringhuman-readable description of this backend. Optional
metadatastringarbitrary user-defined machine-readable data of this backend. Optional
backendsMap<string, int64>the ids of the child backends to their weights [0-10000]