v1.0Developer Reference

Servunio Developer API

Connect your business software with Servunio: execute approved capabilities, read synchronized resources, configure external connectors, and receive signed webhook events.

Jump to section
Section 01

Overview & Integration Architecture

The Servunio platform supports three integration directions to connect your existing CRM, ERP, booking calendars, and customer data systems with grounded AI concierges:

1. Software Calls Servunio

Execute approved capability contracts (e.g. create bookings, raise tickets, query catalog) or read resources using tenant-scoped REST API keys.

2. Servunio Calls Software

Configure outbound HTTPS connectors in Dashboard. Servunio executes external APIs when agents answer customer queries or trigger business workflows.

3. Software Receives Events

Subscribe to real-time events. Servunio pushes signed HMAC-SHA256 JSON payloads to your webhook endpoint on lifecycle state changes.

Production Base URL

https://servunio.com/v1/developerHTTPS required

All endpoints require TLS 1.3 or 1.2. HTTP requests are automatically redirected to HTTPS.

Section 02

Quickstart Guide

Make your first verified API call to Servunio in under two minutes:

  1. 1
    Generate a scoped API key: Open Dashboard → Settings → Integrations → API Access, click Create API Key, select least-privilege scopes (e.g. capabilities:read), and copy the full key.
  2. 2
    Execute your first request:
    cURL
    bash
    curl -X GET https://servunio.com/v1/developer/capabilities \
      -H "Authorization: Bearer sv_live_prod_abc123.key_secret_xyz789" \
      -H "Accept: application/json"
  3. 3
    Inspect the response:
    Response (200 OK)
    json
    {
      "data": [
        {
          "code": "booking.create",
          "version": "1.0.0",
          "displayName": "Create Appointment",
          "sideEffect": true,
          "requiredIdentity": true,
          "requiresConfirmation": false,
          "status": "active"
        }
      ]
    }
  4. 4
    Verify in Activity: Navigate to Dashboard → Settings → Integrations → Activity to verify that your request was logged with its HTTP status, execution latency, and caller metadata.
Section 03

Authentication & Scopes

Every request to protected Developer API endpoints must include an API credential. You can authenticate using either standard Bearer authorization or a direct X-API-Key header:

Header Option 1 (Bearer)
http
Authorization: Bearer sv_live_...
Header Option 2 (Direct)
http
X-API-Key: sv_live_...

Key Structure & Security

Keys are issued in the format sv_[env]_[prefix].[secret]. Only the cryptographic hash (SHA-256 with pepper) is stored in the database. The secret cannot be retrieved after generation.

Always store credentials in server-side environment variables or secrets managers. Never expose them in browser bundles or client-side code.

Permission Scopes Catalog

ScopeDescription & Permissions
*Full administrative access to all developer actions and tenant resources.
capabilities:readDiscover activated capabilities, input/output schemas, and execution policies.
actions:executeExecute capability workflows, bookings, and business side-effects.
actions:readQuery workflow execution state, outputs, and approval status.
actions:confirmApprove or reject executions awaiting confirmation.
appointments:read / writeRead calendar bookings or trigger booking creation workflows.
tickets:read / writeRead support cases or log new customer complaints/tickets.
leads:read / writeRead captured sales leads or submit prospective inquiries.
quotes:read / writeQuery quote estimates or submit quote calculations.
catalog:readSearch product inventory, pricing, and catalog items.
conversations:readList customer conversation histories and session summaries.
Section 04

Environments & Key Tiers

API credentials are created in either a TEST or LIVE environment:

TEST Credentialssv_test_...
  • Intended for staging integrations and schema discovery.
  • Permitted to query resource endpoints and capability schemas.
  • Cannot perform write actions or execute capabilities.
Important: Servunio does not maintain an isolated mock sandbox. TEST credentials read live tenant data. Use synthetic test organizations for development.
LIVE Credentialssv_live_...
  • Intended for production automation and customer-facing software.
  • Authorized to execute side-effects, appointments, and external connectors.
  • Require valid Idempotency-Key on all action executions.
Zero-Downtime Rotation: Rotate credentials in Dashboard anytime. The old key remains valid until revoked or replaced.
Section 05

REST API Reference

GET/v1/developer/capabilities

List all active capability contracts configured for the caller's organization, including input/output schemas and execution constraints.

Auth
Bearer or X-API-Key
Scopes required
capabilities:readactions:execute
Response
200 OK
json
{
  "data": [
    {
      "code": "booking.create",
      "version": "1.0.0",
      "displayName": "Create Appointment",
      "description": "Book a confirmed appointment slot.",
      "sideEffect": true,
      "requiredIdentity": true,
      "requiresConfirmation": false,
      "inputSchema": {
        "type": "object",
        "required": ["customerName", "slotId"],
        "properties": {
          "customerName": { "type": "string" },
          "slotId": { "type": "string" }
        }
      },
      "outputSchema": { "type": "object" },
      "status": "active"
    }
  ]
}
POST/v1/developer/actions/{capabilityCode}LIVE KEY ONLY

Execute an approved capability contract. Triggers workflow execution, customer verification checks, or external connector invocations.

Auth
Bearer or X-API-Key
Scopes required
actions:execute
Parameters
NameInTypeDescription
capabilityCode*pathstringDot-namespaced capability code (e.g. booking.create, ticket.create).
Idempotency-Key*headerstring (8-200 chars)Unique client-generated key preventing duplicate execution on network retry.
Request
Request Body
json
{
  "input": {
    "customerName": "Jane Doe",
    "slotId": "slot_20261130_1000",
    "serviceType": "HVAC Consultation"
  },
  "customerEmail": "[email protected]",
  "correlationId": "order_ref_98124"
}
Response
200 OK
json
{
  "executionId": "8f1a2345-6789-4bcd-8ef0-123456789abc",
  "status": "completed",
  "result": {
    "bookingId": "bk_98124",
    "confirmedAt": "2026-11-29T23:50:00Z"
  },
  "requiresConfirmation": false
}
  • Write requests strictly require LIVE credentials. TEST credentials return 403 Forbidden.
  • If the capability specifies requiresConfirmation: true, the execution returns status: 'awaiting_confirmation'.
GET/v1/developer/executions/{executionId}

Retrieve the execution state, input parameters, output results, and error details of a previously submitted capability action.

Auth
Bearer or X-API-Key
Scopes required
actions:readactions:execute
Parameters
NameInTypeDescription
executionId*pathUUIDUnique execution identifier returned by POST /actions/{capabilityCode}.
Response
200 OK
json
{
  "id": "8f1a2345-6789-4bcd-8ef0-123456789abc",
  "status": "completed",
  "capabilityCode": "booking.create",
  "input": { "slotId": "slot_20261130_1000" },
  "output": { "bookingId": "bk_98124" },
  "error": null,
  "requiresConfirmation": false,
  "confirmedAt": null,
  "createdAt": "2026-11-29T23:45:00.000Z",
  "updatedAt": "2026-11-29T23:45:02.000Z"
}
POST/v1/developer/executions/{executionId}/confirmLIVE KEY ONLY

Explicitly approve or reject an execution that paused in the awaiting_confirmation state.

Auth
Bearer or X-API-Key
Scopes required
actions:confirmactions:execute
Parameters
NameInTypeDescription
executionId*pathUUIDUnique execution identifier awaiting confirmation.
Idempotency-Key*headerstringUnique idempotency key for this approval request.
Request
Request Body
json
{
  "approved": true,
  "reason": "Supervisor approved high-value quote."
}
Response
200 OK
json
{
  "executionId": "8f1a2345-6789-4bcd-8ef0-123456789abc",
  "status": "completed",
  "confirmedAt": "2026-11-29T23:48:10.000Z"
}
GET/v1/developer/resources/{resource}

Read tenant business records using keyset cursor pagination. Internal metadata, staff notes, and OTP secrets are securely stripped.

Auth
Bearer or X-API-Key
Scopes required
appointments:readtickets:readleads:readquotes:readcatalog:readconversations:read
Parameters
NameInTypeDescription
resource*pathenumOne of: appointments, tickets, leads, quotes, catalog, conversations.
limitqueryinteger (1-100)Number of records to return. Default: 25.
afterqueryUUIDCursor ID from nextCursor of the previous page.
Response
200 OK
json
{
  "data": [
    {
      "id": "11111111-2222-3333-4444-555555555555",
      "customerName": "Jane Doe",
      "customerEmail": "[email protected]",
      "status": "CONFIRMED",
      "startTime": "2026-12-01T10:00:00Z"
    }
  ],
  "hasMore": true,
  "nextCursor": "11111111-2222-3333-4444-555555555555"
}
GET/v1/developer/openapi.json

Download the full machine-readable OpenAPI 3.1.0 specification document for automated client generation and schema validation.

Auth
Public (No auth required)
Response
200 OK
json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Servunio Developer API",
    "version": "1.0"
  },
  "paths": { ... }
}
Section 06

Action Execution & Human-in-the-Loop Confirmation

Capabilities execute within a managed workflow engine. Actions requiring human sign-off or multi-step processing follow an explicit state transition lifecycle:

pending→running→awaiting_confirmation→completed

When an action pauses in awaiting_confirmation, your application or team can inspect the payload in the Dashboard Inbox or call POST /executions/{id}/confirm to approve or deny execution.

Section 07

Pagination Guide

Resource listing endpoints use deterministic cursor-based pagination. You pass the nextCursor value as the after query parameter on subsequent calls:

pagination-example.js
javascript
async function fetchAllAppointments(apiKey) {
  let after = undefined;
  const allAppointments = [];

  do {
    const url = new URL("https://servunio.com/v1/developer/resources/appointments");
    url.searchParams.set("limit", "50");
    if (after) url.searchParams.set("after", after);

    const res = await fetch(url, {
      headers: { "Authorization": `Bearer ${apiKey}` },
    });
    if (!res.ok) throw new Error(`Failed to fetch: ${res.status}`);
    const page = await res.json();

    allAppointments.push(...page.data);
    after = page.hasMore ? page.nextCursor : null;
  } while (after);

  return allAppointments;
}
Section 08

Reliability, Idempotency & Rate Limits

HTTP Status Code Matrix

CodeReasonRetry Safe?
200 OKRequest completed successfully.No
400 Bad RequestValidation error, malformed JSON, or missing Idempotency-Key.No
401 UnauthorizedMissing, invalid, expired, or revoked API credential.No
403 ForbiddenInsufficient scope or TEST credential executing live actions.No
404 Not FoundExecution ID or resource record does not exist.No
409 ConflictIdempotency key re-used with different payload or execution currently locked.Wait & Retry
429 Too Many RequestsRate limit exceeded (120 req/min per key default).Yes (Exponential Backoff)
503 UnavailableDownstream service temporarily unreachable.Yes (With Jitter)

Idempotency Guarantees

Every POST /actions/{code} and /confirm request requires an Idempotency-Key header (8–200 characters). Servunio uses atomic Redis locks and persistent database caching:

  • Identical Key + Identical Payload: Returns the original cached response without re-executing side effects.
  • Identical Key + Altered Payload: Rejects immediately with 409 RESOURCE_CONFLICT.
  • In-flight Execution: Rejects concurrent requests using the same key with 409 ACTION_IN_PROGRESS.
Section 09

External Connections & Custom Connectors

When you want Servunio to call your internal or third-party software, configure an External Connection in the Dashboard. Connectors allow AI agents and workflow steps to invoke your external endpoints securely:

Supported Authentication Types

NONE
API_KEY
BEARER
BASIC
OAUTH2

All connector credentials are encrypted at rest with AES-256-GCM. External endpoints must be reachable over HTTPS and adhere to strict server-side SSRF protections (private IP ranges, localhost, and AWS metadata services are blocked).

Section 10

Signed Webhook Subscriptions

Receive real-time notifications when bookings confirm, support cases change state, or AI executions complete. Webhook deliveries include cryptographic signatures to guarantee payload integrity:

Signature Verification Example (Node.js)

webhook-receiver.js
javascript
import crypto from "node:crypto";
import express from "express";

const app = express();

// IMPORTANT: Capture raw buffer before JSON parsing
app.post("/webhooks/servunio", express.raw({ type: "application/json" }), (req, res) => {
  const signature = req.headers["x-servunio-signature"];
  const timestamp = req.headers["x-servunio-timestamp"];
  const secret = process.env.SERVUNIO_WEBHOOK_SECRET;

  if (!signature || !timestamp || !secret) {
    return res.status(401).send("Missing signature headers");
  }

  // Prevent replay attacks (5 minute window)
  const now = Math.floor(Date.now() / 1000);
  if (Math.abs(now - parseInt(timestamp, 10)) > 300) {
    return res.status(401).send("Timestamp expired");
  }

  // Compute expected HMAC-SHA256 digest
  const hmac = crypto.createHmac("sha256", secret);
  hmac.update(`${timestamp}.`);
  hmac.update(req.body); // raw buffer
  const expectedSignature = hmac.digest("hex");

  if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expectedSignature))) {
    return res.status(401).send("Invalid signature");
  }

  const event = JSON.parse(req.body.toString("utf8"));
  console.log("Verified event received:", event.type, event.id);

  res.status(200).json({ received: true });
});

Delivery & Retry Policy

  • At-Least-Once Delivery: Endpoints must be idempotent. Deduplicate using the event.id UUID.
  • Timeouts & Retries: Deliveries timeout after 10 seconds. Failed deliveries (4xx/5xx responses or timeouts) retry up to 5 times with exponential backoff.
  • Zero-Downtime Secret Rotation: Servunio sends dual signatures during key rotation transitions.
Section 11

Activity Log & Troubleshooting

The Dashboard Activity stream records all developer requests, connector executions, and webhook deliveries for complete auditability:

Logged Request Metadata

Activity records HTTP verb, route path, status code, latency (ms), client IP, and credential ID. To safeguard customer privacy and GDPR compliance, full request and response bodies are not persisted in audit logs.

Missing Record Notes

Requests rejected early at the network ingress or authentication guard (e.g. malformed API key prefix or expired key) are rejected before reaching the activity interceptor and will not generate an Activity log entry.

Section 12

TypeScript SDK & Client Libraries

Package Status: Private Monorepo Workspace

The official TypeScript client library @servunio/sdk is maintained directly inside the Servunio monorepo. It has not yet been published to the public npm registry. All endpoints are standard REST HTTP/JSON and are fully operable using native fetch, cURL, Python httpx, or any HTTP client.

direct-fetch.ts
typescript
// Direct REST invocation with native fetch (No SDK installation required)
const response = await fetch("https://servunio.com/v1/developer/actions/booking.create", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SERVUNIO_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    input: { slotId: "slot_12345", customerName: "Alex Smith" },
  }),
});

const result = await response.json();
console.log("Execution status:", result.status);
Section 13

Versioning Policy & Developer Support

Backwards Compatibility

Servunio follows additive versioning. Adding new endpoints, optional parameters, or new fields to response payloads are non-breaking. Breaking schema changes are introduced via explicit URL version paths (e.g. /v2/developer).

Developer Support

Need assistance connecting your software or requesting custom capability contracts? Contact our engineering team directly at:

[email protected]