API ReferenceServer
server.qr
Authorization
ApiKeyAuth x-api-key<token>
API key from /account/api-keys. Free tier: 100 req/hr. Pro tier: 1000 req/hr.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://gmp.ffstudios.io/api/rpc/api-reference/server/qr" \ -H "Content-Type: application/json" \ -d '{ "clientId": "string" }'{
"message": "string",
"data": "string"
}Notes
Proxies to apps/server: GET /qr/:clientId with Accept: application/json.
The data field in the response is a discriminator:
data | Meaning |
|---|---|
| string | The Baileys-generated QR pairing string — render as a QR code |
true | Worker is already authenticated; no QR needed |
false | Worker is waiting for QR generation, not yet ready |
Poll this endpoint after worker.start. The worker initially writes a sentinel value while Baileys spins up; the real QR string appears once the WhatsApp connection negotiation begins.
oRPC client example
import { orpc } from "@/utils/orpc";
import { useQuery } from "@tanstack/react-query";
const qr = useQuery(orpc.server.qr.queryOptions({
input: { clientId: "my-client" },
refetchInterval: 2000,
}));