---
title: "Platform API"
description: "Call Vettero from a third-party app with an API key, and receive webhooks when something happens."
canonical_url: "https://docs.vettero.com/developer-api"
---
# Platform API

> Call Vettero from a third-party app with an API key, and receive webhooks when something happens.

The **platform API** lets another application use a Vettero company: start chats, read and write table rows, query knowledge bases, and read billing. It is separate from [HTTP Servers](https://docs.vettero.com/build/http-servers), which are workflows you design yourself.

## Open the settings

Open **Settings → API access**. Only company **Admins** can create keys and webhooks.

## Base URL

Every call goes to the **company host**. The subdomain is the company username and selects the tenant before the API key is checked.

```text
https://<company>.vettero.com/api/developer/v1
```

Example: `https://acme.vettero.com/api/developer/v1/sessions`

There is no company id in the path. A wrong host with a valid key from another company returns an auth error. Later breaking majors use `/api/developer/v2`, and so on.

## OpenAPI document

The contract is a public OpenAPI 3.1 document. No API key is required to read it.

`GET https://<company>.vettero.com/api/developer/openapi.json`

That document describes the current major (`v1`). It includes operation descriptions, request and response schemas, and webhook delivery. Every operation lives under `/api/developer/v1`.

## Call the API

<table>
<thead>
  <tr>
    <th>
      Header
    </th>
    
    <th>
      When
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        Authorization: Bearer <api key>
      </code>
    </td>
    
    <td>
      Every call
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        X-Workspace-Id
      </code>
    </td>
    
    <td>
      Workspace routes. Use the workspace <strong>
        Id
      </strong>
      
       (slug), not the Mongo id. Billing routes ignore this header
    </td>
  </tr>
</tbody>
</table>

The key is shown once when you create it. Each key has **scopes** and an optional list of workspace ids. An empty workspace list can call every workspace in the company.

Responses use `{ "success": true, "data": ... }`. Errors use `{ "success": false, "message", "code", "data" }`.

## Hard fields (quick reference)

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        X-Workspace-Id
      </code>
    </td>
    
    <td>
      Workspace <strong>
        slug
      </strong>
      
       from the product
    </td>
  </tr>
  
  <tr>
    <td>
      Guest <code>
        userId
      </code>
    </td>
    
    <td>
      Your app’s stable user id. Stored as the guest token
    </td>
  </tr>
  
  <tr>
    <td>
      Guest <code>
        metadata
      </code>
    </td>
    
    <td>
      Replaces the whole object when sent (not merged)
    </td>
  </tr>
  
  <tr>
    <td>
      Guest <code>
        token
      </code>
      
       / <code>
        guestToken
      </code>
    </td>
    
    <td>
      Opaque <code>
        vtg.…
      </code>
      
       string. Expires in one hour
    </td>
  </tr>
  
  <tr>
    <td>
      Session <code>
        {id}
      </code>
    </td>
    
    <td>
      Mongo id <strong>
        or
      </strong>
      
       session <code>
        token
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Channel <code>
        {id}
      </code>
    </td>
    
    <td>
      Workspace <strong>
        channel
      </strong>
      
       id, not a session id
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        channelIdentifier
      </code>
    </td>
    
    <td>
      Other party’s phone or email on that channel
    </td>
  </tr>
  
  <tr>
    <td>
      Run <code>
        wait
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
      
       → HTTP 202; omit/true → wait for result
    </td>
  </tr>
  
  <tr>
    <td>
      Table <code>
        values
      </code>
      
       / <code>
        data
      </code>
    </td>
    
    <td>
      Keys are <strong>
        field ids
      </strong>
      
       on that table
    </td>
  </tr>
  
  <tr>
    <td>
      KB add/refresh
    </td>
    
    <td>
      Queues ingest; does not wait for indexing
    </td>
  </tr>
  
  <tr>
    <td>
      Approval <code>
        kind
      </code>
    </td>
    
    <td>
      <code>
        approval
      </code>
      
       → approve/reject; <code>
        information
      </code>
      
       → submit
    </td>
  </tr>
  
  <tr>
    <td>
      Approval <code>
        asUserId
      </code>
    </td>
    
    <td>
      Act as a workspace member when the key owner is a service account
    </td>
  </tr>
  
  <tr>
    <td>
      Schedule <code>
        mode
      </code>
    </td>
    
    <td>
      <code>
        specificTime
      </code>
      
       needs <code>
        scheduledAt
      </code>
      
      ; <code>
        timeoutMinutes
      </code>
      
       needs <code>
        timeoutMinutes
      </code>
    </td>
  </tr>
</tbody>
</table>

## What you can call

<table>
<thead>
  <tr>
    <th>
      Area
    </th>
    
    <th>
      Scope
    </th>
    
    <th>
      What it covers
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a href="https://docs.vettero.com/developer-api/guests">
        Guests
      </a>
    </td>
    
    <td>
      <code>
        guests
      </code>
    </td>
    
    <td>
      Save a person and extra metadata, then issue a short-lived guest token
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://docs.vettero.com/developer-api/chat">
        Chat and channels
      </a>
    </td>
    
    <td>
      <code>
        chat
      </code>
      
      , <code>
        channels
      </code>
    </td>
    
    <td>
      Sessions, messages, and posting into WhatsApp, mail, or voice
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://docs.vettero.com/developer-api/runs">
        Runs
      </a>
    </td>
    
    <td>
      <code>
        runs
      </code>
    </td>
    
    <td>
      Agents, workflows, functions, and queries
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://docs.vettero.com/developer-api/data">
        Data
      </a>
    </td>
    
    <td>
      <code>
        tables
      </code>
      
      , <code>
        kb
      </code>
      
      , <code>
        files
      </code>
    </td>
    
    <td>
      Rows, datasources, and files
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://docs.vettero.com/developer-api/activity">
        Workspace activity
      </a>
    </td>
    
    <td>
      <code>
        approvals
      </code>
      
      , <code>
        notifications
      </code>
      
      , <code>
        schedules
      </code>
    </td>
    
    <td>
      Approvals, inbox items, and schedules
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://docs.vettero.com/developer-api/billing">
        Billing
      </a>
    </td>
    
    <td>
      <code>
        billing:read
      </code>
    </td>
    
    <td>
      Plan, usage, payments, wallet, and invoices. Read only
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://docs.vettero.com/developer-api/webhooks">
        Webhooks
      </a>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Vettero calls your HTTPS URL when an event happens
    </td>
  </tr>
</tbody>
</table>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
