API Reference

Use the Marseil AI REST API for custom integrations

API Reference

If you need a custom integration, you can use our chat API. You need the API key for that. Get it from the Settings tab in your project. If no key exists, click Generate and copy it.

Warning: Do not expose your API keys and tokens in the frontend. Use a backend service to proxy your API calls.

Parameters

ParameterTypeDescriptionRequired
projectIdstringFrom the Settings page under API sectionYes
questionstringThe question you want to askYes
conversationIdstringChat ID to have a continuous conversationNo
userIdstringIdentify users with email or unique ID (visible in chat history)No
additionalDetailsjsonCustom fields like email, name, and other IDsNo

Example Request

fetch('https://app.marseil.ai/api/v1/chat', {
  method: 'POST',
  body: JSON.stringify({
    projectId: '<project_id>',
    question: '<your_question>'
  }),
  headers: {
    'Authorization': 'Bearer <api_key>',
    'Content-Type': 'application/json'
  }
})

Success Response

{
  "tokens": 724,
  "answer": "The answer to your question",
  "sources": "https://marseil.ai/pricing,https://marseil.ai/analytics",
  "limitReached": false,
  "conversationId": "clgyrh8vm0003u1kix801l4qz"
}

Error Responses

Invalid projectId:

{ "message": "project not found" }

Invalid Bearer token:

{ "message": "unauthourised request" }

Invalid request body:

{ "message": "Something happened! Please check your data validity or contact help" }

Contact Support@Marseil.ai if you believe there is a server issue.


Export Conversations

Retrieve all conversations for a project as a CSV file. Useful for analysis, reporting, and backup.

GET /api/v1/conversations

ParameterTypeDescriptionRequired
projectIdstringFrom the Settings page under API sectionYes
orgIdstringYour organization IDYes

Example Request

fetch('https://app.marseil.ai/api/v1/conversations?projectId=<project_id>&orgId=<org_id>', {
  headers: {
    'Authorization': 'Bearer <api_key>'
  }
})

The response is a CSV file download with the following columns:

ColumnDescription
Conversation IDUnique conversation identifier
DateISO 8601 timestamp
SourceDASHBOARD, WIDGET, SLACK, or API
Visitor EmailUser email or ID (from userId field)
RatingPOSITIVE, NEGATIVE, or NEUTRAL
SummaryAI-generated conversation summary
Message Roleuser or assistant
MessageThe message content
Feedbackpositive, negative, or empty

Each conversation produces one row per message. The server streams the CSV in batches of 100 conversations to avoid overloading, so large datasets are handled efficiently.

Example Response

Conversation ID,Date,Source,Visitor Email,Rating,Summary,Message Role,Message,Feedback
clgyrh8vm0003u1kix801l4qz,2026-07-13T10:30:00.000Z,WIDGET,user@example.com,POSITIVE,User asked about pricing,user,How much does the pro plan cost?,
clgyrh8vm0003u1kix801l4qz,2026-07-13T10:30:00.000Z,WIDGET,user@example.com,POSITIVE,User asked about pricing,assistant,The pro plan is $49/month.,

Error Responses

Missing projectId or orgId:

{ "message": "projectId is required" }

Unauthorized:

{ "message": "Unauthorized" }