Getting Started
Send your first request and understand the core workflow.
Getting Started
The public API supports two primary flows:
- Use
POST /v1/messagesto create a conversation automatically on the first message. - Use
POST /v1/conversationsfirst when your integration needs the conversation ID before the first assistant response.
Base URL
https://api.mortgageguidelines.com
Recommended first call
For most integrations, start with POST /v1/messages.
Responses include the fields needed by integrations: request and conversation identifiers, answer text, sanitized citations, sanitized source summaries, and metadata.tokens_used. Internal model, provider, prompt, retrieval, and service configuration details are not returned.
cURL
curl -X POST "https://api.mortgageguidelines.com/v1/messages" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mgapi_live_your_key_here" \
-H "Idempotency-Key: first-turn-user-123-001" \
-d '{
"message": "What are FHA gift fund rules?",
"user": {
"external_user_id": "user_123",
"email": "user@example.com",
"name": "Test User"
},
"conversation": {
"title": "FHA gift funds",
"metadata": {
"external_ticket_id": "ticket_789"
}
},
"metadata": {
"channel": "crm"
}
}'Example response
{
"request_id": "req_9b8f0b5fcb5b4eaa",
"conversation_id": "conv_3c2fd2bcf41f4f12",
"conversation_created": true,
"message_id": "msg_1fecc99b7f334e6c",
"response": "Gift funds are generally allowed with documentation.",
"citations": [
{
"documentTitle": "Fannie Mae Selling Guide",
"section": "B3-4.3-04",
"url": "https://selling-guide.fanniemae.com/",
"pageNumber": 12
}
],
"sources": [
{
"url": "https://selling-guide.fanniemae.com/",
"title": "Fannie Mae Selling Guide",
"description": "Document from selling-guide.fanniemae.com",
"citationCount": 1
}
],
"metadata": {
"tokens_used": 123
}
}Next steps
- Configure authentication headers in Authentication
- Review the generated API Reference
- Download the current OpenAPI JSON
- Download the current Postman Collection