---
title: "Guests"
description: "Identify a person from your app and store extra profile fields."
canonical_url: "https://docs.vettero.com/developer-api/guests"
---
# Guests

> Identify a person from your app and store extra profile fields.

A **guest** is a person who does not have a Vettero login. The `userId` you send is your application's user id. Vettero stores it as the guest token and keeps a **metadata** object for anything else you need (name, email, external ids).

## Fields that trip people up

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

<tbody>
  <tr>
    <td>
      <code>
        userId
      </code>
      
       (path or body)
    </td>
    
    <td>
      Your stable id for that person. Not a Vettero user id
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        metadata
      </code>
    </td>
    
    <td>
      When present, <strong>
        replaces
      </strong>
      
       the stored object. It is not merged
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        token
      </code>
    </td>
    
    <td>
      Opaque signed string starting with <code>
        vtg.
      </code>
      
      . Do not parse it
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expiresAt
      </code>
    </td>
    
    <td>
      ISO time. Tokens last <strong>
        one hour
      </strong>
    </td>
  </tr>
</tbody>
</table>

When you create a chat session, prefer `guestToken` from the token call over sending `userId` again so identity stays consistent.

## Calls

<table>
<thead>
  <tr>
    <th>
      Call
    </th>
    
    <th>
      Body
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        PUT /api/developer/v1/guests/{userId}
      </code>
    </td>
    
    <td>
      Optional <code>
        phone
      </code>
      
       and <code>
        metadata
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST /api/developer/v1/guest-tokens
      </code>
    </td>
    
    <td>
      <code>
        userId
      </code>
      
      , optional <code>
        phone
      </code>
      
       and <code>
        metadata
      </code>
    </td>
  </tr>
</tbody>
</table>

The token call upserts the guest and returns `{ guest, token, expiresAt }`.

Scope: `guests`. Send `X-Workspace-Id` (workspace slug). Guest records are company-scoped, but these routes still sit on the workspace middleware group.


## Sitemap

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