# Request paths

> A message in the chat, an approval, the board and a top-up, step by step.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://app.docs.sypnia.com/architecture/request-paths/

For agents: Message: POST /sessions/{id}/messages → stored → handed to Agent (task context: project, level, memory refs, attachments) → Agent events relayed as SSE (text, question, approval, panel, task, done); the stream resumes with Last-Event-ID after a reconnect. Approval: person POSTs /answers → recorded (who, when, device) → forwarded to Agent, which forwards to the product. Board: GET /projects/{p}/board → parallel reads of each product API with the person's token (timeout 3 s each, 60 s cache per person+project) → card with read_at. Top-up: POST /credits/top-ups → PayPal order created → person approves in PayPal → App captures the order → PayPal webhook (signature verified) or capture result credits the balance once per PayPal order id → receipt e-mail.

## A message

### Stored`POST /sessions/{id}/messages` saves the message with the session.
### Handed to the agentThe server passes it to Sypnia Agent with the project, your level, the memory notes that apply and the attachments.
### Streamed backThe agent's events come back as a stream (`text`, `question`, `approval`, `panel`, `task`, `done`). If the connection drops, the interface reconnects and picks up from the last event it saw.

## An approval

You choose **Approve**. The server records who approved, when and from which device, and passes the decision to the agent, which carries it out through the product. Only a person's session can make this call.

## The board

`GET /projects/{project}/board` asks every product the project uses at the same time, with your session, and waits up to 3 seconds for each. Each card says when it was read. The result is kept for 60 seconds for you and that project.

## A top-up

### Order`POST /credits/top-ups` creates a PayPal order and returns its address.
### PayYou approve the payment in PayPal and come back to App.
### CaptureApp captures the payment. PayPal's confirmation (its signature is checked) or the capture result adds the credits, **once per PayPal order**, so a repeated message never adds them twice.
### ReceiptThe ledger shows the top-up and a receipt arrives by e-mail.
