---
title: port
full: true
---

import { Root, API, APIInfo, APIExample, Responses, Response, ResponseTypes, ExampleResponse, TypeScriptResponse, Property, ObjectCollapsible, Requests, Request } from "fumadocs-ui/components/api";

<Root>

<API>

<APIInfo method={"POST"} route={"/port.create"}>

## port-create

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"publishedPort"} type={"number"} required={true} deprecated={undefined}>

</Property>

<Property name={"targetPort"} type={"number"} required={true} deprecated={undefined}>

</Property>

<Property name={"protocol"} type={"string"} required={false} deprecated={undefined}>

<span>Default:  `"tcp"`</span>

<span>Value in:  `"tcp" | "udp"`</span>

</Property>

<Property name={"applicationId"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length:  `1`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/port.create" \
  -d '{
  "publishedPort": 0,
  "targetPort": 0,
  "protocol": "tcp",
  "applicationId": "string"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/port.create", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"GET"} route={"/port.one"}>

## port-one

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Query Parameters

<Property name={"portId"} type={"string"} required={true} deprecated={false}>

<span>Minimum length:  `1`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X GET "http://localhost:3000/api/port.one?portId=string"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/port.one?portId=string", {
  method: "GET"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/port.delete"}>

## port-delete

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"portId"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length:  `1`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/port.delete" \
  -d '{
  "portId": "string"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/port.delete", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/port.update"}>

## port-update

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"portId"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length:  `1`</span>

</Property>

<Property name={"publishedPort"} type={"number"} required={true} deprecated={undefined}>

</Property>

<Property name={"targetPort"} type={"number"} required={true} deprecated={undefined}>

</Property>

<Property name={"protocol"} type={"string"} required={false} deprecated={undefined}>

<span>Default:  `"tcp"`</span>

<span>Value in:  `"tcp" | "udp"`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/port.update" \
  -d '{
  "portId": "string",
  "publishedPort": 0,
  "targetPort": 0,
  "protocol": "tcp"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/port.update", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

</Root>