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.
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": [
{
"documentId": "doc_1"
}
],
"sources": [
{
"url": "https://selling-guide.fanniemae.com/",
"title": "Fannie Mae Selling Guide"
}
],
"metadata": {
"tokens_used": 123
}
}Next steps
- Configure authentication headers in Authentication
- Review the generated API Reference
- Download the current OpenAPI JSON
- Import the current Postman Collection