API Documentation

Build powerful integrations with OlenFi's REST API. Manage links, track analytics, and automate your link management.

🚀 Quick Start

Get started with OlenFi API in minutes:

  1. 1. Create an account: Sign up at OlenFi
  2. 2. Generate an API Key: Go to your dashboard → Settings → API Keys
  3. 3. Make your first request: Use your API key in the Authorization header

🔐 Authentication

Using API Keys

OlenFi uses Bearer token authentication. Include your API key in the Authorization header:

Authorization: Bearer olenfi_your_api_key_here

⚠️ Keep Your API Key Secret: Never share your API key in public code or version control. Treat it like a password.

🌐 Base URL

https://staging.olen.fi/api

📡 Available Endpoints

Links Management

  • GET /links - List all your links
  • POST /links - Create a new link
  • PATCH /links/:id - Update a link
  • DELETE /links/:id - Delete a link

API Key Management

  • GET /api-keys - List your API keys
  • POST /api-keys - Create a new API key
  • DELETE /api-keys/:keyId - Revoke an API key

Analytics & Tracking

  • GET /links/:id/stats - Get link click statistics
  • GET /links/:id/track - Track a link click

Webhooks

  • GET /webhooks - List your webhooks
  • POST /webhooks - Create a new webhook
  • PATCH /webhooks/:id - Update a webhook
  • DELETE /webhooks/:id - Delete a webhook

💡 Code Examples

Create a Link

curl -X POST https://staging.olen.fi/api/links \
  -H "Authorization: Bearer olenfi_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My Website",
    "url": "https://example.com",
    "linkType": "url"
  }'

List Your Links

curl -X GET https://staging.olen.fi/api/links \
  -H "Authorization: Bearer olenfi_your_key"

JavaScript/TypeScript

const API_KEY = "olenfi_your_key";

// Create a link
const createLink = async () => {
  const response = await fetch("https://staging.olen.fi/api/links", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      title: "My Website",
      url: "https://example.com",
      linkType: "url"
    })
  });
  return response.json();
};

// Get all links
const getLinks = async () => {
  const response = await fetch("https://staging.olen.fi/api/links", {
    headers: {
      "Authorization": `Bearer ${API_KEY}`
    }
  });
  return response.json();
};

🔔 Webhook Events

OlenFi sends webhooks for important events. Each webhook includes a signature for verification.

link.created

Fired when a new link is created

link.updated

Fired when a link is updated

link.deleted

Fired when a link is deleted

link.clicked

Fired when someone clicks on a link

⚠️ Error Handling

The API returns standard HTTP status codes:

  • 200: Success - Request completed
  • 201: Created - Resource created successfully
  • 400: Bad Request - Invalid parameters
  • 401: Unauthorized - Invalid or missing API key
  • 404: Not Found - Resource doesn't exist
  • 429: Too Many Requests - Rate limit exceeded
  • 500: Server Error - Something went wrong

⏱️ Rate Limiting

API requests are rate limited to prevent abuse. Rate limit information is included in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1234567890

Ready to Get Started?

Create your first API key and start building amazing integrations.

Go to Dashboard