> API_DOCUMENTATION
Automate your workflow with the UploadText API.
> AUTHENTICATION
To use the API, you must first generate a Personal Access Token (PAT) from your Account Settings. Include this token in the `Authorization` header of all your requests.
Authorization: Bearer YOUR_API_TOKEN
Note: The API is strictly rate-limited to 100 requests per minute per user.
> ENDPOINTS
GET
/api/v1/snippets
Retrieve a paginated list of all your created snippets.
// Example Response
{
"status": "success",
"data": {
"current_page": 1,
"data": [
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"title": "My Config File",
"language": "json",
"created_at": "2026-05-02T10:00:00.000000Z"
}
],
"total": 1
}
}
POST
/api/v1/snippets
Create a new snippet. Supports standard payload, self-destruction, and encryption.
Required Parameters:
content(string)language(enum)expires_in(enum: 1_hour, 1_day, 1_week, never)
Optional Parameters:
title(string)tags(string, comma-separated)password(string, AES-256-CBC)burn_after_read(boolean)is_public(boolean)
> CODE_EXAMPLES
cURL
curl -X POST "https://uploadtext.app/api/v1/snippets" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "cURL Upload",
"content": "Hello from Terminal",
"language": "plaintext",
"expires_in": "1_day"
}'
PHP (cURL)
$ch = curl_init('https://uploadtext.app/api/v1/snippets');
$payload = json_encode([
'title' => 'PHP Upload',
'content' => 'echo "Hello World";',
'language' => 'php',
'expires_in' => 'never',
'is_public' => true
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json',
'Accept: application/json',
'Content-Length: ' . strlen($payload)
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python (Requests)
import requests
url = "https://uploadtext.app/api/v1/snippets"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"title": "Python Upload",
"content": "print('Hello World')",
"language": "python",
"expires_in": "1_week"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
JavaScript (Fetch)
fetch('https://uploadtext.app/api/v1/snippets', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
title: 'JS Upload',
content: 'console.log("Hello World");',
language: 'javascript',
expires_in: '1_hour'
})
})
.then(response => response.json())
.then(data => console.log(data));
GET
/api/v1/snippets/{uuid}
Retrieve metadata for a specific snippet. Does not return the raw content.
DELETE
/api/v1/snippets/{uuid}
Permanently delete a specific snippet from the system.