3396 lines
151 KiB
Text
3396 lines
151 KiB
Text
<!-- Sidebar -->
|
|
<div class="hidden lg:fixed lg:inset-y-0 lg:z-40 lg:flex lg:w-72 lg:flex-col xl:w-80">
|
|
<div class="flex grow flex-col gap-y-5 overflow-y-auto border-r border-zinc-900/10 px-6 pt-4 pb-8 dark:border-white/10">
|
|
<!-- Logo -->
|
|
<div class="flex h-16 shrink-0 items-center">
|
|
<.link navigate={~p"/"} class="text-2xl font-bold text-zinc-900 dark:text-white">
|
|
Towerops API
|
|
</.link>
|
|
</div>
|
|
|
|
<!-- Navigation -->
|
|
<nav class="flex flex-1 flex-col">
|
|
<ul role="list" class="flex flex-1 flex-col gap-y-7">
|
|
<!-- Guides Section -->
|
|
<li>
|
|
<h2 class="text-xs font-semibold text-zinc-900 dark:text-white">Guides</h2>
|
|
<ul role="list" class="mt-3 space-y-1 border-l border-zinc-900/10 dark:border-white/5">
|
|
<li>
|
|
<a
|
|
href="#introduction"
|
|
data-nav-link="introduction"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Introduction
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#authentication"
|
|
data-nav-link="authentication"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Authentication
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#errors"
|
|
data-nav-link="errors"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Errors
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- Resources Section -->
|
|
<li>
|
|
<h2 class="text-xs font-semibold text-zinc-900 dark:text-white">Resources</h2>
|
|
<ul role="list" class="mt-3 space-y-1 border-l border-zinc-900/10 dark:border-white/5">
|
|
<li>
|
|
<a
|
|
href="#sites"
|
|
data-nav-link="sites"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Sites
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#devices"
|
|
data-nav-link="devices"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Devices
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#account-data"
|
|
data-nav-link="account-data"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Account Data (GDPR)
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#alerts"
|
|
data-nav-link="alerts"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Alerts
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#agents"
|
|
data-nav-link="agents"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Agents
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#organization"
|
|
data-nav-link="organization"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Organization
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#members"
|
|
data-nav-link="members"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Members
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#invitations"
|
|
data-nav-link="invitations"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Invitations
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#integrations"
|
|
data-nav-link="integrations"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Integrations
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#check-results"
|
|
data-nav-link="check-results"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Check Results & Metrics
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#activity"
|
|
data-nav-link="activity"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Activity Feed
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#graphs"
|
|
data-nav-link="graphs"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Graphs & Live Polling
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- Tools Section -->
|
|
<li>
|
|
<h2 class="text-xs font-semibold text-zinc-900 dark:text-white">Tools</h2>
|
|
<ul role="list" class="mt-3 space-y-1 border-l border-zinc-900/10 dark:border-white/5">
|
|
<li>
|
|
<a
|
|
href="#terraform"
|
|
data-nav-link="terraform"
|
|
class="nav-link block py-1 pl-4 pr-3 text-sm text-gray-600 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
|
>
|
|
Terraform Provider
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Main content -->
|
|
<div class="lg:ml-72 xl:ml-80">
|
|
<div class="relative flex h-full flex-col px-4 pt-14 sm:px-6 lg:px-8">
|
|
<main class="flex-auto max-w-7xl">
|
|
<!-- Introduction -->
|
|
<section id="introduction" class="scroll-mt-24 mb-16">
|
|
<h1 class="text-4xl font-bold tracking-tight text-zinc-900 dark:text-white sm:text-5xl">
|
|
Towerops API Reference
|
|
</h1>
|
|
<p class="mt-4 text-lg text-gray-600 dark:text-gray-400">
|
|
Use the Towerops API to manage your network monitoring infrastructure programmatically. Create and monitor sites, devices, and alerts.
|
|
</p>
|
|
</section>
|
|
|
|
<!-- Authentication -->
|
|
<section id="authentication" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Authentication
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
All API requests require authentication using an API token. Include your token in the Authorization header:
|
|
</p>
|
|
<div class="mt-6 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/sites \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
API tokens are created and managed in your organization settings. Each token is scoped to a single organization.
|
|
</p>
|
|
</section>
|
|
|
|
<!-- Errors -->
|
|
<section id="errors" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Errors
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
The API uses conventional HTTP response codes to indicate success or failure:
|
|
</p>
|
|
<div class="mt-6">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-white/10">
|
|
<thead>
|
|
<tr>
|
|
<th class="py-3 text-left text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Code
|
|
</th>
|
|
<th class="py-3 text-left text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Description
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-emerald-600 dark:text-emerald-400">200</td>
|
|
<td class="py-3 text-sm text-gray-600 dark:text-gray-400">Success</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-emerald-600 dark:text-emerald-400">201</td>
|
|
<td class="py-3 text-sm text-gray-600 dark:text-gray-400">
|
|
Created successfully
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">400</td>
|
|
<td class="py-3 text-sm text-gray-600 dark:text-gray-400">
|
|
Bad request - missing or invalid parameters
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">401</td>
|
|
<td class="py-3 text-sm text-gray-600 dark:text-gray-400">
|
|
Unauthorized - invalid or missing API token
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">403</td>
|
|
<td class="py-3 text-sm text-gray-600 dark:text-gray-400">
|
|
Forbidden - you don't have access to this resource
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">404</td>
|
|
<td class="py-3 text-sm text-gray-600 dark:text-gray-400">
|
|
Not found - resource doesn't exist
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">422</td>
|
|
<td class="py-3 text-sm text-gray-600 dark:text-gray-400">
|
|
Unprocessable entity - validation errors
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Sites Resource -->
|
|
<section id="sites" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Sites
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Sites represent physical locations where your network devices are deployed. Each site can have multiple devices and may have default SNMP configuration.
|
|
</p>
|
|
|
|
<!-- Site Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The site model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Unique identifier for the site (UUID).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
The name of the site.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
location
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Physical location or address of the site.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_community
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Default SNMP community string for devices at this site (optional).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
inserted_at
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
timestamp
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Timestamp when the site was created.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List all sites -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all sites</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/sites</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<!-- Left column - description -->
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Lists all sites for the authenticated organization.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Right column - code example -->
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/sites \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"sites": [
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Create a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Create a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/sites</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<!-- Left column -->
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Creates a new site for the authenticated organization.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Required parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
The name of the site.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
location
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Physical location of the site.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Optional parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_community
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Default SNMP community string for devices at this site.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
|
|
<!-- Right column -->
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/sites \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"site": {
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public"
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Get a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Retrieve a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/sites/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Retrieves a single site by ID.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Update a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Update a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/30">
|
|
PATCH
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/sites/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Updates an existing site. Only provided fields will be updated.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X PATCH https://towerops.net/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"site": {
|
|
"name": "Updated Office Name"
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Updated Office Name",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Delete a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Delete a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/sites/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Deletes a site. Note: This will also delete all devices associated with the site.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"success": true
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Devices Resource -->
|
|
<section id="devices" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Devices
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Devices are network equipment monitored by Towerops. Each device belongs to a site and can be monitored via ICMP ping and SNMP.
|
|
</p>
|
|
|
|
<!-- Device Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The device model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Unique identifier for the device (UUID).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
The name of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
ip_address
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
IP address of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
site_id
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
ID of the site this device belongs to.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
description
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Optional description of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
monitoring_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Whether monitoring is enabled for this device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
check_interval_seconds
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
integer
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
How often to poll this device (in seconds).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Whether SNMP monitoring is enabled.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_version
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
SNMP version to use (e.g., "2c").
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_port
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
integer
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
SNMP port (default: 161).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
inserted_at
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
timestamp
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Timestamp when the device was created.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List all devices -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all devices</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/devices
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Lists all devices for the authenticated organization.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Optional parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
site_id
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Filter devices by site ID.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/devices \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"devices": [
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"monitoring_enabled": true,
|
|
"snmp_enabled": true,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Create a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Create a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/devices
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Creates a new device.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Required parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
site_id
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
ID of the site this device belongs to.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
The name of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
ip_address
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
IP address of the device.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Optional parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
description
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Description of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
monitoring_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Enable monitoring (default: true).
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Enable SNMP monitoring (default: true).
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_version
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
SNMP version (default: "2c").
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_community
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
SNMP community string (inherits from site/org if not set).
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_port
|
|
<span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
integer
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
SNMP port (default: 161).
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/devices \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"device": {
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"description": "Main router",
|
|
"snmp_community": "public"
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"monitoring_enabled": true,
|
|
"snmp_enabled": true,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Get a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Retrieve a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/devices/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Retrieves a single device by ID, including all configuration details.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/devices/650e8400-e29b-41d4-a716-446655440001 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"description": "Main router",
|
|
"monitoring_enabled": true,
|
|
"check_interval_seconds": 300,
|
|
"snmp_enabled": true,
|
|
"snmp_version": "2c",
|
|
"snmp_port": 161,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Update a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Update a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/30">
|
|
PATCH
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/devices/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Updates an existing device. Only provided fields will be updated.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X PATCH https://towerops.net/api/v1/devices/650e8400-e29b-41d4-a716-446655440001 \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"device": {
|
|
"name": "Updated Router Name",
|
|
"monitoring_enabled": false
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Updated Router Name",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"description": "Main router",
|
|
"monitoring_enabled": false,
|
|
"check_interval_seconds": 300,
|
|
"snmp_enabled": true,
|
|
"snmp_version": "2c",
|
|
"snmp_port": 161,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Delete a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Delete a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/devices/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Deletes a device. Note: This will also delete all monitoring data associated with the device.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/devices/650e8400-e29b-41d4-a716-446655440001 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"success": true
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Account Data Resource (GDPR) -->
|
|
<section id="account-data" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Account Data (GDPR)
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
GDPR Right to Access endpoint that allows users to download all their personal data in JSON format. This endpoint complies with Article 15 of GDPR.
|
|
</p>
|
|
|
|
<div class="mt-6 rounded-lg bg-amber-50 dark:bg-amber-900/10 p-4 border border-amber-200 dark:border-amber-800">
|
|
<div class="flex">
|
|
<div class="flex-shrink-0">
|
|
<svg class="h-5 w-5 text-amber-400" viewBox="0 0 20 20" fill="currentColor">
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div class="ml-3">
|
|
<h3 class="text-sm font-medium text-amber-800 dark:text-amber-200">
|
|
Authentication Difference
|
|
</h3>
|
|
<div class="mt-2 text-sm text-amber-700 dark:text-amber-300">
|
|
<p>
|
|
This endpoint requires <strong>browser session authentication</strong>, not API tokens. Users must be logged into their Towerops account via the web interface to access this endpoint.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Export all account data -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">
|
|
Export all account data
|
|
</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">
|
|
/api/v1/account/data
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<!-- Left column - description -->
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Downloads all personal data associated with the authenticated user account as a JSON file. This includes:
|
|
</p>
|
|
|
|
<ul class="mt-4 space-y-2 text-sm text-gray-600 dark:text-gray-400 list-disc list-inside">
|
|
<li>Profile information (email, name, timezone)</li>
|
|
<li>Organizations and membership roles</li>
|
|
<li>Devices across all organizations</li>
|
|
<li>Recent alerts (last 90 days)</li>
|
|
<li>Audit logs (up to 1,000 most recent)</li>
|
|
</ul>
|
|
|
|
<div class="mt-6 rounded-lg bg-blue-50 dark:bg-blue-900/10 p-4 border border-blue-200 dark:border-blue-800">
|
|
<p class="text-sm text-blue-700 dark:text-blue-300">
|
|
<strong>Privacy Note:</strong>
|
|
Sensitive data like SNMP community strings are redacted from the export for security.
|
|
</p>
|
|
</div>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Authentication
|
|
</h4>
|
|
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
Requires active browser session with CSRF token. Cannot be accessed via API tokens.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Right column - code example -->
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request (Browser)</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw(~S"""
|
|
# This endpoint requires browser authentication
|
|
# Access via logged-in browser session:
|
|
GET https://towerops.net/api/v1/account/data
|
|
|
|
# Or via curl with session cookie:
|
|
curl https://towerops.net/api/v1/account/data \
|
|
-H "Cookie: _towerops_key=YOUR_SESSION_COOKIE"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw(~S"""
|
|
{
|
|
"profile": {
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"email": "user@example.com",
|
|
"name": "John Doe",
|
|
"timezone": "America/New_York",
|
|
"is_superuser": false,
|
|
"confirmed_at": "2026-01-15T10:30:00Z",
|
|
"inserted_at": "2026-01-15T10:00:00Z",
|
|
"updated_at": "2026-01-20T14:22:00Z"
|
|
},
|
|
"credentials": [
|
|
{
|
|
"id": "750e8400-e29b-41d4-a716-446655440002",
|
|
"label": "MacBook Pro Touch ID",
|
|
"public_key_spki": "MFkwEwYHKoZIzj0CAQYIKoZI...",
|
|
"last_used_at": "2026-01-28T12:15:00Z",
|
|
"inserted_at": "2026-01-15T10:35:00Z"
|
|
}
|
|
],
|
|
"organizations": [
|
|
{
|
|
"id": "850e8400-e29b-41d4-a716-446655440003",
|
|
"name": "Acme Networks",
|
|
"slug": "acme-networks",
|
|
"role": "owner",
|
|
"inserted_at": "2026-01-15T10:32:00Z",
|
|
"updated_at": "2026-01-15T10:32:00Z"
|
|
}
|
|
],
|
|
"devices": [
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"snmp_community": "[REDACTED]",
|
|
"monitoring_enabled": true,
|
|
"snmp_enabled": true,
|
|
"status": "up",
|
|
"organization": {
|
|
"id": "850e8400-e29b-41d4-a716-446655440003",
|
|
"name": "Acme Networks"
|
|
},
|
|
"site": {
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Main Office"
|
|
},
|
|
"inserted_at": "2026-01-16T09:00:00Z",
|
|
"updated_at": "2026-01-28T08:30:00Z"
|
|
}
|
|
],
|
|
"alerts": [
|
|
{
|
|
"id": "950e8400-e29b-41d4-a716-446655440004",
|
|
"alert_type": "equipment_down",
|
|
"severity": "critical",
|
|
"message": "Device is not responding to ping",
|
|
"triggered_at": "2026-01-27T15:45:00Z",
|
|
"resolved_at": "2026-01-27T16:10:00Z",
|
|
"acknowledged_at": null,
|
|
"device": {
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router"
|
|
},
|
|
"inserted_at": "2026-01-27T15:45:00Z"
|
|
}
|
|
],
|
|
"audit_logs": [
|
|
{
|
|
"id": "150e8400-e29b-41d4-a716-446655440005",
|
|
"action": "user.login",
|
|
"actor_email": "user@example.com",
|
|
"target_user_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"metadata": {
|
|
"ip_address": "203.0.113.42",
|
|
"user_agent": "Mozilla/5.0..."
|
|
},
|
|
"inserted_at": "2026-01-28T08:00:00Z"
|
|
}
|
|
],
|
|
"export_info": {
|
|
"exported_at": "2026-01-28T19:50:00Z",
|
|
"format": "JSON",
|
|
"gdpr_article": "Article 15 - Right to Access"
|
|
}
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 rounded-lg bg-gray-900 dark:bg-gray-950 p-4">
|
|
<p class="text-xs font-medium text-zinc-400 mb-2">Response Headers</p>
|
|
<pre class="text-sm text-zinc-100 overflow-x-auto"><code><%= raw(~S"""
|
|
Content-Type: application/json
|
|
Content-Disposition: attachment; filename="towerops-data-{user_id}-{timestamp}.json"
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Alerts Resource -->
|
|
<section id="alerts" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Alerts
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Alerts represent monitoring events triggered when a device check fails or recovers. You can list, view, acknowledge, and resolve alerts.
|
|
</p>
|
|
|
|
<!-- Alert Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The alert model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Unique identifier (UUID).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
alert_type <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Type of alert (e.g. "ping_down", "snmp_down").</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
message <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Human-readable alert message.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
triggered_at <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">timestamp</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">When the alert was triggered.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
acknowledged_at <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">timestamp</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">When the alert was acknowledged (null if not acknowledged).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
resolved_at <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">timestamp</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">When the alert was resolved (null if still active).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
device_id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">The device this alert belongs to.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
device_name <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Name of the associated device.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
acknowledged_by_email <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Email of the user who acknowledged this alert.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
gaiia_impact <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">AI-generated impact assessment (if available).</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List alerts -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all alerts</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/alerts</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Returns all alerts for the authenticated organization.
|
|
</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Optional parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
status <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Filter by status (e.g. "active", "acknowledged", "resolved").</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
device_id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Filter alerts for a specific device.</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
limit <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">integer</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Maximum number of alerts to return.</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/alerts \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-d status=active
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
"alert_type": "ping_down",
|
|
"message": "Device is not responding to ping",
|
|
"triggered_at": "2026-02-14T10:30:00Z",
|
|
"acknowledged_at": null,
|
|
"resolved_at": null,
|
|
"device_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"device_name": "Core Router",
|
|
"acknowledged_by_email": null,
|
|
"gaiia_impact": "High - affects 12 downstream devices",
|
|
"inserted_at": "2026-02-14T10:30:00Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Show alert -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Retrieve an alert</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/alerts/:id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Retrieves a single alert by its ID.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/alerts/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Acknowledge alert -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Acknowledge an alert</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/alerts/:id/acknowledge</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Marks an alert as acknowledged. The acknowledging user is recorded automatically.
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X POST https://towerops.net/api/v1/alerts/a1b2c3d4-e5f6-7890-abcd-ef1234567890/acknowledge \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": {
|
|
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
"alert_type": "ping_down",
|
|
"message": "Device is not responding to ping",
|
|
"triggered_at": "2026-02-14T10:30:00Z",
|
|
"acknowledged_at": "2026-02-14T11:00:00Z",
|
|
"resolved_at": null,
|
|
"device_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"device_name": "Core Router",
|
|
"acknowledged_by_email": "admin@example.com",
|
|
"gaiia_impact": "High - affects 12 downstream devices",
|
|
"inserted_at": "2026-02-14T10:30:00Z"
|
|
}
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Resolve alert -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Resolve an alert</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/alerts/:id/resolve</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Manually resolves an alert. Alerts may also be resolved automatically when the underlying condition clears.
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X POST https://towerops.net/api/v1/alerts/a1b2c3d4-e5f6-7890-abcd-ef1234567890/resolve \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Agents Resource -->
|
|
<section id="agents" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Agents
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Agents are lightweight monitoring agents that run on your infrastructure to collect device data. Each agent has a token used for authentication.
|
|
</p>
|
|
|
|
<!-- Agent Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The agent model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Unique identifier (UUID).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Name of the agent.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
enabled <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">boolean</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Whether the agent is enabled.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
last_seen_at <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">timestamp</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">When the agent last checked in.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
last_ip <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Last known IP address of the agent.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
metadata <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">object</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Agent metadata (version, OS, etc.).</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List agents -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all agents</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/agents</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns all agent tokens for the authenticated organization.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/agents \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
"name": "datacenter-agent-01",
|
|
"enabled": true,
|
|
"last_seen_at": "2026-02-14T11:00:00Z",
|
|
"last_ip": "10.0.1.50",
|
|
"metadata": {"version": "1.4.2", "os": "linux"},
|
|
"inserted_at": "2026-01-10T08:00:00Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Create agent -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Create an agent</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/agents</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Creates a new agent token. The raw token is returned only once in the response — store it securely.
|
|
</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Required parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">A descriptive name for the agent.</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X POST https://towerops.net/api/v1/agents \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-H "Content-Type: application/json" \\
|
|
-d '{"name": "new-site-agent"}'
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response (201 Created)</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": {
|
|
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
|
|
"name": "new-site-agent",
|
|
"enabled": true,
|
|
"last_seen_at": null,
|
|
"last_ip": null,
|
|
"metadata": null,
|
|
"inserted_at": "2026-02-14T11:10:00Z",
|
|
"token": "tow_agent_abc123..."
|
|
}
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Show agent -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Retrieve an agent</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/agents/:id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Retrieves a single agent by ID. Includes a count of assigned devices.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/agents/b2c3d4e5-f6a7-8901-bcde-f12345678901 \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": {
|
|
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
"name": "datacenter-agent-01",
|
|
"enabled": true,
|
|
"last_seen_at": "2026-02-14T11:00:00Z",
|
|
"last_ip": "10.0.1.50",
|
|
"metadata": {"version": "1.4.2", "os": "linux"},
|
|
"inserted_at": "2026-01-10T08:00:00Z",
|
|
"device_count": 24
|
|
}
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Delete agent -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Delete an agent</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/agents/:id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Permanently deletes an agent token. Devices assigned to this agent will need to be reassigned.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/agents/b2c3d4e5-f6a7-8901-bcde-f12345678901 \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response (204 No Content)</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
(empty response body)
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Organization Resource -->
|
|
<section id="organization" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Organization
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Retrieve and update settings for the authenticated organization, including SNMP defaults, MikroTik configuration, and general preferences.
|
|
</p>
|
|
|
|
<!-- Organization Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The organization model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Unique identifier (UUID).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Organization display name.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
slug <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">URL-friendly identifier.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
subscription_plan <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Current subscription plan.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_version <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Default SNMP version (v2c or v3).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_community <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Default SNMP community string.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
mikrotik_enabled <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">boolean</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Whether MikroTik API integration is enabled.</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Show organization -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Get organization settings</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/organization</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns the full settings for the authenticated organization.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/organization \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": {
|
|
"id": "org-uuid-here",
|
|
"name": "Acme Networks",
|
|
"slug": "acme-networks",
|
|
"subscription_plan": "pro",
|
|
"use_sites": true,
|
|
"snmp_version": "v2c",
|
|
"snmp_community": "public",
|
|
"snmp_port": 161,
|
|
"snmp_transport": "udp",
|
|
"snmpv3_security_level": null,
|
|
"snmpv3_username": null,
|
|
"snmpv3_auth_protocol": null,
|
|
"snmpv3_priv_protocol": null,
|
|
"mikrotik_enabled": false,
|
|
"mikrotik_username": null,
|
|
"mikrotik_port": null,
|
|
"mikrotik_ssh_port": null,
|
|
"mikrotik_use_ssl": false,
|
|
"default_agent_token_id": null,
|
|
"inserted_at": "2025-06-01T00:00:00Z",
|
|
"updated_at": "2026-02-14T10:00:00Z"
|
|
}
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Update organization -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Update organization settings</h3>
|
|
<span class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/30">
|
|
PATCH
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/organization</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
Updates organization settings. Only the provided fields are changed.
|
|
</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Parameters (all optional)</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
organization[name] <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Organization display name.</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
organization[snmp_community] <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Default SNMP community string.</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X PATCH https://towerops.net/api/v1/organization \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-H "Content-Type: application/json" \\
|
|
-d '{"organization": {"name": "Acme Networks LLC", "snmp_community": "private"}}'
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Members Resource -->
|
|
<section id="members" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Members
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Manage the users who belong to your organization. You can list members, change roles, and remove members.
|
|
</p>
|
|
|
|
<!-- Member Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The member model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">User ID of the member.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
email <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Email address of the member.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
role <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Member's role (e.g. "owner", "admin", "member").</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List members -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all members</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/members</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns all members of the authenticated organization.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/members \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"id": "user-uuid-1",
|
|
"email": "admin@example.com",
|
|
"role": "owner",
|
|
"inserted_at": "2025-06-01T00:00:00Z"
|
|
},
|
|
{
|
|
"id": "user-uuid-2",
|
|
"email": "tech@example.com",
|
|
"role": "admin",
|
|
"inserted_at": "2025-08-15T00:00:00Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Change member role -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Change member role</h3>
|
|
<span class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/30">
|
|
PATCH
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/members/:user_id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Updates a member's role. Cannot change the owner's role.</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Required parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
role <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">New role for the member (e.g. "admin", "member").</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X PATCH https://towerops.net/api/v1/members/user-uuid-2 \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-H "Content-Type: application/json" \\
|
|
-d '{"role": "member"}'
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Remove member -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Remove a member</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/members/:user_id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Removes a member from the organization. The organization owner cannot be removed.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/members/user-uuid-2 \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Invitations Resource -->
|
|
<section id="invitations" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Invitations
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Invite new users to your organization. Invitations expire after 7 days.
|
|
</p>
|
|
|
|
<!-- Invitation Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The invitation model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Unique identifier (UUID).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
email <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Email address of the invited user.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
role <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Role the user will receive upon accepting.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
expires_at <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">timestamp</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">When the invitation expires.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
invited_by_email <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Email of the user who sent the invitation.</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List invitations -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List pending invitations</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/invitations</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns all pending invitations for the organization.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/invitations \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"id": "inv-uuid-1",
|
|
"email": "newuser@example.com",
|
|
"role": "member",
|
|
"expires_at": "2026-02-21T11:00:00Z",
|
|
"invited_by_email": "admin@example.com",
|
|
"inserted_at": "2026-02-14T11:00:00Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Create invitation -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Create an invitation</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/invitations</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Sends an invitation to join the organization.</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Required parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
email <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Email address to invite.</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
role <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Role to assign (e.g. "admin", "member").</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X POST https://towerops.net/api/v1/invitations \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-H "Content-Type: application/json" \\
|
|
-d '{"email": "newuser@example.com", "role": "member"}'
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Cancel invitation -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Cancel an invitation</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/invitations/:id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Cancels a pending invitation.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/invitations/inv-uuid-1 \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Integrations Resource -->
|
|
<section id="integrations" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Integrations
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Manage third-party integrations for your organization, such as notification providers and external monitoring systems.
|
|
</p>
|
|
|
|
<!-- Integration Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The integration model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Unique identifier (UUID).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
provider <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Integration provider name (e.g. "slack", "pagerduty", "email").</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
enabled <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">boolean</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Whether the integration is active.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
sync_interval_minutes <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">integer</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">How often the integration syncs (in minutes).</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
last_synced_at <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">timestamp</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">When the integration last synced.</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
last_sync_status <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Status of the last sync ("success", "error", etc.).</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List integrations -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all integrations</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/integrations</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns all integrations for the organization.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/integrations \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"id": "intg-uuid-1",
|
|
"provider": "slack",
|
|
"enabled": true,
|
|
"sync_interval_minutes": 5,
|
|
"last_synced_at": "2026-02-14T11:00:00Z",
|
|
"last_sync_status": "success",
|
|
"inserted_at": "2025-12-01T00:00:00Z",
|
|
"updated_at": "2026-02-14T11:00:00Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Create integration -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Create an integration</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/integrations</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Creates a new integration.</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Required parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
integration[provider] <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Provider name (e.g. "slack", "pagerduty").</dd>
|
|
</div>
|
|
</dl>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Optional parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
integration[enabled] <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">boolean</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Whether to enable the integration immediately (default: true).</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
integration[sync_interval_minutes] <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">integer</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Sync interval in minutes.</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X POST https://towerops.net/api/v1/integrations \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-H "Content-Type: application/json" \\
|
|
-d '{"integration": {"provider": "slack", "enabled": true, "sync_interval_minutes": 5}}'
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Show integration -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Retrieve an integration</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/integrations/:id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Retrieves a single integration by ID.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/integrations/intg-uuid-1 \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Update integration -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Update an integration</h3>
|
|
<span class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/30">
|
|
PATCH
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/integrations/:id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Updates an integration's settings.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X PATCH https://towerops.net/api/v1/integrations/intg-uuid-1 \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-H "Content-Type: application/json" \\
|
|
-d '{"integration": {"enabled": false}}'
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Delete integration -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Delete an integration</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/integrations/:id</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Permanently deletes an integration.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/integrations/intg-uuid-1 \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Test integration connection -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Test connection</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/integrations/:id/test</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Tests the connection for an integration to verify it's properly configured.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X POST https://towerops.net/api/v1/integrations/intg-uuid-1/test \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": {
|
|
"status": "ok",
|
|
"provider": "slack"
|
|
}
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Check Results & Metrics Resource -->
|
|
<section id="check-results" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Check Results & Metrics
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Access monitoring check results, historical metrics, and SNMP interface data for your devices.
|
|
</p>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Device checks -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List device checks</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/devices/:device_id/checks</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns all monitoring checks configured for a device, including the latest result for each check.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/devices/550e8400-e29b-41d4-a716-446655440000/checks \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"id": "check-uuid-1",
|
|
"name": "ICMP Ping",
|
|
"check_type": "ping",
|
|
"enabled": true,
|
|
"interval_seconds": 60,
|
|
"latest_status": "ok",
|
|
"latest_value": 12.5,
|
|
"latest_checked_at": "2026-02-14T11:10:00Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Device metrics -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Get device metrics</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/devices/:device_id/metrics</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns historical check results for a device, useful for graphing and trend analysis.</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Optional parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
hours <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">integer</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Number of hours of history to return (default: 24).</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
check_type <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Filter by check type (e.g. "ping", "snmp").</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/devices/550e8400-e29b-41d4-a716-446655440000/metrics \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-d hours=48 \\
|
|
-d check_type=ping
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"check_id": "check-uuid-1",
|
|
"check_name": "ICMP Ping",
|
|
"check_type": "ping",
|
|
"data": [
|
|
{"timestamp": "2026-02-14T10:00:00Z", "value": 11.2, "status": "ok"},
|
|
{"timestamp": "2026-02-14T10:01:00Z", "value": 13.8, "status": "ok"},
|
|
{"timestamp": "2026-02-14T10:02:00Z", "value": null, "status": "timeout"}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Device interfaces -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List device interfaces</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/devices/:device_id/interfaces</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns SNMP-discovered network interfaces for a device.</p>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/devices/550e8400-e29b-41d4-a716-446655440000/interfaces \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"id": "iface-uuid-1",
|
|
"if_index": 1,
|
|
"if_name": "GigabitEthernet0/0",
|
|
"if_descr": "GigabitEthernet0/0",
|
|
"if_alias": "Uplink to ISP",
|
|
"if_speed": 1000000000,
|
|
"if_admin_status": "up",
|
|
"if_oper_status": "up",
|
|
"monitored": true
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Activity Feed Resource -->
|
|
<section id="activity" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Activity Feed
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
View a chronological feed of actions and events across your organization.
|
|
</p>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- List activity -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List organization activity</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-gray-600 dark:text-gray-400">/api/v1/activity</span>
|
|
</div>
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">Returns recent activity events for the organization.</p>
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">Optional parameters</h4>
|
|
<dl class="mt-3 divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
limit <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">integer</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Maximum number of events to return (default: 50).</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
types <span class="ml-2 font-sans text-xs font-normal text-gray-500 dark:text-gray-400">string</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-gray-600 dark:text-gray-400">Comma-separated list of event types to filter by.</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/activity \\
|
|
-H "Authorization: Bearer #{@sample_token}" \\
|
|
-d limit=20
|
|
""") %></code></pre>
|
|
</div>
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"data": [
|
|
{
|
|
"type": "device_created",
|
|
"message": "Device 'Core Router' was added",
|
|
"user_email": "admin@example.com",
|
|
"inserted_at": "2026-02-14T10:30:00Z"
|
|
},
|
|
{
|
|
"type": "alert_triggered",
|
|
"message": "Alert triggered: ping_down on Core Router",
|
|
"user_email": null,
|
|
"inserted_at": "2026-02-14T10:35:00Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Terraform Provider Section -->
|
|
<section id="terraform" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Terraform Provider
|
|
</h2>
|
|
<p class="mt-4 text-base text-gray-600 dark:text-gray-400">
|
|
Manage your Towerops infrastructure as code using our official Terraform provider. Automate site and device provisioning, version control your network configuration, and integrate Towerops into your existing infrastructure workflows.
|
|
</p>
|
|
|
|
<div class="mt-6 rounded-lg bg-blue-50 dark:bg-blue-900/10 p-4 border border-blue-200 dark:border-blue-800">
|
|
<div class="flex">
|
|
<div class="flex-shrink-0">
|
|
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div class="ml-3">
|
|
<h3 class="text-sm font-medium text-blue-800 dark:text-blue-200">
|
|
Infrastructure as Code
|
|
</h3>
|
|
<div class="mt-2 text-sm text-blue-700 dark:text-blue-300">
|
|
<p>
|
|
The Terraform provider uses the same REST API documented above. All resource operations require API token authentication (not browser sessions).
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- What is Terraform -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">What is Terraform?</h3>
|
|
<p class="mt-4 text-sm text-gray-600 dark:text-gray-400">
|
|
<a
|
|
href="https://www.terraform.io/"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="text-blue-600 dark:text-blue-400 hover:underline"
|
|
>
|
|
Terraform
|
|
</a>
|
|
is an infrastructure as code tool that lets you define both cloud and on-premise resources in human-readable configuration files that you can version, reuse, and share. With the Towerops Terraform provider, you can:
|
|
</p>
|
|
|
|
<ul class="mt-4 space-y-2 text-sm text-gray-600 dark:text-gray-400 list-disc list-inside">
|
|
<li>Define sites and devices in declarative configuration files</li>
|
|
<li>Version control your network monitoring infrastructure</li>
|
|
<li>Automate device provisioning and updates</li>
|
|
<li>Integrate with CI/CD pipelines for automated deployments</li>
|
|
<li>Ensure consistent configuration across environments</li>
|
|
<li>Track infrastructure changes with git history</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Getting Started -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Getting Started</h3>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<!-- Left column - description -->
|
|
<div>
|
|
<h4 class="text-sm font-semibold text-zinc-900 dark:text-white">Installation</h4>
|
|
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
The provider is available on the <a
|
|
href="https://registry.terraform.io/providers/towerops-app/towerops"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="text-blue-600 dark:text-blue-400 hover:underline"
|
|
>Terraform Registry</a>. Terraform will automatically download it when you run <code class="px-1.5 py-0.5 rounded bg-gray-100 dark:bg-gray-800 text-xs font-mono">terraform init</code>.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Requirements
|
|
</h4>
|
|
<ul class="mt-2 space-y-1 text-sm text-gray-600 dark:text-gray-400 list-disc list-inside">
|
|
<li>Terraform >= 1.0</li>
|
|
<li>Towerops API token (create in Organization Settings)</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- Right column - code example -->
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Configuration</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw(~S"""
|
|
terraform {
|
|
required_providers {
|
|
towerops = {
|
|
source = "towerops-app/towerops"
|
|
version = "~> 0.1"
|
|
}
|
|
}
|
|
}
|
|
|
|
variable "towerops_api_token" {
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
provider "towerops" {
|
|
token = var.towerops_api_token
|
|
api_url = "https://towerops.net"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Example Usage -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Example Usage</h3>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
This example creates a site and two devices. Terraform will automatically manage the lifecycle of these resources, creating, updating, or deleting them as needed to match your configuration.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Key Features
|
|
</h4>
|
|
<ul class="mt-3 space-y-2 text-sm text-gray-600 dark:text-gray-400 list-disc list-inside">
|
|
<li>Automatic dependency management (devices depend on sites)</li>
|
|
<li>State tracking to detect configuration drift</li>
|
|
<li>Plan preview before making changes</li>
|
|
<li>Rollback support via version control</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">main.tf</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw(~S"""
|
|
resource "towerops_site" "main_office" {
|
|
name = "Main Office"
|
|
location = "New York, NY"
|
|
}
|
|
|
|
resource "towerops_device" "core_router" {
|
|
site_id = towerops_site.main_office.id
|
|
name = "Core Router"
|
|
ip_address = "192.168.1.1"
|
|
description = "Primary gateway"
|
|
snmp_enabled = true
|
|
snmp_version = "2c"
|
|
}
|
|
|
|
resource "towerops_device" "backup_router" {
|
|
site_id = towerops_site.main_office.id
|
|
name = "Backup Router"
|
|
ip_address = "192.168.1.2"
|
|
description = "Failover gateway"
|
|
snmp_enabled = true
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-gray-900 dark:bg-gray-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Commands</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw(~S"""
|
|
# Initialize and download provider
|
|
terraform init
|
|
|
|
# Preview changes
|
|
terraform plan
|
|
|
|
# Apply configuration
|
|
terraform apply
|
|
|
|
# Destroy all resources
|
|
terraform destroy
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Available Resources -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Available Resources</h3>
|
|
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-gray-200 dark:divide-white/10">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
towerops_site
|
|
</dt>
|
|
<dd class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
Manages a physical site/location. Supports name, location, and SNMP community string configuration.
|
|
</dd>
|
|
<dd class="mt-2">
|
|
<a
|
|
href="https://registry.terraform.io/providers/towerops-app/towerops/latest/docs/resources/site"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="text-sm text-blue-600 dark:text-blue-400 hover:underline"
|
|
>
|
|
View documentation →
|
|
</a>
|
|
</dd>
|
|
</div>
|
|
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
towerops_device
|
|
</dt>
|
|
<dd class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
Manages network equipment at a site. Supports IP address, SNMP configuration, monitoring settings, and more.
|
|
</dd>
|
|
<dd class="mt-2">
|
|
<a
|
|
href="https://registry.terraform.io/providers/towerops-app/towerops/latest/docs/resources/device"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="text-sm text-blue-600 dark:text-blue-400 hover:underline"
|
|
>
|
|
View documentation →
|
|
</a>
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-gray-200 dark:border-white/10" />
|
|
|
|
<!-- Documentation Links -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Full Documentation</h3>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<a
|
|
href="https://registry.terraform.io/providers/towerops-app/towerops/latest/docs"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="group relative rounded-lg border border-gray-200 dark:border-white/10 p-6 hover:border-blue-500 dark:hover:border-blue-400 transition"
|
|
>
|
|
<div class="flex items-start justify-between">
|
|
<div class="flex-1">
|
|
<h4 class="text-base font-semibold text-zinc-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400">
|
|
Provider Documentation
|
|
</h4>
|
|
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
Complete reference for all resources, data sources, and provider configuration options.
|
|
</p>
|
|
</div>
|
|
<svg
|
|
class="h-5 w-5 text-gray-400 group-hover:text-blue-600 dark:group-hover:text-blue-400 ml-4"
|
|
viewBox="0 0 20 20"
|
|
fill="currentColor"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
</a>
|
|
|
|
<a
|
|
href="https://github.com/towerops-app/terraform-provider-towerops"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="group relative rounded-lg border border-gray-200 dark:border-white/10 p-6 hover:border-blue-500 dark:hover:border-blue-400 transition"
|
|
>
|
|
<div class="flex items-start justify-between">
|
|
<div class="flex-1">
|
|
<h4 class="text-base font-semibold text-zinc-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400">
|
|
GitHub Repository
|
|
</h4>
|
|
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
Source code, examples, and issue tracking for the Terraform provider.
|
|
</p>
|
|
</div>
|
|
<svg
|
|
class="h-5 w-5 text-gray-400 group-hover:text-blue-600 dark:group-hover:text-blue-400 ml-4"
|
|
viewBox="0 0 20 20"
|
|
fill="currentColor"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-12 rounded-lg bg-gray-50 dark:bg-gray-900/50 p-6 border border-gray-200 dark:border-white/10">
|
|
<h4 class="text-sm font-semibold text-zinc-900 dark:text-white">Need Help?</h4>
|
|
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
For questions about the Terraform provider, please open an issue on
|
|
<a
|
|
href="https://github.com/towerops-app/terraform-provider-towerops/issues"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="text-blue-600 dark:text-blue-400 hover:underline"
|
|
>
|
|
GitHub
|
|
</a>
|
|
or contact us at <a
|
|
href="mailto:hi@towerops.net"
|
|
class="text-blue-600 dark:text-blue-400 hover:underline"
|
|
>hi@towerops.net</a>.
|
|
</p>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Footer -->
|
|
<footer class="mt-24 border-t border-gray-200 dark:border-white/10 pt-8 pb-16">
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
© 2026 Towerops. All rights reserved.
|
|
</p>
|
|
</footer>
|
|
</main>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Update active navigation link based on scroll position
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const sections = document.querySelectorAll('section[id]');
|
|
const navLinks = document.querySelectorAll('.nav-link');
|
|
|
|
const activeClasses = ['text-emerald-500', 'dark:text-emerald-400', 'font-medium', 'border-l-2', 'border-emerald-500', '-ml-px'];
|
|
const inactiveClasses = ['text-gray-600', 'dark:text-gray-400'];
|
|
|
|
function setActiveLink(id) {
|
|
navLinks.forEach(link => {
|
|
const linkId = link.getAttribute('data-nav-link');
|
|
if (linkId === id) {
|
|
// Remove inactive classes
|
|
inactiveClasses.forEach(cls => link.classList.remove(cls));
|
|
// Add active classes
|
|
activeClasses.forEach(cls => link.classList.add(cls));
|
|
} else {
|
|
// Remove active classes
|
|
activeClasses.forEach(cls => link.classList.remove(cls));
|
|
// Add inactive classes
|
|
inactiveClasses.forEach(cls => link.classList.add(cls));
|
|
}
|
|
});
|
|
}
|
|
|
|
// Use IntersectionObserver to track visible sections
|
|
const observer = new IntersectionObserver((entries) => {
|
|
entries.forEach(entry => {
|
|
if (entry.isIntersecting) {
|
|
setActiveLink(entry.target.id);
|
|
}
|
|
});
|
|
}, {
|
|
rootMargin: '-20% 0px -70% 0px', // Trigger when section is near top
|
|
threshold: 0
|
|
});
|
|
|
|
sections.forEach(section => observer.observe(section));
|
|
|
|
// Also update on hash change (when clicking nav links)
|
|
window.addEventListener('hashchange', function() {
|
|
const hash = window.location.hash.slice(1);
|
|
if (hash) {
|
|
setActiveLink(hash);
|
|
}
|
|
});
|
|
|
|
// Set initial active state
|
|
const initialHash = window.location.hash.slice(1) || 'introduction';
|
|
setActiveLink(initialHash);
|
|
});
|
|
</script>
|