---
title: "Issue Tunnel Gateway Key"
method: POST
path: "/workspaces/{workspace_id}/tunnels/{tunnel_id}/gateway-key"
tags: ["tunnels"]
---

# Issue Tunnel Gateway Key

`POST /workspaces/{workspace_id}/tunnels/{tunnel_id}/gateway-key`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/workspaces/{workspace_id}/tunnels/{tunnel_id}/gateway-key`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Issue a gateway key for the tunnel, revoking the previous key.

The key is returned only in this response.

## Path parameters

- `tunnel_id` string, uuid, required
- `workspace_id` string, uuid, required

## Response `201`

Successful Response

- TunnelGatewayKeyRead: A newly issued gateway key. It is only returned once, at issue time.
  - `tunnel_id` string, uuid, required
  - `gateway_key` string, required: Configure this on the tunnel gateway. Issuing a new key revokes the old one.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tracecat/apis/tracecat-api.md) - [All operations](https://skmtc.dev/tracecat/apis/tracecat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tracecat/apis/tracecat-api/revisions/2efdda25045f?raw)
