dots.v2.load_balancers.byLb_id().forwarding_rules.post()

Generated on 13 Nov 2026 from DoTs version v1.24.0

Usage

client.v2.load_balancers.byLb_id(lb_id).forwarding_rules.post(body: Forwarding_rulesPostRequestBody, requestConfiguration?: RequestConfiguration<object>): Promise<void>

Description

To add an additional forwarding rule to a load balancer instance, send a POST request to /v2/load_balancers/{lb_id}/forwarding_rules. In the body of the request, there should be a forwarding_rules attribute containing an array of rules to be added.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters

Path Parameters

lb_id string required

Example: 4de7ac8b-495b-4884-9a69-1050c6793cd6

A unique identifier for a load balancer.

Min: 1

Request Body

forwardingRules array of objects required
Show child properties
entryProtocol string required

The protocol used for traffic to the load balancer. The possible values are: http, https, http2, http3, tcp, or udp. If you set the entry_protocol to udp, the target_protocol must be set to udp. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly.

One of: http, https, http2, http3, tcp, udp

entryPort integer required

Example: 443

An integer representing the port on which the load balancer instance will listen.

targetProtocol string required

The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: http, https, http2, tcp, or udp. If you set the target_protocol to udp, the entry_protocol must be set to udp. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly.

One of: http, https, http2, tcp, udp

targetPort integer required

Example: 80

An integer representing the port on the backend Droplets to which the load balancer will send traffic.

certificateId string optional

Example: 892071a0-bb95-49bc-8021-3afd67a210bf

The ID of the TLS certificate used for SSL termination if enabled.

tlsPassthrough boolean optional

Example: false

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

await client.v2.load_balancers
    .byLb_id("4de7ac8b-495b-4884-9a69-1050c6793cd6").forwarding_rules.post({
    forwardingRules: [
        {
            entryProtocol: "https",
            entryPort: 443,
            targetProtocol: "http",
            targetPort: 80,
            certificateId: "892071a0-bb95-49bc-8021-3afd67a210bf",
            tlsPassthrough: false,
        },
    ],
});

More Information

See /v2/load_balancers/{lb_id}/forwarding_rules in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.