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
2023-05-17 21:36:09 +08:00

1.0 KiB

API Documentation:

passwordHandler:

This API endpoint receives a POST request with a JSON body that contains a "password" field. The API updates the value of the ADMIN_PASSWORD variable with the value provided in the request body.

HTTP method: PATCH

Endpoint: /password

Request body:

{
    "password": string
}

Response status codes:

  • 200 OK: The ADMIN_PASSWORD variable was successfully updated.
  • 400 Bad Request: The "password" field is missing or not provided in the request body.

tokensHandler:

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 ACCESS_TOKENS variable with a new access token generated from the request tokens provided in the request body.

HTTP method: PATCH

Endpoint: /tokens

Request body:

[
    "string", "..."
]

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.