OpsIQ Developer Documentation

Build on OpsIQ with the public API, widget identity, webhooks, connector SDK, action gateway, and OpenAPI contract. These docs are customer-facing and apply to both hosted and self-hosted OpsIQ installs without exposing internal control-plane details.

API v1 stable OpenAPI 3.0 Bearer scopes Connector gateway

Start Here

OpsIQ exposes a stable REST API under /api/v1. Use it when you need to create contacts, open support tickets, read chat history, trigger proactive rules, pull analytics summaries, or manage knowledge-base articles from another system.

Machine-readable spec

The OpenAPI contract is always available at /api/v1/openapi.php. Import it into Postman, Insomnia, Stoplight, or your code generator.

curl /api/v1/openapi.php

Base URL

Use your own OpsIQ domain as the host. The path stays the same across installs.

https://your-opsiq-domain.com/api/v1
Every write operation should be tied to an API key scope and should pass through OpsIQ services or the connector gateway. Do not write directly to platform tables from custom code.

Authentication

Create an API key in OpsIQ, assign only the scopes that integration needs, and send it as a bearer token.

Authorization: Bearer opq_your_key_here
curl -H "Authorization: Bearer opq_your_key_here" \
  https://your-opsiq-domain.com/api/v1/tickets

Keys can be rotated at any time. Store them server-side only. Browser widgets should use the widget identity token flow, not public API keys.

Every API v1 response includes a request_id. Keep it with integration logs so OpsIQ support can trace the exact authenticated request, workspace, action, outcome, and latency without storing the caller's raw IP address.

POST /v1.php
{"action":"meta.me"}

meta.me returns the verified key name, scopes, permissions mode, workspace, effective allowed/blocked actions, and recent usage summary for agency and enterprise integrations.

Scopes

ScopeAllowsTypical user
contacts.readList and fetch contacts.CRM sync, reporting tools.
contacts.writeCreate contacts, update contacts, add tags, add notes.Forms, stores, enrichment jobs.
tickets.readList and fetch tickets.Dashboards, support QA.
tickets.writeCreate tickets and update ticket status/details.External forms, platform connectors.
chats.readRead chat sessions and transcripts.BI, compliance export.
analytics.readRead summary metrics.Reporting dashboards.
proactive.writeFire a proactive event/rule from another system.Product events, lifecycle automation.
kb.writeCreate and update knowledge-base articles.Docs importer, internal tools.

Contacts

GET/contacts?q=&limit=

List contacts in the active site scope.

Scope: contacts.read

POST/contacts

Create a contact.

Scope: contacts.write

curl -X POST https://your-opsiq-domain.com/api/v1/contacts \
  -H "Authorization: Bearer opq_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ada Lovelace","email":"[email protected]","tags":["trial"]}'
GET/contacts/{id}

Fetch one contact by id.

Scope: contacts.read

PUT/contacts/{id}

Update contact fields, tags, or notes.

Scope: contacts.write

POST/contacts/{id}/tags

Append tags to a contact.

Scope: contacts.write

{"tags":["vip","renewal"]}
POST/contacts/{id}/notes

Append a note to a contact timeline.

Scope: contacts.write

{"note":"Customer asked for annual billing."}

Tickets

GET/tickets?status=&priority=&department_id=&email=&limit=

List tickets with filters.

Scope: tickets.read

POST/tickets

Create a ticket. New tickets always start as open even if a source platform sends a reply-like status.

Scope: tickets.write

{
  "customer_email":"[email protected]",
  "customer_name":"Example Customer",
  "subject":"Cannot activate account",
  "body":"Activation email never arrived.",
  "priority":"high",
  "department_id":1
}
GET/tickets/{id}

Fetch one ticket.

Scope: tickets.read

PUT/tickets/{id}

Update status, priority, department, assignment, or subject.

Scope: tickets.write

{"status":"in_progress","priority":"high"}
For platform tickets, use the connector action gateway when available. That keeps native status, comments, and audit hooks in sync instead of bypassing the platform connector.

Chats

GET/chats?limit=

List chat sessions or client chat threads.

Scope: chats.read

GET/chats/{id}

Fetch one chat session or thread.

Scope: chats.read

Use chat reads for reporting, compliance export, or AI review. For sending live chat messages from a website, use the widget runtime instead of this API.

Analytics

GET/analytics/summary?preset=30d&from=&to=

Return a summary for the active date range.

Scope: analytics.read

curl -H "Authorization: Bearer opq_your_key_here" \
  "https://your-opsiq-domain.com/api/v1/analytics/summary?preset=30d"

Analytics responses are site-scoped. Visitor/page metrics stay tied to the domain that collected them; shared site groups do not merge per-domain visitor data.

Proactive Events

POST/proactive/trigger

Fire a proactive event so OpsIQ rules can react.

Scope: proactive.write

{
  "event":"checkout.abandoned",
  "email":"[email protected]",
  "cart_total":129.50,
  "currency":"USD"
}

Common events include visitor.high_intent, checkout.abandoned, signup.started, payment.failed, ticket.created, and knowledge.missed_question.

Knowledge Base

POST/kb/articles

Create a knowledge-base article.

Scope: kb.write

{
  "title":"How to reset your password",
  "body":"Open Account Settings, choose Security, then Reset Password.",
  "status":"published"
}
PUT/kb/articles/{id}

Update a knowledge-base article.

Scope: kb.write

{"status":"published","body":"Updated article body."}

The customer AI can use published knowledge-base content when answering visitors, depending on your AI instruction settings.

Widget And Identity

Install the OpsIQ widget on each website you want to track. Visitor data is collected per domain and stamped to the active site.

<script>
  window.OpsIQSettings = {
    siteKey: 'site_public_key',
    identity: {
      email: '[email protected]',
      name: 'Example Customer',
      external_id: 'cust_123'
    }
  };
</script>
<script src="https://your-opsiq-domain.com/widget.php" async></script>

Use identity when the visitor is logged in. For anonymous visitors, omit identity and OpsIQ will stitch later activity when the visitor identifies themselves.

Webhooks

Webhooks let other tools subscribe to OpsIQ activity. Configure targets in the admin and sign requests with a shared secret.

EventWhen it firesUseful for
ticket.createdA ticket is opened from chat, email, API, or connector.External helpdesk mirror.
ticket.updatedStatus, priority, department, assignment, or tags change.Workflow automation.
chat.startedA visitor starts a chat.Sales alerting.
lead.scoredLead score crosses a configured threshold.CRM enrichment.
order.attributedA tracked purchase is connected to a visitor/session.Revenue reporting.
knowledge.missed_questionThe AI could not confidently answer a repeated question.Content backlog.
{
  "event":"ticket.created",
  "id":"evt_123",
  "created_at":"2026-05-25T12:00:00Z",
  "data":{"ticket_id":42,"subject":"Need help"}
}

Connector SDK

Connectors are the production path for platform-specific actions. A connector defines metadata, settings, capability flags, and action specs. OpsIQ calls those actions through the gateway so validation, audit hooks, and platform sync stay consistent.

Manifest basics

{
  "slug":"example_platform",
  "name":"Example Platform",
  "version":"1.0.0",
  "manifest_version":1,
  "compatibility":{"opsiq_min":"1.0.0","opsiq_max":"*"},
  "capabilities":["native_api","tickets","customers"],
  "settings":[{"key":"api_key","type":"password","label":"API key"}]
}

Action shape

{
  "id":"ticket.reply",
  "label":"Reply to ticket",
  "params":{"ticket_id":"string","message":"string"},
  "requires_confirmation":true
}

Email connectors should expose mailbox/piping settings, not store or currency settings. Commerce connectors should expose order/customer/product actions. Support connectors should expose ticket, comment, assignment, and status actions.

Errors And Status Codes

StatusMeaningFix
400Invalid request body or parameter.Check JSON and required fields.
401Missing or invalid bearer token.Generate or rotate the API key.
403The API key does not have the required scope.Add the exact scope or use a more limited key per integration.
404Route or resource not found.Check the endpoint and id.
422Validation failed.Fix the field named in the error.
503A required service is unavailable.Check installation health and diagnostics.
{"success":false,"error":"scope_required:tickets.write","request_id":"req_..."}

Examples

JavaScript fetch

const res = await fetch('https://your-opsiq-domain.com/api/v1/tickets', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer opq_your_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    customer_email: '[email protected]',
    subject: 'Need help',
    body: 'The checkout page is failing.'
  })
});
const ticket = await res.json();

PHP cURL

$ch = curl_init('https://your-opsiq-domain.com/api/v1/contacts');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer opq_your_key_here',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode(['email' => '[email protected]', 'name' => 'Ada Lovelace']),
]);
$response = json_decode(curl_exec($ch), true);

Python requests

import requests

r = requests.get(
    'https://your-opsiq-domain.com/api/v1/analytics/summary',
    headers={'Authorization': 'Bearer opq_your_key_here'},
    params={'preset': '30d'},
    timeout=20,
)
r.raise_for_status()
print(r.json())