πŸ’»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. Creating Tickets: creating tickets is coming soon

We're expanding our API so if you're looking to build more with the Mava API please send us a message or book a feedback callarrow-up-right.

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:

Last updated