API7 Docs
API7 GatewayAPI7 Enterprise Admin APIsUpload a file

Upload a file

POST /api/files

POST /api/files

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Query Parameters

name*string

Original file name.

Request Body

application/octet-stream

Raw file content (maximum 10 MiB).

Response Body

application/json

application/json

curl -X POST "$API_BASE_URL/api/files?name=petstore-api.json"

File uploaded successfully.

{
  "value": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "petstore-api.json",
    "mime_type": "application/json",
    "size": 12345,
    "created_at": 1711234567
  }
}
Complete operation details and schema variants

POST /api/files

Upload a file

Upload a file to the control plane. The file is stored compressed in the database. Returns the file ID which can be used to construct a dp-manager URL for plugin configuration.

Parameters

  • name (query, string, required): Original file name.

Request body

Raw file content (maximum 10 MiB).

Content type: application/octet-stream

Responses

  • 200: File uploaded successfully.
  • value (object, optional):
  • value.id (string, optional): Unique identifier for the uploaded file.
  • value.name (string, optional): Original file name.
  • value.mime_type (string, optional): Detected MIME type of the file.
  • value.size (integer, optional): Original file size in bytes.
  • value.created_at (integer, optional): Upload timestamp (Unix epoch).
  • 400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
  • value (object, optional): The specific resource.
  • error_msg (string, optional): The error message.

cURL

curl -X POST '$API_BASE_URL/api/files'