Documentation API

Créez des expériences CMS headless avec RobotSpeed. Récupérez vos articles générés par IA via l'API REST et intégrez-les facilement dans vos applications.

Démarrage

  1. Get your API key from Settings
  2. Add X-API-Key header to requests
  3. Optional: Set up webhooks for real-time updates

Base URL: https://robot-speed.com/api/public

Authentification

API keys start with rs_. Include in X-API-Key header.

Example API Key

Bash
rs_c42abff3f9d5c35dfb66118caf451eacedd8846caf493e45f2279b02da11cf8e

cURL

Bash
# List all published articles
curl -X GET 'https://robot-speed.com/api/public/articles?limit=10' \
  -H 'X-API-Key: rs_your_api_key_here'

JavaScript

JavaScript
// Fetch all published articles
const response = await fetch('https://robot-speed.com/api/public/articles', {
  headers: {
    'X-API-Key': 'rs_your_api_key_here'
  }
});

const { data } = await response.json();
console.log(data.articles);

⚠️ Never expose keys in client-side code. Use environment variables.

Référence API REST

GET/api/public/articles

Returns published articles with pagination.

Query Parameters

ParameterTypeDefaultDescription
limitinteger50Max 100
offsetinteger0Pagination offset
statusstringpublishedpublished, approved, pending
debugbooleanfalseInclude debug info in response

Response

List Articles Response

JSON
{
  "success": true,
  "data": {
    "articles": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "title": "How to Build a SaaS in 2025",
        "excerpt": "Learn the best practices for building a SaaS...",
        "slug": "how-to-build-saas-2025",
        "status": "published",
        "seo_keywords": ["saas", "startup", "2025"],
        "meta_description": "Complete guide to building a SaaS in 2025",
        "target_keyword": "build saas",
        "featured_image_url": "https://xmphiscbmexupobiaivk.supabase.co/storage/v1/object/public/article-images/ai-images/featured-image-123.png",
        "featured_image_alt": "SaaS dashboard screenshot",
        "word_count": 1200,
        "reading_time": 6,
        "categories": ["startup", "technology"],
        "tags": ["saas", "business"],
        "created_at": "2025-01-15T10:00:00.000Z",
        "published_at": "2025-01-15T12:00:00.000Z",
        "platform_url": "https://yourblog.com/how-to-build-saas-2025",
        "platform_post_id": "wp-12345"
      }
    ],
    "pagination": {
      "total": 150,
      "limit": 50,
      "offset": 0
    }
  }
}

• List endpoint excludes content for performance
excerpt = first ~160 chars of article text
• For full HTML, use GET /api/public/articles/:id

GET/api/public/articles/:id

Returns a single article by ID.

Path Parameters

ParameterTypeDescription
idstring (UUID)The unique identifier of the article

Response

Single Article Response

JSON
{
  "success": true,
  "data": {
    "article": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "title": "How to Build a SaaS in 2025",
      "content": "<h1>How to Build a SaaS in 2025</h1><p>Building a SaaS requires careful planning...</p>",
      "excerpt": "Learn the best practices...",
      "slug": "how-to-build-saas-2025",
      "status": "published",
      "seo_keywords": ["saas", "startup"],
      "meta_description": "Complete guide...",
      "target_keyword": "build saas",
      "featured_image_url": "https://xmphiscbmexupobiaivk.supabase.co/storage/v1/object/public/article-images/ai-images/featured-image-123.png",
      "featured_image_alt": "SaaS dashboard",
      "word_count": 1200,
      "reading_time": 6,
      "categories": ["startup", "technology"],
      "tags": ["saas", "business"],
      "internal_links": [
        {
          "text": "Getting Started Guide",
          "url": "/getting-started"
        }
      ],
      "created_at": "2025-01-15T10:00:00.000Z",
      "published_at": "2025-01-15T12:00:00.000Z",
      "approved_at": "2025-01-15T11:30:00.000Z",
      "platform_url": "https://yourblog.com/article",
      "platform_post_id": "wp-12345"
    }
  }
}

Note: Includes internal_links and approved_at (not in list endpoint)

Webhooks

Receive HTTP POST requests when articles are published, updated, or deleted.

Configure in Dashboard → Settings → Webhooks

Available Events

EventDescription
article.publishedNew article published
article.updatedPublished article modified
article.deletedArticle deleted

Request Headers

Headers

Bash
POST https://your-endpoint.com/webhook
Content-Type: application/json
User-Agent: RobotSpeed-Webhooks/1.0

Payload Examples

article.published

JSON
{
  "event": "article.published",
  "timestamp": "2025-01-15T12:34:56.789Z",
  "website_id": "46fb1544-e8d7-4c71-9015-b8f1ae5b3984",
  "data": {
    "article_id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "How to Build a SaaS in 2025",
    "slug": "how-to-build-saas-2025",
    "published_at": "2025-01-15T12:00:00.000Z",
    "api_url": "/api/public/articles/550e8400-e29b-41d4-a716-446655440000",
    "content": {
      "html": "<h1>How to Build a SaaS in 2025</h1><p>Building a SaaS...</p>",
      "markdown": "# How to Build a SaaS in 2025\n\nBuilding a SaaS...",
      "text": "How to Build a SaaS in 2025 Building a SaaS..."
    },
    "meta_description": "Complete guide to building a SaaS in 2025",
    "seo_keywords": ["saas", "startup", "2025"],
    "target_keyword": "build saas",
    "categories": ["startup", "technology"],
    "tags": ["saas", "business"],
    "featured_image_url": "https://xmphiscbmexupobiaivk.supabase.co/storage/v1/object/public/article-images/ai-images/featured-image-123.png",
    "featured_image_alt": "SaaS dashboard",
    "status": "published",
    "created_at": "2025-01-15T10:00:00.000Z",
    "user_id": "user-uuid"
  }
}

article.updated

JSON
{
  "event": "article.updated",
  "timestamp": "2025-01-15T14:30:00.789Z",
  "website_id": "46fb1544-e8d7-4c71-9015-b8f1ae5b3984",
  "data": {
    "article_id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "How to Build a SaaS in 2025 [Updated]",
    "slug": "how-to-build-saas-2025",
    "updated_at": "2025-01-15T14:30:00.000Z",
    "updated_fields": ["title", "content", "meta_description"],
    "api_url": "/api/public/articles/550e8400-e29b-41d4-a716-446655440000",
    "content": {
      "html": "<h1>How to Build a SaaS in 2025 [Updated]</h1><p>Updated content...</p>",
      "markdown": "# How to Build a SaaS in 2025 [Updated]\n\nUpdated content...",
      "text": "How to Build a SaaS in 2025 [Updated] Updated content..."
    },
    "meta_description": "Updated guide to building a SaaS",
    "seo_keywords": ["saas", "startup", "2025"],
    "target_keyword": "build saas",
    "categories": ["startup", "technology"],
    "tags": ["saas", "business"],
    "featured_image_url": "https://xmphiscbmexupobiaivk.supabase.co/storage/v1/object/public/article-images/ai-images/featured-image-123.png",
    "featured_image_alt": "SaaS dashboard",
    "status": "published",
    "created_at": "2025-01-15T10:00:00.000Z",
    "user_id": "user-uuid"
  }
}

article.deleted

JSON
{
  "event": "article.deleted",
  "timestamp": "2025-01-15T16:00:00.789Z",
  "website_id": "46fb1544-e8d7-4c71-9015-b8f1ae5b3984",
  "data": {
    "article_id": "550e8400-e29b-41d4-a716-446655440000",
    "deleted_at": "2025-01-15T16:00:00.000Z",
    "api_url": "/api/public/articles/550e8400-e29b-41d4-a716-446655440000"
  }
}

Note: article.deleted only contains basic fields (no content/metadata)

Retry & Timeout

• Respond within 10 seconds
• 3 retries with exponential backoff on failure
• Webhook disabled after 10 consecutive failures
• Events may be delivered multiple times (handle idempotency)

Exemples de Code

Python

Python
import requests

# Your API key
api_key = "rs_your_api_key_here"
headers = {"X-API-Key": api_key}

# Fetch all published articles
response = requests.get(
    "https://robot-speed.com/api/public/articles",
    headers=headers
)
data = response.json()
articles = data["data"]["articles"]

for article in articles:
    print(f"{article['title']} - {article['published_at']}")

PHP

PHP
<?php

$api_key = "rs_your_api_key_here";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://robot-speed.com/api/public/articles");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-API-Key: " . $api_key
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
$articles = $data['data']['articles'];

foreach ($articles as $article) {
    echo $article['title'] . " - " . $article['published_at'] . "\n";
}

Next.js 14 Server Component

TypeScript
// app/blog/page.tsx - Next.js 14 Server Component
export default async function BlogPage() {
  const response = await fetch('https://robot-speed.com/api/public/articles', {
    headers: {
      'X-API-Key': 'YOUR_API_KEY_HERE'
    },
    next: { revalidate: 3600 } // Cache for 1 hour
  });

  const { data } = await response.json();
  const articles = data.articles;

  return (
    <div className="grid gap-6">
      {articles.map((article) => (
        <article key={article.id} className="border p-6 rounded">
          <h2 className="text-2xl font-bold mb-2">{article.title}</h2>
          <p className="text-gray-600 mb-4">{article.excerpt}</p>
          <div dangerouslySetInnerHTML={{ __html: article.content }} />
        </article>
      ))}
    </div>
  );
}

Gestion des Erreurs

HTTP Status Codes

CodeMeaning
200Success
400Bad Request
401Invalid/missing API key
404Resource not found
500Internal Server ErrorSomething went wrong on our end

Error Response Format

401

JSON
{
  "error": "Invalid or missing API key",
  "message": "Please provide a valid API key in the X-API-Key header"
}

500

JSON
{
  "error": "Internal server error",
  "details": "Database connection failed"
}

Besoin d'Aide ?

Can't find what you're looking for? We're here to help.