Advanced
API Documentation Example
Example of documenting APIs with TypeTable
API Documentation Example
This page demonstrates how to document APIs using the TypeTable component. Use this pattern when documenting webhooks, integrations, or custom APIs.
Webhook Payload Example
When an account passes a phase, Propriotec sends a webhook to your configured endpoint:
Request
Prop
Type
Example Payload
{
"event": "account.passed",
"timestamp": "2026-01-31T15:30:00Z",
"account": {
"id": "acc_1234567890",
"login": "MT5-12345",
"phase": "phase_1",
"plan": "50K Challenge"
},
"user": {
"id": "usr_0987654321",
"email": "[email protected]",
"name": "John Doe"
}
}Payout Request Webhook
When a trader requests a payout:
Request
Prop
Type
Response Format
Your webhook endpoint should return a response:
Prop
Type
Example Response
{
"success": true,
"message": "Webhook processed successfully"
}Webhook Security
Always verify webhook signatures to ensure requests are coming from Propriotec.
Each webhook includes a signature header:
X-Propriotec-Signature: sha256=abc123...Verify the signature using your webhook secret:
import crypto from 'crypto';
function verifyWebhook(
payload: string,
signature: string,
secret: string
): boolean {
const hmac = crypto.createHmac('sha256', secret);
const digest = 'sha256=' + hmac.update(payload).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(digest)
);
}