πŸ’»API

An alternative to our SDK - for submitting custom attributes to new or existing customers.

What can you use the Mava API for?

  1. Custom Attributes: You can use the Mava API to push user attributes to Mava via the identify endpoint. This offers similar functionality to the web chat SDK but can be used with all integration options and enables you to push data from third-party systems, such as your database, into Mava.

  2. Status Updates: You can use the API to update ticket statuses, for example to close them.

  3. Ticket Updates: You can use the API to update tickets, for example adding a tag or category.

  4. Messages & Private Notes: You can use the API to send messages or add private notes to tickets.

  5. Fetch Tickets: You can use the API to collect all ticket data

Getting Started

Head over to the API sectionarrow-up-right within the Mava dashboard and create an API key.

Please note: If you send no customer ID, a customer will be created for you and a new customer ID sent back which should be stored and used for subsequent calls to update that same customer.

CURL

curl -X POST https://gateway.mava.app/api/identify \
  -H "Content-Type: application/json" \
  -d '{
    "emailAddress": "",
    "mavaCustomerId": "",
    "customAttributes": [
      {
        "label": "exampleLabel",
        "value": "exampleValue"
      }
    ]
  }'

NodeJS

Schema

API Endpoints

1. Get Categories

Retrieves a list of all active categories for the authenticated client.

Endpoint

Authentication

  • Requires API token authentication

  • Subject to rate limiting

Response

Success (200 OK)

Error (500 Internal Server Error)

2. Update Ticket

Updates a ticket's status, priority, and/or category.

Endpoint

Authentication

  • Requires API token authentication

  • Subject to rate limiting

Request Body

Field
Type
Required
Description

ticketId

string

Yes

The unique identifier of the ticket

status

string

No

New ticket status

priority

number

No

New priority level

categoryId

string

No

ID of the category to assign

Valid Values

  • Status: "Open", "Resolved", "Pending", "Waiting"

  • Priority: 1, 2, 3

  • CategoryId: Must be a valid category ID from GET /categories

Response

Success (200 OK)

Error Responses

Ticket not found (400)

Invalid category (400)

Invalid status/priority (400)

Server error (500)

Behavior

  • Each change (status, priority, category) creates an audit log message

  • Changes are only made if the new value differs from the current value

  • Category must be active (not archived) and belong to the client

3. Send Message or Private Note

The send message endpoint allows you to send messages or private notes to existing tickets programmatically.

Endpoint

Authentication

  • Requires API token authentication

  • Subject to rate limiting

Behavior

You can send two types of messages:

  • External messages: visible to the customer and delivered through the ticket's integration channel (e.g. email, Discord, Telegram).

  • Internal notes: private messages only visible to your support team inside the Mava dashboard.

If no messageType is specified, the message defaults to an External Message.

Request Body

Field
Type
Required
Description

ticketId

string

Yes

The ID of the ticket to send the message to

content

string

No*

The text content of the message

messageType

string

No

The type of message to send. Accepted values: ExternalMessage, InternalNote. Defaults to ExternalMessage

attachments

array

No*

A list of file attachments to include with the message

attachments[].fileName

string

Yes (if attachments)

The display name of the file

attachments[].url

string

Yes (if attachments)

The publicly accessible URL of the file

attachments[].fileType

string

Yes (if attachments)

The MIME type of the file (e.g. image/png, application/pdf)

*Either content or attachments must be provided.

Valid Values

  • messageType: "ExternalMessage", "InternalNote" β€” Defaults to "ExternalMessage"

Response

Success (200)

Bad Request (400)

Returned when required fields are missing or the ticket is not found.

Unauthorized (401)

Returned when the API key is missing or invalid.

Too Many Requests (429)

Returned when the rate limit is exceeded. The API allows up to 90 requests per 30 seconds per API key.

Internal Server Error (500)

Code Examples

Curl

NodeJS

Schema

Sending an Internal Note

To send a message that is only visible internally to your team, set messageType to InternalNote:

4. Fetch Tickets

Retrieves a paginated list of tickets within a date range, with optional filters for status, assignee, category, tags, CSAT rating, and origin. Optionally includes the full message thread for each ticket.

Endpoint

Authentication

  • Requires API token authentication (x-auth-token header)

  • Subject to rate limiting (90 requests per 30 seconds)

Query Parameters

Parameter
Type
Required
Default
Description

startDate

string

Yes

β€”

Start of date range (ISO 8601, e.g. 2026-01-01 or 2026-01-01T00:00:00.000Z)

endDate

string

Yes

β€”

End of date range (exclusive). Must be after startDate. Max range: 1 year

limit

integer

No

50

Number of tickets per page (1–100)

skip

integer

No

0

Number of tickets to skip (for pagination)

status

string or string[]

No

β€”

Filter by status. Values: Open, Resolved, Pending, Waiting

assignedTo

string or string[]

No

β€”

Filter by agent ID(s). Use Unassigned for unassigned tickets

category

string or string[]

No

β€”

Filter by category ID(s)

tags

string or string[]

No

β€”

Filter by tag ID(s)

csatValues

string or string[]

No

β€”

Filter by CSAT rating. Values: 1–5 or no-rating

origin

string or string[]

No

β€”

Filter by ticket origin. Values: web, discord, telegram, telegram-group, email

sortBy

string

No

createdAt

Sort field. Values: createdAt, status, priority, sourceType, assignedTo, category, resolutionTime

sortOrder

string

No

desc

Sort direction: asc or desc

includeMessages

boolean

No

false

When true, includes the full message thread for each ticket

Response

Success (200 OK)

Response Fields

Field
Description

resolutionTime

Milliseconds between creation and resolution. null if not resolved

csat

Customer satisfaction rating (1-5). null if no rating or telegram-group ticket

aiStatus

AI handling status. null for telegram-group tickets

discordUsers

Discord usernames associated with the ticket. Empty for non-Discord tickets

customer

Customer details with custom attributes. null for telegram-group tickets

messages

Only included when includeMessages=true. Sorted oldest-first

messages[].senderType

customer, agent, or system

messages[].senderName

Discord username when available, otherwise null

pagination.hasMore

true if more tickets exist beyond the current page

Error Responses

Missing or invalid date range (400)

Returned when:

  • startDate or endDate is missing

  • Dates are not valid ISO 8601 format

  • endDate is before or equal to startDate

  • Date range exceeds 1 year

Invalid limit (400)

Returned when limit is not an integer between 1 and 100.

Invalid skip (400)

Returned when skip is negative.

Unsupported sort field (400)

Returned when sortBy is not one of the supported values.

Unsupported sort order (400)

Returned when sortOrder is not asc or desc.

Unauthorized (401)

Returned when the API key is missing or invalid.

Too Many Requests (429)

Returned when the rate limit is exceeded. The API allows up to 90 requests per 30 seconds per API key.

Internal Server Error (500)

Code Examples

Curl - Basic usage

Curl - With filters and messages

NodeJS - Basic usage

NodeJS - Paginate through all results

Filtering by multiple values

To filter by multiple values for the same parameter, repeat the parameter:

Pagination

Use skip and limit to paginate through results. The response includes pagination.hasMore to indicate whether more pages exist.

  1. Start with skip=0

  2. After each response, if hasMore is true, increase skip by limit

  3. Repeat until hasMore is false

The count field always reflects the total number of matching tickets across all pages.

Last updated