CLI

Share text directly from your terminal. No installation required — works with PowerShell, curl, wget, or any HTTP client.

Quick Start

Upload any text with a single command:

gc c:\myfile.txt | Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts" -Method POST
No Installation Required

Works with built-in tools like curl, PowerShell, or wget.

Secure by Design

Capability-based delete tokens. Only you can delete your shares.

Pipe-Friendly

Stream output directly. Perfect for logs, scripts, and automation.

Response Format

Every upload returns a JSON response with everything you need:

{
  "id": "a8f3k9d2m1p4",
  "viewUrl": "https://txt.parts/share/a8f3k9d2m1p4?token=...",
  "apiUrl": "https://txt.parts/api/v2/parts/a8f3k9d2m1p4",
  "rawUrl": "https://txt.parts/api/v2/parts/a8f3k9d2m1p4/raw",
  "deleteToken": "dt_7k2mP9xL4nQ8rT1w...",
  "expiresAt": "2025-01-19T15:30:00Z",
  "expiresIn": 3600
}
viewUrl
Browser-friendly link to share
apiUrl
JSON endpoint for metadata
rawUrl
Plain text content for piping
deleteToken
Secret token to delete the share

Examples

Create a Share
# Upload a file
gc c:\logs\error.log | Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts" -Method POST

# Upload with custom expiry (24 hours)
$headers = @{ "X-Expiry" = "86400" }
gc c:\data\report.csv | Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts" -Method POST -Headers $headers

# Create a one-time link
$headers = @{ "X-Single-Use" = "true" }
"Secret message" | Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts" -Method POST -Headers $headers
Retrieve Content
# Get content as JSON (with metadata)
Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts/abc123"

# Get raw content (pipe-friendly)
Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts/abc123/raw"

# Save to file
Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts/abc123/raw" | Out-File downloaded.txt
Delete a Share
# Save response when creating
$response = "Important data" | Invoke-RestMethod -Uri "https://txt.parts/api/v2/parts" -Method POST

# Delete using the token
$headers = @{ "X-Delete-Token" = $response.deleteToken }
Invoke-RestMethod -Uri $response.apiUrl -Method DELETE -Headers $headers

Options Reference

HeaderValuesDescription
X-Expiry60 - 604800Expiration time in seconds (default: 3600 = 1 hour)
X-Single-Usetrue / falseCreate a one-time link (default: false)
X-Languagejson, xml, python, etc.Syntax highlighting hint (default: plaintext)
X-Delete-Tokendt_...Required for DELETE requests

Rate Limits

Anonymous

10

requests per hour

Pro

200

requests per minute

Enterprise

1000

requests per 10 seconds