POST/v2/load_balancers/{lb_id}/forwarding_rules

Add forwarding rules to a load balancer

Adds one or more forwarding rules to a load balancer. Provide at least one rule in forwarding_rules, with the required entry and target protocols and ports. A 204 response confirms the rules were added and returns no body.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 1 body field
lb_idstringrequired
The unique identifier of the load balancer to add forwarding rules to.

Forwarding rules to add. Include at least one rule, with the required entry and target protocols and ports.

forwarding_rulesarray<object>required
An array of forwarding rules to add. Each rule must specify `entry_protocol`, `entry_port`, `target_protocol`, and `target_port`.

6 status codes
204Returns no response body when the forwarding rules are added successfully.
401Returned when authentication fails because the credentials are invalid.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404Returned when the requested resource is not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429Returned when the API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Returned when a server error occurs.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 indicates invalid credentials, a 404 indicates the resource was not found, a 429 indicates the API rate limit was exceeded, and a 500 indicates a server error. The lb_id path parameter must identify a load balancer. The forwarding_rules array must contain at least one rule, and each rule must include entry_protocol, entry_port, target_protocol, and target_port; the protocols must be allowed values, and if either protocol is udp, both must be udp.