ChatInboxRequest chat.inbox-request@1

Generated at from openvibe-contracts v0.221.0 and openvibe-sdk v0.65.0.

Version
1.0.0
Owner
chat
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/chat/inbox-request.v1.json

chat.inbox-request@1: a support inbox, made (POST /api/chat/inboxes, name required) or changed by its owner (PATCH /api/chat/inboxes/:id, any subset). Unknown fields are ignored; a bad value is 422 with a code (inbox.name, inbox.origin, inbox.hours, inbox.retention, …). Members (POST /:id/members { username }), saved replies (POST /:id/replies { shortcut, body }), webhooks (POST /:id/webhooks { url }), actions (POST /:id/actions { name, description, url, params }) and verified visitors (POST /:id/identity { action: on | rotate | off }) take their own small bodies on the routes chat.inbox.manage names.

Fields

FieldTypeRequiredDescriptionConstraints
namestring
  • minLength 2
  • maxLength 60
greetingstringThe first line a visitor sees.
  • maxLength 300
colorstring
  • pattern ^#[0-9a-fA-F]{6}$
ai_enabledbooleanVibe, the assistant, answers first.
ai_instructionsstringWhat Vibe should know and how to answer (content, never rules that override Chat's).
  • maxLength 4000
knowledge_urlsone ofhttps pages Vibe may read (an array, or one a line).
allowed_originsone ofThe sites the widget answers (empty: any).
handoffbooleanThe inbox's people answer too (false: a site assistant where only Vibe answers).
hoursobject | nullWhen the people answer; null: always.
routeenumround_robin: a visitor waiting for a person goes to the next of the people.
  • one of "none", "round_robin"
retention_daysinteger | nullHow long finished conversations stay; null: forever.
  • minimum 7
  • maximum 3650

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: hours-routing-retention
{
  "hours": {
    "tz": "America/Los_Angeles",
    "days": [
      1,
      2,
      3,
      4,
      5
    ],
    "start": "09:00",
    "end": "17:00"
  },
  "route": "round_robin",
  "retention_days": 90
}
Valid: make-an-inbox
{
  "name": "Pixel Lamp Co.",
  "greeting": "Questions about your lamp? Ask away.",
  "color": "#7c5cff",
  "ai_enabled": true,
  "ai_instructions": "We sell smart lamps.",
  "knowledge_urls": [
    "https://pixellamp.example/faq"
  ],
  "allowed_origins": [
    "https://pixellamp.example"
  ]
}
Rejected: bad-colour
{
  "color": "orange"
}
Rejected: retention-too-short
{
  "retention_days": 3
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('chat.inbox-request@1', value);   // { valid, errors: [{ path, message }] }