AI ready
Open in Claude (opens in a new tab)View as Markdown

Add a firewall rule

POST/services/{serviceId}/firewall/rules

Use this to open and protect a port range with a protection profile. A server has at most 15 rules, and rules of one protocol cannot overlap.

Token
Bearer API token: cxk_live_ followed by 46 letters and digits
Scope
firewall:write
Header
Authorization: Bearer $CLOUDUXE_API_KEY

How tokens and scopes work: Authentication and scopes.

  • serviceIdstring (uuid)Required

    The service's id.

  • Clouduxe-VersionstringOptional

    The API version to use, such as 2026-12-01. Omit it to use your token's version.

    pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
  • Idempotency-KeystringRequired

    A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours.

    pattern ^[A-Za-z0-9_.:-]{1,128}$

Body

Required
  • protocolstringRequired

    tcp or udp.

    One oftcpudp
  • portStartintegerRequired

    The first port.

    min 1, max 65535
  • portEndintegerRequired

    The last port, at least portStart.

    min 1, max 65535
  • profilestringRequired

    The protection profile.

    pattern ^[A-Za-z0-9_-]{1,40}$
  • enabledbooleanOptional

    Whether the rule is on. Default true.

  • ppsLimitintegerOptional

    Default 0.

    min 0, max 4294967295
  • connectionPpsLimitintegerOptional

    Default 0.

    min 0, max 4294967295
  • newConnectionsPerSecondintegerOptional

    Default 0.

    min 0, max 30
  • onlyProxiedbooleanOptional

    Default false.

  • blockUdpbooleanOptional

    Default false.

  • protocolValidationbooleanRequired

    Whether to check traffic against the profile's protocol.

Returns

201Created The firewall, with the new rule.

  • objectstringRequired

    The object's type. Always "firewall".

  • serviceIdstring (uuid)Required

    The service's id.

  • enabledbooleanRequired

    Whether protection is on.

  • defaultPolicystringRequired

    What happens to ports no enabled rule covers: allow or deny.

    One ofallowdeny
  • rulesarray of FirewallRuleRequired

    The inbound rules, at most 15.

    max items 15
    Show 12 child attributesHide 12 child attributes
    • idstringRequired

      The rule's id: its protocol and first port, such as tcp-30120.

    • protocolstringRequired

      tcp or udp.

      One oftcpudp
    • portStartintegerRequired

      The first port.

      min 1, max 65535
    • portEndintegerRequired

      The last port.

      min 1, max 65535
    • profilestringRequired

      The protection profile that inspects this traffic, such as fivem or generic.

      pattern ^[A-Za-z0-9_-]{1,40}$
    • enabledbooleanRequired

      Whether the rule is on.

    • ppsLimitintegerRequired

      Packets per second allowed to the whole port range; 0 means no extra limit.

      min 0
    • connectionPpsLimitintegerRequired

      Packets per second allowed per established connection; 0 means no extra limit.

      min 0
    • newConnectionsPerSecondintegerRequired

      New connections per second allowed from one source address, 0 to 30; 0 means no extra limit.

      min 0, max 30
    • onlyProxiedbooleanRequired

      Accept only traffic that arrives through Clouduxe's protected proxy.

    • blockUdpbooleanRequired

      Drop UDP to this range.

    • protocolValidationbooleanRequired

      Check that traffic follows the profile's protocol, and drop what does not.

  • blockedIpsarray of BlockedIpRequired

    Blocked source addresses.

    Show 2 child attributesHide 2 child attributes
    • ipstringRequired

      The IPv4 address.

    • expiresAtstring (date-time) or nullRequired

      When the block ends, or null for no end.

  • trustedIpsarray of TrustedIpRequired

    Trusted source addresses.

    Show 2 child attributesHide 2 child attributes
    • ipstringRequired

      The IPv4 address.

    • notestring or nullRequired

      Your note.

  • updatedAtstring (date-time) or nullRequired

    When this state was read.

Every response

  • 201CreatedThe firewall, with the new rule.
  • 400Bad requestThe request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown.
  • 401UnauthorizedAuthentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked.
  • 403ForbiddenThe token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing.
  • 404Not foundNot found. Codes: not_found.
  • 409ConflictThe request conflicts with the object's current state. Codes: firewall_not_available, firewall_rule_overlap, firewall_rule_exists, idempotency_in_progress.
  • 413Too largeThe request body is too large. Codes: request_too_large.
  • 415Unsupported media typeUnsupported media type. Codes: unsupported_media_type.
  • 422UnprocessableThe request is well formed but cannot be carried out. Codes: firewall_rule_limit, firewall_value_refused, idempotency_mismatch.
  • 423The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting.
  • 429Too many requestsA rate limit was reached. Codes: rate_limited.
  • 500Server errorUnexpected error. Codes: internal_error.
  • 503UnavailableTemporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable.

Updated 5 November 2026. Generated from the API contract.

Need a server, or a hand with one?

Pick a plan to deploy a server, or open a ticket in the panel. Support runs 24/7/365.