ChatTicketConversation chat.ticket-conversation@1

Generated at from openvibe-contracts v0.107.0 and openvibe-sdk v0.26.0.

Version
1.0.0
Owner
chat
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/chat/ticket-conversation.v1.json

chat.ticket-conversation@1: one conversation between an OpenVibe.Help ticket and one calling service, keyed by the ticket id and the service, carrying one posted message. The person side reads and answers it through Chat's person APIs (POST /api/chat/send needs a person's session); a service-side author (Help's agent worker, staff tooling) posts here with a service token, which is why the write needs the chat.ticket.write capability rather than the person send route. author_kind says who wrote the message (`person`, `agent` or `staff`), author is that author's subject, body is the text, and created_at is when the message was written.

Fields

FieldTypeRequiredDescriptionConstraints
ticket_idstringyesThe OpenVibe.Help ticket this conversation belongs to. Together with `service` it keys the conversation: one conversation per (ticket id, calling service).
  • minLength 1
  • maxLength 200
servicestringyesThe Contracts manifest id of the calling service (e.g. `help`, `ai`), the service token's principal. Together with `ticket_id` it keys the conversation, so two services on one ticket get two conversations.
  • pattern ^[a-z][a-z0-9-]*$
  • minLength 1
  • maxLength 40
messageobjectyes
  • no other fields
message.author_kindenumyesWho wrote the message: the ticket's `person`, an `agent` (a service acting for one, e.g. Help's AI worker), or `staff` (a human on the service's team).
  • one of "person", "agent", "staff"
message.authorstringyesThe author's subject: `user:<id>` for a person, or the service/agent subject that posted on its behalf. Never a display name.
  • minLength 1
  • maxLength 200
message.bodystringyesThe message text; not blank.
  • minLength 1
  • maxLength 6000
message.created_atstringyesWhen the message was written (the author's clock; Chat keeps its own ordering).
  • format date-time

Examples

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

Valid: agent-answer
{
  "ticket_id": "tkt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "service": "help",
  "message": {
    "author_kind": "agent",
    "author": "agent:agent_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "body": "The export job finished at 23:59 UTC; the last hour is in the next day's file.",
    "created_at": "2026-10-05T09:01:30Z"
  }
}
Valid: person-question
{
  "ticket_id": "tkt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "service": "help",
  "message": {
    "author_kind": "person",
    "author": "user:usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "body": "My export from yesterday is missing the last day of records.",
    "created_at": "2026-10-05T09:00:00Z"
  }
}
Rejected: bad-author-kind
{
  "ticket_id": "tkt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "service": "help",
  "message": {
    "author_kind": "bot",
    "author": "agent:agent_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "body": "This author kind is not one of person, agent or staff.",
    "created_at": "2026-10-05T09:02:00Z"
  }
}
Rejected: missing-body
{
  "ticket_id": "tkt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "service": "help",
  "message": {
    "author_kind": "person",
    "author": "user:usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "created_at": "2026-10-05T09:03:00Z"
  }
}

Validate

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