playit.ggAPI docs

Request body#

  • tunnel_idstring (UUID)Required

    The tunnel to change.

  • firewall_idstring (UUID) or null

    The firewall to assign. To remove the firewall from the tunnel, set this field to null or leave it out.

Response#

If the request succeeds, the API returns HTTP 200. data is null.

Retries#

You can send the same request again safely. If someone else changed the assignment in the meantime, your request replaces their change.

Assign a firewallBash
curl --silent --show-error --fail-with-body \
  --request POST \
  --url "${PLAYIT_API_BASE}/tunnels/firewall/assign" \
  --header "Authorization: Api-Key ${PLAYIT_API_KEY}" \
  --header 'Content-Type: application/json' \
  --data-binary '{
    "tunnel_id": "22222222-2222-4222-8222-222222222222",
    "firewall_id": "11111111-1111-4111-8111-111111111111"
  }'
Remove the firewallBash
curl --silent --show-error --fail-with-body \
  --request POST \
  --url "${PLAYIT_API_BASE}/tunnels/firewall/assign" \
  --header "Authorization: Api-Key ${PLAYIT_API_KEY}" \
  --header 'Content-Type: application/json' \
  --data-binary '{
    "tunnel_id": "22222222-2222-4222-8222-222222222222",
    "firewall_id": null
  }'
ResponseJSON
{"status": "success", "data": null}

Errors#

If the request fails, the API returns HTTP 400. data is a string.

dataMeaning
TunnelNotFoundYour account does not have a tunnel with this ID.
InvalidFirewallIdThe firewall ID is not valid.

If the firewall does not exist, the API can return HTTP 500 instead.

Error responseJSON
{"status": "fail", "data": "TunnelNotFound"}