{"info":{"_postman_id":"6cfdb9f6-13cb-4cda-9041-7f4a6e68e4a7","name":"MortgageGuidelines Public API","description":"Generated Postman collection for the MortgageGuidelines server-to-server public API. Set `apiKey` before sending requests. The collection uses Bearer authentication by default; each request also includes a disabled `X-API-Key` header for integrations that prefer that form.","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"auth":{"type":"bearer","bearer":[{"key":"token","value":"{{apiKey}}","type":"string"}]},"variable":[{"key":"baseUrl","value":"https://api.mortgageguidelines.com","type":"string","description":"Public API origin."},{"key":"apiKey","value":"mgapi_live_your_key_here","type":"string","description":"Public API key. Use the live key issued for your tenant."},{"key":"conversationId","value":"conv_3c2fd2bcf41f4f12","type":"string","description":"Conversation ID returned by create or first-message requests."},{"key":"messageId","value":"msg_1fecc99b7f334e6c","type":"string","description":"Last message ID returned by a message request."},{"key":"externalUserId","value":"user_123","type":"string","description":"Stable user identifier from your system."},{"key":"idempotencyKey","value":"first-turn-user-123-001","type":"string","description":"Stable key for retrying the same non-streaming POST request."}],"item":[{"name":"Account","item":[{"name":"Get authenticated API key details","request":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/me","host":["{{baseUrl}}"],"path":["v1","me"]},"description":"Returns the authenticated public API key record and resolved tenant configuration.\n\nRequired scopes: any valid public API key"},"response":[{"name":"200 application/json","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/me","host":["{{baseUrl}}"],"path":["v1","me"]},"description":"Returns the authenticated public API key record and resolved tenant configuration.\n\nRequired scopes: any valid public API key"},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":"{\n  \"request_id\": \"req_9b8f0b5fcb5b4eaa\",\n  \"key\": {\n    \"id\": \"pak_test\",\n    \"name\": \"Atlantic Bay Production\",\n    \"status\": \"active\",\n    \"scopes\": [\n      \"chat:read\",\n      \"chat:write\",\n      \"sources:read\"\n    ],\n    \"last_four\": \"test\",\n    \"tenant\": {\n      \"clientName\": \"Atlantic Bay\",\n      \"clientOrganization\": \"Atlantic Bay Mortgage Group\",\n      \"enabledSources\": [\n        \"fannie_mae\",\n        \"fha\"\n      ],\n      \"baseSources\": [\n        \"mortgage_guidelines\"\n      ],\n      \"tenantSourceSidebarMode\": \"flat\",\n      \"tenantSources\": [\n        {\n          \"key\": \"product-guides\",\n          \"label\": \"Product Guides\",\n          \"description\": \"Internal product guidance\",\n          \"defaultOn\": true\n        }\n      ],\n      \"secondarySources\": [\n        {\n          \"type\": \"tenant_bucket\",\n          \"key\": \"product-guides\",\n          \"label\": \"Product Guides\",\n          \"defaultOn\": true\n        }\n      ],\n      \"defaultTenantSourceKeys\": [\n        \"product-guides\"\n      ],\n      \"defaultSharedSourceTypes\": [\n        \"mortgage_guidelines\"\n      ],\n      \"assignedSharedSourceTypes\": [\n        \"mortgage_guidelines\"\n      ]\n    }\n  }\n}"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","const contentType = pm.response.headers.get(\"Content-Type\") || \"\";","if (contentType.includes(\"application/json\")) {","  try {","    const data = pm.response.json();","    if (data.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation_id);","    if (data.conversation && data.conversation.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation.conversation_id);","    if (data.message_id) pm.collectionVariables.set(\"messageId\", data.message_id);","  } catch (error) {}","}"]}}]}]},{"name":"Discovery","item":[{"name":"List the sources available to the authenticated API key","request":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/sources","host":["{{baseUrl}}"],"path":["v1","sources"]},"description":"Returns enabled agency sources plus tenant and shared source selections available to this API key.\n\nRequired scopes: `sources:read`"},"response":[{"name":"200 application/json","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/sources","host":["{{baseUrl}}"],"path":["v1","sources"]},"description":"Returns enabled agency sources plus tenant and shared source selections available to this API key.\n\nRequired scopes: `sources:read`"},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":"{\n  \"request_id\": \"req_9b8f0b5fcb5b4eaa\",\n  \"agency_source_types\": [\n    \"fannie_mae\",\n    \"fha\"\n  ],\n  \"enabled_sources\": [\n    \"fannie_mae\",\n    \"fha\"\n  ],\n  \"base_sources\": [\n    \"mortgage_guidelines\"\n  ],\n  \"tenant_source_sidebar_mode\": \"flat\",\n  \"tenant_sources\": [\n    {\n      \"key\": \"product-guides\",\n      \"label\": \"Product Guides\",\n      \"description\": \"Internal product guidance\",\n      \"defaultOn\": true\n    }\n  ],\n  \"tenant_source_keys\": [\n    \"product-guides\"\n  ],\n  \"secondary_sources\": [\n    {\n      \"type\": \"tenant_bucket\",\n      \"key\": \"product-guides\",\n      \"label\": \"Product Guides\",\n      \"defaultOn\": true\n    },\n    {\n      \"type\": \"shared_source\",\n      \"sourceType\": \"mortgage_guidelines\",\n      \"label\": \"Mortgage Guidelines\",\n      \"defaultOn\": false\n    }\n  ],\n  \"default_tenant_source_keys\": [\n    \"product-guides\"\n  ],\n  \"default_shared_source_types\": [\n    \"mortgage_guidelines\"\n  ],\n  \"assigned_shared_source_types\": [\n    \"mortgage_guidelines\"\n  ]\n}"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","const contentType = pm.response.headers.get(\"Content-Type\") || \"\";","if (contentType.includes(\"application/json\")) {","  try {","    const data = pm.response.json();","    if (data.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation_id);","    if (data.conversation && data.conversation.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation.conversation_id);","    if (data.message_id) pm.collectionVariables.set(\"messageId\", data.message_id);","  } catch (error) {}","}"]}}]}]},{"name":"Conversations","item":[{"name":"Create a conversation explicitly","request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Idempotency-Key","value":"{{idempotencyKey}}","type":"text","description":"Use a stable value when retrying the same non-streaming POST request."},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations","host":["{{baseUrl}}"],"path":["v1","conversations"]},"description":"Creates a conversation before sending any assistant messages. Use this when you need a stable conversation ID up front.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported for non-streaming POST requests so that safe retries return the original completed response.","body":{"mode":"raw","raw":"{\n  \"title\": \"FHA gift funds\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\",\n    \"email\": \"user@example.com\",\n    \"name\": \"Test User\"\n  },\n  \"metadata\": {\n    \"external_ticket_id\": \"ticket_789\"\n  }\n}","options":{"raw":{"language":"json"}}}},"response":[{"name":"201 application/json","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Idempotency-Key","value":"{{idempotencyKey}}","type":"text","description":"Use a stable value when retrying the same non-streaming POST request."},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations","host":["{{baseUrl}}"],"path":["v1","conversations"]},"description":"Creates a conversation before sending any assistant messages. Use this when you need a stable conversation ID up front.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported for non-streaming POST requests so that safe retries return the original completed response.","body":{"mode":"raw","raw":"{\n  \"title\": \"FHA gift funds\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\",\n    \"email\": \"user@example.com\",\n    \"name\": \"Test User\"\n  },\n  \"metadata\": {\n    \"external_ticket_id\": \"ticket_789\"\n  }\n}","options":{"raw":{"language":"json"}}}},"status":"Created","code":201,"header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":"{\n  \"request_id\": \"req_9b8f0b5fcb5b4eaa\",\n  \"conversation_id\": \"conv_3c2fd2bcf41f4f12\"\n}"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [201];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","const contentType = pm.response.headers.get(\"Content-Type\") || \"\";","if (contentType.includes(\"application/json\")) {","  try {","    const data = pm.response.json();","    if (data.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation_id);","    if (data.conversation && data.conversation.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation.conversation_id);","    if (data.message_id) pm.collectionVariables.set(\"messageId\", data.message_id);","  } catch (error) {}","}"]}}]},{"name":"Get a conversation","request":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Returns the conversation metadata for a conversation owned by the authenticated API key.\n\nRequired scopes: `chat:read`"},"response":[{"name":"200 application/json","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Returns the conversation metadata for a conversation owned by the authenticated API key.\n\nRequired scopes: `chat:read`"},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":"{\n  \"request_id\": \"req_9b8f0b5fcb5b4eaa\",\n  \"conversation\": {\n    \"conversation_id\": \"conv_3c2fd2bcf41f4f12\",\n    \"title\": \"FHA gift funds\",\n    \"status\": \"active\",\n    \"created_at\": \"2025-04-19T18:20:00.000Z\",\n    \"updated_at\": \"2025-04-19T18:21:30.000Z\",\n    \"message_count\": 2,\n    \"metadata\": {\n      \"external_ticket_id\": \"ticket_789\"\n    }\n  }\n}"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","const contentType = pm.response.headers.get(\"Content-Type\") || \"\";","if (contentType.includes(\"application/json\")) {","  try {","    const data = pm.response.json();","    if (data.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation_id);","    if (data.conversation && data.conversation.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation.conversation_id);","    if (data.message_id) pm.collectionVariables.set(\"messageId\", data.message_id);","  } catch (error) {}","}"]}}]},{"name":"List messages in a conversation","request":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}/messages","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}","messages"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Returns the stored messages for a conversation owned by the authenticated API key.\n\nRequired scopes: `chat:read`"},"response":[{"name":"200 application/json","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}/messages","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}","messages"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Returns the stored messages for a conversation owned by the authenticated API key.\n\nRequired scopes: `chat:read`"},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":"{\n  \"request_id\": \"req_9b8f0b5fcb5b4eaa\",\n  \"conversation_id\": \"conv_3c2fd2bcf41f4f12\",\n  \"messages\": [\n    {\n      \"message_id\": \"msg_user_123\",\n      \"role\": \"user\",\n      \"content\": \"What are FHA gift fund rules?\",\n      \"citations\": [],\n      \"sources\": [],\n      \"metadata\": {\n        \"channel\": \"crm\"\n      },\n      \"created_at\": \"2025-04-19T18:20:00.000Z\"\n    },\n    {\n      \"message_id\": \"msg_1fecc99b7f334e6c\",\n      \"role\": \"assistant\",\n      \"content\": \"Gift funds are generally allowed with documentation.\",\n      \"citations\": [\n        {\n          \"documentId\": \"doc_1\"\n        }\n      ],\n      \"sources\": [\n        {\n          \"url\": \"https://selling-guide.fanniemae.com/\",\n          \"title\": \"Fannie Mae Selling Guide\"\n        }\n      ],\n      \"metadata\": {\n        \"tokens_used\": 123\n      },\n      \"created_at\": \"2025-04-19T18:21:30.000Z\"\n    }\n  ]\n}"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","const contentType = pm.response.headers.get(\"Content-Type\") || \"\";","if (contentType.includes(\"application/json\")) {","  try {","    const data = pm.response.json();","    if (data.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation_id);","    if (data.conversation && data.conversation.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation.conversation_id);","    if (data.message_id) pm.collectionVariables.set(\"messageId\", data.message_id);","  } catch (error) {}","}"]}}]}]},{"name":"Messages","item":[{"name":"Send a message and optionally create the conversation","request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Idempotency-Key","value":"{{idempotencyKey}}","type":"text","description":"Use a stable value when retrying the same non-streaming POST request."},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/messages","host":["{{baseUrl}}"],"path":["v1","messages"]},"description":"Creates the conversation when `conversation_id` is omitted, sends the user message, and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Reusing the same key with a different request body returns `409 idempotency_conflict`.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- The first event is `public_api_conversation`, followed by upstream token events, and then `public_api_complete`.","body":{"mode":"raw","raw":"{\n  \"message\": \"What are FHA gift fund rules?\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\",\n    \"email\": \"user@example.com\",\n    \"name\": \"Test User\"\n  },\n  \"conversation\": {\n    \"title\": \"FHA gift funds\",\n    \"metadata\": {\n      \"external_ticket_id\": \"ticket_789\"\n    }\n  },\n  \"metadata\": {\n    \"channel\": \"crm\"\n  }\n}","options":{"raw":{"language":"json"}}}},"response":[{"name":"200 application/json","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Idempotency-Key","value":"{{idempotencyKey}}","type":"text","description":"Use a stable value when retrying the same non-streaming POST request."},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/messages","host":["{{baseUrl}}"],"path":["v1","messages"]},"description":"Creates the conversation when `conversation_id` is omitted, sends the user message, and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Reusing the same key with a different request body returns `409 idempotency_conflict`.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- The first event is `public_api_conversation`, followed by upstream token events, and then `public_api_complete`.","body":{"mode":"raw","raw":"{\n  \"message\": \"What are FHA gift fund rules?\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\",\n    \"email\": \"user@example.com\",\n    \"name\": \"Test User\"\n  },\n  \"conversation\": {\n    \"title\": \"FHA gift funds\",\n    \"metadata\": {\n      \"external_ticket_id\": \"ticket_789\"\n    }\n  },\n  \"metadata\": {\n    \"channel\": \"crm\"\n  }\n}","options":{"raw":{"language":"json"}}}},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":"{\n  \"request_id\": \"req_9b8f0b5fcb5b4eaa\",\n  \"conversation_id\": \"conv_3c2fd2bcf41f4f12\",\n  \"conversation_created\": true,\n  \"message_id\": \"msg_1fecc99b7f334e6c\",\n  \"response\": \"Gift funds are generally allowed with documentation.\",\n  \"citations\": [\n    {\n      \"documentId\": \"doc_1\"\n    }\n  ],\n  \"sources\": [\n    {\n      \"url\": \"https://selling-guide.fanniemae.com/\",\n      \"title\": \"Fannie Mae Selling Guide\"\n    }\n  ],\n  \"metadata\": {\n    \"tokens_used\": 123\n  }\n}"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","const contentType = pm.response.headers.get(\"Content-Type\") || \"\";","if (contentType.includes(\"application/json\")) {","  try {","    const data = pm.response.json();","    if (data.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation_id);","    if (data.conversation && data.conversation.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation.conversation_id);","    if (data.message_id) pm.collectionVariables.set(\"messageId\", data.message_id);","  } catch (error) {}","}"]}}]},{"name":"Stream a first message","request":{"method":"POST","header":[{"key":"Accept","value":"text/event-stream","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/messages","host":["{{baseUrl}}"],"path":["v1","messages"]},"description":"Creates the conversation when `conversation_id` is omitted, sends the user message, and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Reusing the same key with a different request body returns `409 idempotency_conflict`.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- The first event is `public_api_conversation`, followed by upstream token events, and then `public_api_complete`.\n\nThis request sets `stream: true` and omits `Idempotency-Key` because streaming responses are not replayable.","body":{"mode":"raw","raw":"{\n  \"message\": \"Summarize FHA gift fund rules.\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\"\n  },\n  \"stream\": true\n}","options":{"raw":{"language":"json"}}}},"response":[{"name":"200 text/event-stream","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"text/event-stream","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/messages","host":["{{baseUrl}}"],"path":["v1","messages"]},"description":"Creates the conversation when `conversation_id` is omitted, sends the user message, and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Reusing the same key with a different request body returns `409 idempotency_conflict`.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- The first event is `public_api_conversation`, followed by upstream token events, and then `public_api_complete`.\n\nThis request sets `stream: true` and omits `Idempotency-Key` because streaming responses are not replayable.","body":{"mode":"raw","raw":"{\n  \"message\": \"Summarize FHA gift fund rules.\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\"\n  },\n  \"stream\": true\n}","options":{"raw":{"language":"json"}}}},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"text/event-stream","type":"text"}],"body":"data: {\"type\":\"public_api_conversation\",\"request_id\":\"req_9b8f0b5fcb5b4eaa\",\"conversation_id\":\"conv_3c2fd2bcf41f4f12\",\"conversation_created\":true}\n\ndata: {\"type\":\"content\",\"content\":\"Gift funds are generally allowed with \"}\n\ndata: {\"type\":\"content_postprocessed\",\"content\":\"Gift funds are generally allowed with documentation.\"}\n\ndata: {\"type\":\"complete\",\"metadata\":{\"tokensUsed\":123}}\n\ndata: {\"type\":\"public_api_complete\",\"request_id\":\"req_9b8f0b5fcb5b4eaa\",\"conversation_id\":\"conv_3c2fd2bcf41f4f12\",\"message_id\":\"msg_1fecc99b7f334e6c\"}\n"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","pm.test(\"Response is an SSE stream\", function () {","  pm.expect(pm.response.headers.get(\"Content-Type\") || \"\").to.include(\"text/event-stream\");","});"]}}]},{"name":"Send a message to an existing conversation","request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Idempotency-Key","value":"{{idempotencyKey}}","type":"text","description":"Use a stable value when retrying the same non-streaming POST request."},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}/messages","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}","messages"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Sends a user message to an existing conversation and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Matching retries replay the stored JSON response snapshot.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- Existing-conversation streams omit the leading `public_api_conversation` event and always finish with `public_api_complete`.","body":{"mode":"raw","raw":"{\n  \"message\": \"What documentation is required?\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\"\n  }\n}","options":{"raw":{"language":"json"}}}},"response":[{"name":"200 application/json","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Idempotency-Key","value":"{{idempotencyKey}}","type":"text","description":"Use a stable value when retrying the same non-streaming POST request."},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}/messages","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}","messages"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Sends a user message to an existing conversation and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Matching retries replay the stored JSON response snapshot.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- Existing-conversation streams omit the leading `public_api_conversation` event and always finish with `public_api_complete`.","body":{"mode":"raw","raw":"{\n  \"message\": \"What documentation is required?\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\"\n  }\n}","options":{"raw":{"language":"json"}}}},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":"{\n  \"request_id\": \"req_9b8f0b5fcb5b4eaa\",\n  \"conversation_id\": \"conv_3c2fd2bcf41f4f12\",\n  \"message_id\": \"msg_1fecc99b7f334e6c\",\n  \"response\": \"Gift funds are generally allowed with documentation.\",\n  \"citations\": [\n    {\n      \"documentId\": \"doc_1\"\n    }\n  ],\n  \"sources\": [\n    {\n      \"url\": \"https://selling-guide.fanniemae.com/\",\n      \"title\": \"Fannie Mae Selling Guide\"\n    }\n  ],\n  \"metadata\": {\n    \"tokens_used\": 123\n  }\n}"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","const contentType = pm.response.headers.get(\"Content-Type\") || \"\";","if (contentType.includes(\"application/json\")) {","  try {","    const data = pm.response.json();","    if (data.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation_id);","    if (data.conversation && data.conversation.conversation_id) pm.collectionVariables.set(\"conversationId\", data.conversation.conversation_id);","    if (data.message_id) pm.collectionVariables.set(\"messageId\", data.message_id);","  } catch (error) {}","}"]}}]},{"name":"Stream a message to an existing conversation","request":{"method":"POST","header":[{"key":"Accept","value":"text/event-stream","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}/messages","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}","messages"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Sends a user message to an existing conversation and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Matching retries replay the stored JSON response snapshot.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- Existing-conversation streams omit the leading `public_api_conversation` event and always finish with `public_api_complete`.\n\nThis request sets `stream: true` and omits `Idempotency-Key` because streaming responses are not replayable.","body":{"mode":"raw","raw":"{\n  \"message\": \"Summarize the documentation requirements for this conversation.\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\"\n  },\n  \"stream\": true\n}","options":{"raw":{"language":"json"}}}},"response":[{"name":"200 text/event-stream","originalRequest":{"method":"POST","header":[{"key":"Accept","value":"text/event-stream","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-API-Key","value":"{{apiKey}}","type":"text","disabled":true,"description":"Alternative to collection-level Bearer auth. Enable this header if you prefer X-API-Key authentication."}],"url":{"raw":"{{baseUrl}}/v1/conversations/{{conversationId}}/messages","host":["{{baseUrl}}"],"path":["v1","conversations","{{conversationId}}","messages"],"variable":[{"key":"conversationId","value":"{{conversationId}}","description":"Conversation identifier returned by the API."}]},"description":"Sends a user message to an existing conversation and returns the assistant response.\n\nRequired scopes: `chat:write`\n\nIdempotency:\n- `Idempotency-Key` is supported only for non-streaming requests.\n- Matching retries replay the stored JSON response snapshot.\n\nStreaming:\n- When `stream: true`, the response content type becomes `text/event-stream`.\n- Existing-conversation streams omit the leading `public_api_conversation` event and always finish with `public_api_complete`.\n\nThis request sets `stream: true` and omits `Idempotency-Key` because streaming responses are not replayable.","body":{"mode":"raw","raw":"{\n  \"message\": \"Summarize the documentation requirements for this conversation.\",\n  \"user\": {\n    \"external_user_id\": \"{{externalUserId}}\"\n  },\n  \"stream\": true\n}","options":{"raw":{"language":"json"}}}},"status":"OK","code":200,"header":[{"key":"Content-Type","value":"text/event-stream","type":"text"}],"body":"data: {\"type\":\"content\",\"content\":\"The conversation can continue using the existing ID.\"}\n\ndata: {\"type\":\"complete\",\"metadata\":{\"tokensUsed\":88}}\n\ndata: {\"type\":\"public_api_complete\",\"request_id\":\"req_9b8f0b5fcb5b4eaa\",\"conversation_id\":\"conv_3c2fd2bcf41f4f12\",\"message_id\":\"msg_1fecc99b7f334e6c\"}\n"}],"event":[{"listen":"test","script":{"type":"text/javascript","exec":["const expectedStatusCodes = [200];","pm.test(\"Status code is expected\", function () {","  pm.expect(expectedStatusCodes).to.include(pm.response.code);","});","pm.test(\"Response is an SSE stream\", function () {","  pm.expect(pm.response.headers.get(\"Content-Type\") || \"\").to.include(\"text/event-stream\");","});"]}}]}]}]}