🔒 API Documentation

API access is available exclusively to DEVELOPER plan users.

View Plans Sign In
ZeroHost Logo
About Blog Features FAQ Pricing Share Now

🔌 ZeroHost API Documentation

Complete REST API reference for integrating ephemeral text sharing into your applications

Base URL: https://api.zerohost.net

📋 Table of Contents

  • Quick Start
  • Authentication & Rate Limiting
  • API Endpoints
    • POST /v1/share - Create Share
    • GET /v1/share/{id} - Get Share
    • POST /v1/share/{id} - Get Protected Share
    • GET /v1/usage - Check Usage
  • Error Handling

🚀 Quick Start

Get started with the ZeroHost API in under 5 minutes:

# Create a share
curl -X POST https://api.zerohost.net/v1/share \
  -H "Content-Type: application/json" \
  -H "X-API-Key: zh_your_api_key_here" \
  -d '{
    "text": "Hello, World!",
    "expires_in": "24h",
    "reference": "CLI-001"
  }'

# Get a share
curl -H "X-API-Key: zh_your_api_key_here" \
  https://api.zerohost.net/v1/share/abc123
// Create a share
const response = await fetch('https://api.zerohost.net/v1/share', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'zh_your_api_key_here'
  },
  body: JSON.stringify({
    text: 'Hello, World!',
    expires_in: '24h',
    reference: 'JS-001'
  })
});

const share = await response.json();
console.log('Share URL:', share.url);
import requests

# Create a share
response = requests.post(
    'https://api.zerohost.net/v1/share',
    headers={
        'Content-Type': 'application/json',
        'X-API-Key': 'zh_your_api_key_here'
    },
    json={
        'text': 'Hello, World!',
        'expires_in': '24h',
        'reference': 'PY-001'
    }
)

share = response.json()
print(f"Share URL: {share['url']}")

🔐 Authentication & Rate Limiting

The ZeroHost API requires authentication via API keys. API keys provide secure access with higher rate limits and extended features exclusively for DEVELOPER plan users.

API Key Authentication

All API requests require your API key in the X-API-Key header:

  • Header: X-API-Key: zh_your_api_key_here
  • DEVELOPER Plan: 1000 API requests/day, up to 30-day expiry, unlimited shares

Getting Your API Key

Generate your API key from your account dashboard:

  1. Sign in to your ZeroHost account
  2. Navigate to Account Settings
  3. Click "Generate API Key" in the API section
  4. Store your key securely - it will only be shown once

Example Request

# All API requests require authentication
curl -H "X-API-Key: zh_your_api_key_here" \
  https://api.zerohost.net/v1/share/abc123
⚠️ Security Note: Keep your API key secret. Never commit it to version control or expose it in client-side code. Use environment variables or secure configuration management.
POST /v1/share

Create a new ephemeral text share

Request Body

Parameter Type Required Description
text string Required Content to share (max 1MB)
expires_in string Optional Expiry time: "1h", "6h", "24h", "7d" (default: "24h")
password string Optional Password protect the share
burn_after_reading boolean Optional Delete after first view (default: false)
reference string Optional Reference label (auto-truncated to 8 chars, e.g., "PROJ-123") - authenticated users only

Request Headers

Header Required Description
Content-Type Required application/json
X-API-Key Required Your ZeroHost API key (starts with zh_)

Example Request

{
  "text": "This is my secure content",
  "expires_in": "24h",
  "password": "mysecretpass",
  "burn_after_reading": false,
  "reference": "PROJ-123"
}

Note: Reference values longer than 8 characters are automatically truncated to the first 8 characters.

Success Response

200 OK
{
  "id": "9b042e2b144afeb6421592fc7f5c0d94",
  "url": "https://zerohost.net/share/9b042e2b144afeb6421592fc7f5c0d94",
  "expires_at": "2024-12-16T12:00:00.000Z",
  "expires_in": 86400,
  "plan": "free",
  "usage": {
    "current": 3,
    "limit": 25
  }
}
GET /v1/share/{id}

Retrieve a shared text (public shares only)

Path Parameters

Parameter Type Description
id string Share ID (32-character hex string)

Success Response

200 OK
{
  "id": "9b042e2b144afeb6421592fc7f5c0d94",
  "text": "This is my secure content",
  "created_at": "2024-12-15T12:00:00.000Z",
  "expires_at": "2024-12-16T12:00:00.000Z",
  "has_password": false,
  "burn_after_reading": false,
  "view_count": 1
}

Password Protected Share

401 Unauthorized
{
  "error": "Password required",
  "message": "This share requires a password",
  "requires_password": true
}
POST /v1/share/{id}

Retrieve a password-protected share

Path Parameters

Parameter Type Description
id string Share ID (32-character hex string)

Request Body

Parameter Type Required Description
password string Required Password for the protected share

Example Request

{
  "password": "mysecretpass"
}

Success Response

200 OK
{
  "id": "9b042e2b144afeb6421592fc7f5c0d94",
  "text": "This is my password-protected content",
  "created_at": "2024-12-15T12:00:00.000Z",
  "expires_at": "2024-12-16T12:00:00.000Z",
  "has_password": true,
  "burn_after_reading": false,
  "view_count": 1
}
GET /v1/usage

Check current usage and limits

Request Headers

Header Required Description
X-API-Key Required Your ZeroHost API key for usage tracking

Success Response

200 OK
{
  "plan": "free",
  "usage": {
    "current": 5,
    "limit": 25,
    "period": "daily",
    "resets_at": "2024-12-16T00:00:00.000Z"
  }
}

❌ Error Handling

All API errors return JSON with error details:

Status Code Error Type Description
400 Bad Request Invalid request body or parameters
401 Unauthorized Invalid password or authentication required
404 Not Found Share not found, expired, or deleted
429 Rate Limited Usage limit exceeded
500 Server Error Internal server error

Error Response Format

{
  "error": "Rate limit exceeded",
  "message": "You have reached your daily limit of 25 shares. Upgrade to Pro for unlimited shares.",
  "code": "RATE_LIMIT_EXCEEDED",
  "details": {
    "limit": 25,
    "current": 25,
    "resets_at": "2024-12-16T00:00:00.000Z"
  }
}

💻 Code Examples

Node.js SDK (Coming Soon)

const ZeroHost = require('zerohost-sdk');

const client = new ZeroHost({
  apiKey: 'zh_your_api_key_here'
});

// Create a share
const share = await client.createShare({
  text: 'Hello, World!',
  expiresIn: '24h',
  password: 'optional-password'
});

console.log('Share URL:', share.url);

// Get a share
const content = await client.getShare(share.id, 'optional-password');
console.log('Content:', content.text);

Python SDK (Coming Soon)

from zerohost import ZeroHost

client = ZeroHost(api_key="zh_your_api_key_here")

# Create a share
share = client.create_share(
    text="Hello, World!",
    expires_in="24h",
    password="optional-password"
)

print(f"Share URL: {share.url}")

# Get a share
content = client.get_share(share.id, password="optional-password")
print(f"Content: {content.text}")
ZeroHost Logo

Privacy-first ephemeral text sharing for developers. Share once, forget forever.

  • Features
  • Pricing
  • CLI Tool
  • About Us
  • Blog
  • FAQ
  • Developer Hub
  • API Docs
  • Privacy Policy
  • Terms of Service
  • Issues
  • Contact

© 2025 ZeroHost. Secure by default, private by design.

Sitemap Security Policy