---
# System prepended metadata

title: Limit Http Agent API (Server <-> Client)

---

# Limit Http Agent API (Server <-> Client)

```Internal service <- via grpc -> Http agent <- via http/grpc -> user/client```

## General Design

- RPC style
- Transmit via HTTP/grpc(?)
- Authorize `JWT` by `Authorization: bearer` header

## Methods

- **POST** Auth :: (id: String, device_id: String) -> JWT
- **GET**  Sync :: Header AUTH => DateRange -> [Event]
- **POST** Send :: Header AUTH => Event -> ID
- **GET**  Upload :: FileMetaData -> URL



### Result

```json
COMMON_HEADERS {
    "trace_id": "uuidv7"
}
```

```
RESULT := SUCCESS | ERROR
```

```json
SUCCESS := 
    HTTP_CODE 200
    HTTP_HEADER: COMMON_HEADERS
    HTTP_BODY {}

SUCCESS :=
    HTTP_CODE 204
    HTTP_HEADER: COMMON_HEADERS
    HTTP_BODY ()
```

```json
ERROR := 
    HTTP_CODE 400+
    HTTP_BODY {
        "code": "SOME_ERROR_CODE",
        "detail?": "Any"
    }
```
