Files
POST /files/upload
Upload a file to the system
curl -X POST "https://api.example.com/v2/files/upload" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.example.com/v2/files/upload"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.post(url, headers=headers)
print(response.json())
const response = await fetch("https://api.example.com/v2/files/upload", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
)
func main() {
req, err := http.NewRequest("POST", "https://api.example.com/v2/files/upload", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/v2/files/upload')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"id": "file_abc123",
"filename": "document.pdf",
"size": 1048576,
"mime_type": "application/pdf",
"category": "document",
"url": "https://files.example.com/document.pdf",
"uploaded_at": "2024-12-25T14:30:00Z",
"tags": [
"important",
"project-a"
]
}
{
"error": "Error",
"message": "File too large",
"code": 413
}
POST
/files/upload
POST
Security Scheme
X-API-Keystring
RequiredAPI key for authentication. Get your API key from the dashboard.
API key for authentication. Get your API key from the dashboard.
Content-Typestring
RequiredThe media type of the request body
Options: multipart/form-data
filestring
RequiredThe file to upload
Format: binary
categorystring
Options: document, image, video, other
Request Preview
Response
Response will appear here after sending the request
Authentication
header
X-API-Keystring
RequiredAPI Key for authentication. API key for authentication. Get your API key from the dashboard.