1
0
This repository has been archived on 2024-02-27. You can view files and clone it, but cannot push or open issues or pull requests.
chatgpt-to-api/docs/admin.md

84 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2023-04-12 11:01:08 +00:00
# API Documentation:
2023-06-04 12:45:41 +00:00
## openaiHandler:
This API endpoint receives a POST request with a JSON body that contains OpenAI credentials. The API updates the environment variables "OPENAI_EMAIL" and "OPENAI_PASSWORD" with the provided credentials.
HTTP method: PATCH
Endpoint: /openai
Request body:
```json
{
"OpenAI_Email": "string",
"OpenAI_Password": "string"
}
```
Response status codes:
- 200 OK: The OpenAI credentials were successfully updated.
- 400 Bad Request: The JSON in the request body is invalid.
2023-04-12 11:00:39 +00:00
2023-04-12 11:01:08 +00:00
## passwordHandler:
2023-04-12 11:00:39 +00:00
2023-06-04 12:45:41 +00:00
This API endpoint receives a POST request with a JSON body that contains a new password. The API updates the global variable "ADMIN_PASSWORD" and the environment variable "ADMIN_PASSWORD" with the new password.
2023-04-12 11:00:39 +00:00
2023-05-17 13:36:09 +00:00
HTTP method: PATCH
2023-04-12 11:00:39 +00:00
Endpoint: /password
Request body:
```json
{
2023-06-04 12:45:41 +00:00
"password": "string"
2023-04-12 11:00:39 +00:00
}
```
Response status codes:
2023-06-04 12:45:41 +00:00
- 200 OK: The password was successfully updated.
- 400 Bad Request: The password is missing or not provided in the request body.
## puidHandler:
This API endpoint receives a POST request with a JSON body that contains a new PUID (Personal User ID). The API updates the environment variable "PUID" with the new PUID.
HTTP method: PATCH
Endpoint: /puid
Request body:
```json
{
"puid": "string"
}
```
Response status codes:
- 200 OK: The PUID was successfully updated.
- 400 Bad Request: The PUID is missing or not provided in the request body.
2023-04-12 11:00:39 +00:00
2023-04-12 11:01:08 +00:00
## tokensHandler:
2023-04-12 11:00:39 +00:00
2023-06-04 12:45:41 +00:00
This API endpoint receives a POST request with a JSON body that contains an array of request tokens. The API updates the value of the global variable "ACCESS_TOKENS" with a new access token generated from the request tokens provided in the request body.
2023-04-12 11:00:39 +00:00
2023-05-17 13:36:09 +00:00
HTTP method: PATCH
2023-04-12 11:00:39 +00:00
Endpoint: /tokens
Request body:
```json
[
2023-05-17 13:36:09 +00:00
"string", "..."
2023-04-12 11:00:39 +00:00
]
```
Response status codes:
- 200 OK: The ACCESS_TOKENS variable was successfully updated.
- 400 Bad Request: The request tokens are missing or not provided in the request body.
2023-06-04 12:45:41 +00:00