// Helpdesk — A support desk: tickets, messages, agents, customers, SLAs — the state-machine one. // sondahub (https://sondahub.com): served over gRPC-Web and Connect at https://api.sondahub.com/grpc. // Writes are simulated: answered as a real server would, kept only in the x-sondahub-session token you send back. syntax = "proto3"; package sondahub.helpdesk.v1; import "google/protobuf/struct.proto"; service HelpdeskService { // A page of teams: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListTeams(ListTeamsRequest) returns (ListTeamsResponse); // One team by id. rpc GetTeam(GetTeamRequest) returns (Team); // Create a team (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateTeam(Team) returns (Team); // Change the fields set in team (simulated). rpc UpdateTeam(UpdateTeamRequest) returns (Team); // Delete one (simulated); answers what was removed. rpc DeleteTeam(DeleteTeamRequest) returns (Team); // A page of agents: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse); // One agent by id. rpc GetAgent(GetAgentRequest) returns (Agent); // Create a agent (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateAgent(Agent) returns (Agent); // Change the fields set in agent (simulated). rpc UpdateAgent(UpdateAgentRequest) returns (Agent); // Delete one (simulated); answers what was removed. rpc DeleteAgent(DeleteAgentRequest) returns (Agent); // A page of customers: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListCustomers(ListCustomersRequest) returns (ListCustomersResponse); // One customer by id. rpc GetCustomer(GetCustomerRequest) returns (Customer); // Create a customer (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateCustomer(Customer) returns (Customer); // Change the fields set in customer (simulated). rpc UpdateCustomer(UpdateCustomerRequest) returns (Customer); // Delete one (simulated); answers what was removed. rpc DeleteCustomer(DeleteCustomerRequest) returns (Customer); // A page of tickets: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListTickets(ListTicketsRequest) returns (ListTicketsResponse); // One ticket by id. rpc GetTicket(GetTicketRequest) returns (Ticket); // Create a ticket (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateTicket(Ticket) returns (Ticket); // Change the fields set in ticket (simulated). rpc UpdateTicket(UpdateTicketRequest) returns (Ticket); // Delete one (simulated); answers what was removed. rpc DeleteTicket(DeleteTicketRequest) returns (Ticket); // A page of messages: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20). rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse); // One message by id. rpc GetMessage(GetMessageRequest) returns (Message); // Create a message (simulated, kept in your session token). id and the timestamps are set by the server. rpc CreateMessage(Message) returns (Message); // Change the fields set in message (simulated). rpc UpdateMessage(UpdateMessageRequest) returns (Message); // Delete one (simulated); answers what was removed. rpc DeleteMessage(DeleteMessageRequest) returns (Message); // The API's live activity as a server stream, each topic at its own pace: tickets (every 5 s), messages (every 4 s). max_events ends the stream (default 10, at most 120). rpc Watch(WatchRequest) returns (stream Event); } message Team { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string name = 4; optional string slug = 5; optional string timezone = 6; optional string hours = 7; } message ListTeamsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListTeamsResponse { repeated Team data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateTeamRequest { int64 id = 1; Team team = 2; } message GetTeamRequest { int64 id = 1; } message DeleteTeamRequest { int64 id = 1; } message Agent { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string name = 4; optional string email = 5; optional int64 team_id = 6; optional string role = 7; optional string status = 8; google.protobuf.Value skills = 9; optional int64 open_tickets = 10; optional double rating = 11; } message ListAgentsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListAgentsResponse { repeated Agent data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateAgentRequest { int64 id = 1; Agent agent = 2; } message GetAgentRequest { int64 id = 1; } message DeleteAgentRequest { int64 id = 1; } message Customer { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string name = 4; optional string domain = 5; optional string plan = 6; optional string contact_name = 7; optional string contact_email = 8; // First response target, hours. optional int64 sla_hours = 9; optional int64 open_tickets = 10; // Average CSAT, 1–5. optional double satisfaction = 11; } message ListCustomersRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListCustomersResponse { repeated Customer data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateCustomerRequest { int64 id = 1; Customer customer = 2; } message GetCustomerRequest { int64 id = 1; } message DeleteCustomerRequest { int64 id = 1; } message Ticket { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional string number = 4; optional string subject = 5; optional string description = 6; optional string status = 7; optional string priority = 8; optional string category = 9; optional string channel = 10; optional int64 customer_id = 11; optional string requester_email = 12; optional int64 assignee_id = 13; optional int64 team_id = 14; google.protobuf.Value tags = 15; optional string first_response_at = 16; optional string resolved_at = 17; optional string closed_at = 18; optional string due_at = 19; optional bool sla_breached = 20; // CSAT given at close. optional int64 satisfaction = 21; optional int64 message_count = 22; } message ListTicketsRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListTicketsResponse { repeated Ticket data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateTicketRequest { int64 id = 1; Ticket ticket = 2; } message GetTicketRequest { int64 id = 1; } message DeleteTicketRequest { int64 id = 1; } message Message { // Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. int64 id = 1; // When the record was created (ISO 8601, UTC). optional string created_at = 2; // When the record last changed. optional string updated_at = 3; optional int64 ticket_id = 4; optional string author_type = 5; // The agent, when author_type is agent. optional int64 author_id = 6; optional string author_name = 7; optional string body = 8; // A private note the customer does not see. optional bool internal = 9; google.protobuf.Value attachments = 10; } message ListMessagesRequest { int32 page = 1; int32 limit = 2; string sort = 3; string q = 4; map filter = 5; } message ListMessagesResponse { repeated Message data = 1; int32 page = 2; int32 limit = 3; int32 total = 4; int32 pages = 5; } message UpdateMessageRequest { int64 id = 1; Message message = 2; } message GetMessageRequest { int64 id = 1; } message DeleteMessageRequest { int64 id = 1; } message WatchRequest { repeated string topics = 1; int32 max_events = 2; } message Event { string topic = 1; string api = 2; string ts = 3; google.protobuf.Struct data = 4; }