API Documentation

This API allows developers to interact with the Config Converter backend. It supports saving, loading, editing, and deleting configurations, as well as converting configurations to Singbox format.

link

Base URL

https://yebekhe.site/api/tosingbox/api.php
api

Endpoints

All requests must include the action parameter to specify the operation.

1. Save Configuration

Endpoint: POST /

Request Parameters:

{
    "action": "save",
    "configs": "vmess://example1\nvless://example2",
    "config_name": "My Config",
    "tun_mode": "true",
    "save_only": "false"
}
            

Response:

{
    "url": "https://yebekhe.site/api/tosingbox/configs/12345.jsonc",
    "private_key": "a1b2c3d4e5f6g7h8i9j0"
}
            

2. Load Configuration

Endpoint: POST /

Request Parameters:

{
    "action": "load",
    "private_key": "a1b2c3d4e5f6g7h8i9j0"
}
            

Response:

{
    "original_configs": "vmess://example1\nvless://example2",
    "converted_configs": "//profile-title: base64:...",
    "name": "My Config",
    "tun_mode": "true"
}
            

3. Edit Original Configuration

Endpoint: POST /

Request Parameters:

{
    "action": "edit_original",
    "private_key": "a1b2c3d4e5f6g7h8i9j0",
    "configs": "vmess://updated1\nvless://updated2",
    "config_name": "Updated Config",
    "tun_mode": "false",
    "save_only": "false"
}
            

Response:

{
    "message": "Configuration updated successfully."
}
            

4. Edit Converted Configuration

Endpoint: POST /

Request Parameters:

{
    "action": "edit_converted",
    "private_key": "a1b2c3d4e5f6g7h8i9j0",
    "converted_configs": "//profile-title: base64:...",
    "config_name": "Updated Config"
}
            

Response:

{
    "message": "Configuration updated successfully."
}
            

5. Delete Configuration

Endpoint: POST /

Request Parameters:

{
    "action": "delete",
    "private_key": "a1b2c3d4e5f6g7h8i9j0"
}
            

Response:

{
    "message": "Configuration deleted successfully."
}
            
error

Error Responses

{
    "error": "Invalid private key."
}
            
timer

Rate Limiting

Rate Limit: 100 requests per hour per IP address.

Response Headers:

lock

Authentication

No authentication is required to use the API. However, each configuration is protected by a unique private_key.

code

Examples

Example 1: Save a Configuration

curl -X POST https://yebekhe.site/api/tosingbox/api.php \
-H "Content-Type: application/json" \
-d '{
    "action": "save",
    "configs": "vmess://example1\nvless://example2",
    "config_name": "My Config",
    "tun_mode": "true",
    "save_only": "false"
}'
            

Example 2: Load a Configuration

curl -X POST https://yebekhe.site/api/tosingbox/api.php \
-H "Content-Type: application/json" \
-d '{
    "action": "load",
    "private_key": "a1b2c3d4e5f6g7h8i9j0"
}'
            

Example 3: Delete a Configuration

curl -X POST https://yebekhe.site/api/tosingbox/api.php \
-H "Content-Type: application/json" \
-d '{
    "action": "delete",
    "private_key": "a1b2c3d4e5f6g7h8i9j0"
}'
            
file_download

Download Postman Collection

Click the button below to download the Postman Collection for this API.