> For the complete documentation index, see [llms.txt](https://docs.parallels.com/landing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parallels.com/landing/ras-rest-api-guide/api-reference/infrastructure/gateway/generate-web-api-secret.md).

# Generate Web API Secret

## Generate Web API Secret

> Generates a new Web API secret key and returns it.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/Gateway/GenerateWebAPISecret":{"post":{"tags":["0-Infrastructure/Secure Gateways//0-Basic Operations"],"summary":"Generate Web API Secret","description":"Generates a new Web API secret key and returns it.","operationId":"6dc076ce-9ff1-43f3-bdfd-92651d246fb7","responses":{"200":{"description":"Success","content":{"application/json; api-version=1.0":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

## Generate Web API Secret for Gateway

> Generates a new Web API secret and updates the specified Gateway settings.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/Gateway/{Id}/GenerateWebAPISecret":{"post":{"tags":["0-Infrastructure/Secure Gateways//0-Basic Operations"],"summary":"Generate Web API Secret for Gateway","description":"Generates a new Web API secret and updates the specified Gateway settings.","operationId":"e778da9c-5b7b-4b88-a37c-a4d84baee9b5","parameters":[{"name":"Id","in":"path","description":"ID of the Gateway server for which to generate the Web API secret.","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

## Generate Web API Secret for Default Settings

> Generates a new Web API secret and updates the default Gateway settings.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/Gateway/Default/GenerateWebAPISecret":{"post":{"tags":["0-Infrastructure/Secure Gateways//0-Basic Operations"],"summary":"Generate Web API Secret for Default Settings","description":"Generates a new Web API secret and updates the default Gateway settings.","operationId":"d7fd1bd2-43db-45c8-966e-9db46a6b4384","parameters":[{"name":"siteId","in":"query","description":"Site ID for which to generate the Web API secret (optional).","schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.parallels.com/landing/ras-rest-api-guide/api-reference/infrastructure/gateway/generate-web-api-secret.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
