TrueJson API

Professional JSON Management API

v1.0
Back to Editor
Getting Started
The TrueJson API allows you to programmatically manage JSON documents, create versions, and integrate with your applications.

Base URL

https://truejson.com/api/v1

API Features

Create, read, update, delete JSON documents
Version management and history
Secure API key authentication
Rate limiting and monitoring
Authentication
All API requests require authentication using API keys in the Authorization header.

Authorization Header

Authorization: Bearer YOUR_API_KEY

Test Your Authentication

curl -X GET "https://truejson.com/api/v1/auth/test" \
  -H "Authorization: Bearer YOUR_API_KEY"
Documents API
Manage your JSON documents with full CRUD operations.
GET
/documents

Retrieve all documents for the authenticated user.

Example Request

curl -X GET "https://truejson.com/api/v1/documents" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "success": true,
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "My JSON Document",
      "content": "{\"key\": \"value\"}",
      "createdAt": "2024-01-26T10:00:00Z",
      "updatedAt": "2024-01-26T11:00:00Z"
    }
  ]
}
Version Management
Track changes and access document versions. Versions are automatically created when documents are updated.
GET
/documents/:id/versions

Example Request

curl -X GET "https://truejson.com/api/v1/documents/123e4567-e89b-12d3-a456-426614174000/versions" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "success": true,
  "data": [
    {
      "id": "version-uuid-1",
      "documentId": "123e4567-e89b-12d3-a456-426614174000",
      "versionNumber": "2",
      "content": "{\"updated\": \"content\"}",
      "description": "Auto-save",
      "tag": "",
      "createdAt": "2024-01-26T11:00:00Z"
    },
    {
      "id": "version-uuid-2",
      "documentId": "123e4567-e89b-12d3-a456-426614174000",
      "versionNumber": "1",
      "content": "{\"original\": \"content\"}",
      "description": "Initial version",
      "tag": "v1.0",
      "createdAt": "2024-01-26T10:00:00Z"
    }
  ]
}
Rate Limits
API Requests
500/minute

Rate limiting is applied per API key. When exceeded, you'll receive a 429 status code with retry information.

Error Handling
400 Bad Request
401 Unauthorized
404 Not Found
429 Rate Limited
{
  "success": false,
  "error": "Unauthorized",
  "message": "Invalid API key"
}
Code Examples
Ready-to-use code examples in popular programming languages.

Node.js / JavaScript

const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://truejson.com/api/v1';

// Create a new document
async function createDocument(name, content) {
  const response = await fetch(`${BASE_URL}/documents`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ name, content })
  });
  
  const result = await response.json();
  console.log('Created document:', result.data);
  return result.data;
}

// Get all documents
async function getDocuments() {
  const response = await fetch(`${BASE_URL}/documents`, {
    headers: {
      'Authorization': `Bearer ${API_KEY}`
    }
  });
  
  const result = await response.json();
  return result.data;
}

// Usage
createDocument('My API Document', '{"example": "data"}')
  .then(doc => console.log('Document created:', doc.id));

© 2026 TrueJson. All rights reserved.