Skip to content

Add Chat service API schemas (proto + OpenAPI) #26

@rowan-stein

Description

@rowan-stein

User Request

Add proto and OpenAPI schemas for the Chat service to agynio/api. Chat is a data-plane service that wraps Threads for the built-in web/mobile app chat experience.

Specification

Proto: proto/agynio/api/chat/v1/chat.proto

5 RPCs in ChatService:

  • CreateChat — Create a new chat thread between participants. Authenticated user auto-added.
  • GetChats — List chats for the authenticated user with cursor-based pagination.
  • GetMessages — List messages in a chat with pagination + unread count (from Threads GetUnackedMessages).
  • SendMessage — Send a message. Sender = authenticated identity_id from gRPC metadata.
  • MarkAsRead — Mark messages as read (delegates to Threads AckMessages). Idempotent.

Entities: Chat, ChatParticipant, ChatMessage

Conventions:

  • Package: agynio.api.chat.v1
  • Go package: github.com/agynio/api/gen/agynio/api/chat/v1;chatv1
  • google.protobuf.Timestamp, cursor-based pagination
  • Identity from gRPC metadata (no user_id in request bodies)
  • Must pass buf lint (STANDARD rules)

OpenAPI: openapi/chat/v1/ (16 files)

Modular YAML structure matching existing specs (files/v1, team/v1, llm/v1):

Endpoint Method Proto RPC
/chats GET GetChats
/chats POST CreateChat
/chats/{chatId}/messages GET GetMessages
/chats/{chatId}/messages POST SendMessage
/chats/{chatId}/read POST MarkAsRead
  • OpenAPI 3.0.3, RFC 7807 Problem, cursor-based pagination (pageSize/pageToken/nextPageToken)
  • No user_id in request bodies — Gateway authenticates and resolves identity

File List

proto/agynio/api/chat/v1/chat.proto
openapi/chat/v1/openapi.yaml
openapi/chat/v1/paths/chats.yaml
openapi/chat/v1/paths/chat-messages.yaml
openapi/chat/v1/paths/chat-read.yaml
openapi/chat/v1/components/parameters/ChatIdPath.yaml
openapi/chat/v1/components/responses/ProblemResponse.yaml
openapi/chat/v1/components/schemas/Problem.yaml
openapi/chat/v1/components/schemas/Chat.yaml
openapi/chat/v1/components/schemas/ChatParticipant.yaml
openapi/chat/v1/components/schemas/ChatCreateRequest.yaml
openapi/chat/v1/components/schemas/PaginatedChats.yaml
openapi/chat/v1/components/schemas/ChatMessage.yaml
openapi/chat/v1/components/schemas/ChatMessageCreateRequest.yaml
openapi/chat/v1/components/schemas/PaginatedChatMessages.yaml
openapi/chat/v1/components/schemas/MarkAsReadRequest.yaml
openapi/chat/v1/components/schemas/MarkAsReadResponse.yaml

References

  • Architecture: agynio/architecture/architecture/chat.md, authn.md, tenancy.md
  • Pattern: proto/agynio/api/threads/v1/threads.proto (proto conventions)
  • Pattern: openapi/llm/v1/ (OpenAPI modular structure)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions