API

API Reference

The OAIZ API allows you to programmatically create, manage, and trigger automations. Use it to integrate OAIZ into your existing workflows and applications.

Official API Documentation

For the complete API reference with all endpoints, request/response schemas, and interactive examples, see our Swagger documentation:

Authentication

All API requests require an access token. You can generate API keys from your account settings:

  1. Go to Account → API Keys
  2. Click "Create API Key"
  3. Copy your key and store it securely (it won't be shown again)

Include your API key in the Authorization header:

HTTP Header
Authorization: Bearer YOUR_API_KEY

How to Work with the API

The most common use case is sending custom events to OAIZ, which can trigger your automations. Here's a simple TypeScript example:

send-event.ts
const OAIZ_API_KEY = process.env.OAIZ_API_KEY;
const OAIZ_API_URL = 'https://api.oaiz.io';

interface EventPayload {
  eventType: {
    provider: string;  // Required: e.g., 'custom', 'github', 'slack'
    name: string;      // Required: e.g., 'user-signup', 'webhook'
  };
  properties?: Record<string, unknown>;
  timestamp?: string;  // Optional: ISO 8601 format, defaults to now
  uniqueKey?: string;  // Optional: prevents duplicate events with same key
}

async function sendEvent(payload: EventPayload): Promise<void> {
  const response = await fetch(`${OAIZ_API_URL}/ingest/event/publish`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${OAIZ_API_KEY}`,
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(`Failed to send event: ${error.message}`);
  }

  console.log('Event sent successfully!');
}

// Example: Send a custom event to trigger your automations
sendEvent({
  eventType: {
    provider: 'custom',
    name: 'user-signup',
  },
  properties: {
    userId: '12345',
    email: 'user@example.com',
    plan: 'pro',
    signupDate: new Date().toISOString(),
  },
});

What happens next?

When you send an event to the API, it flows into the OAIZ event stream. Any jobs or chains configured to listen for that event type will automatically trigger and execute.

Event Types

Events require both a provider and name field. For custom events, use custom as the provider. The system combines these into an identifier format e:provider/name (e.g., e:custom/user-signup). Make sure your jobs are configured to listen for the same event type.

Base URL

https://api.oaiz.io

Need Help?

If you have questions about the API or need help with integration, contact us through the app's Feedback button or email support.