Mava Docs
  • 👋Introducing Mava
    • Book a demo
    • What is Mava?
  • 🟢Getting Started
    • Create a free account
    • Integration Setup
      • Web Chat Setup
        • Automatically capture custom user data (SDK)
        • Automatically open the web chat on page load
        • Create custom launch event
        • Hide web chat icon
        • Delay script load
        • Customize the position & Size of the Web chat
      • Discord Setup
        • Discord Ticket Setup
        • Discord Public Channel AI Setup
        • Changing the Discord Bot Name
        • Automatically add users or all users with a role into a Discord private thread
        • Responding to tickets within Discord
        • Discord Thread Limits & Archiving
      • Telegram Setup
        • Telegram Group Ticketing
      • Email Setup
        • Email Forwarding
        • Custom Email Domains
    • Inviting Team Members
      • Transferring account ownership
      • Existing Wallet User - How To Verify Your Email
    • Linking your Discord Profile to Mava
    • Chatbot Builder
    • Attributes
  • 🔄Ticket Automations
  • 🤖AI Support
    • AI Training
    • Private Support Ticket AI
    • Public Discord Channel AI
    • Public Telegram Group AI
    • Public Slack AI Channel
  • 🔗Webhooks & API
    • 🪝Webhooks
      • 📋Schemas
      • 🔐 Webhook Security Guide
      • 📩Deliverability
    • 💻API
    • No-Code Integrations
  • 📥The Support Inbox
    • Inbox Keyboard Shortcuts
    • Ticket Status
    • How to create a custom inbox view
    • How to copy a user's Telegram/Discord ID or email address
    • Tags
    • Changing your team's workspace name
  • 🎟️Ticket Behavior & Settings
    • How to open a ticket in Discord
    • Spam & Ticket limits
    • Auto-Resolve Tickets
    • Re-opening Resolved Tickets
    • Discord Threads & Limits
    • Discord Ticket Transcripts
  • 🔔Notifications
    • Personal Notifications
    • Team Notifications
  • 💲Price Plans
    • Pricing FAQs
  • 💸Affiliate Program
  • 📱Using Mava on Mobile
  • 🔐Data Protection & Security
  • ✅Going Live Checklist
  • ⚠️Workspace Account Deletion
Powered by GitBook
On this page
  • What can you use the Mava API for?
  • Getting Started
  • API Endpoints
  • 1. Get Categories
  • 2. Update Ticket

Was this helpful?

  1. Webhooks & API

API

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

PreviousDeliverabilityNextNo-Code Integrations

Last updated 5 months ago

Was this helpful?

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 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. Private Notes: You can use the API to add private notes to tickets.

  5. Messages: sending messages via API is coming soon.

  6. 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 .

Getting Started

Head over to the 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

fetch('https://gateway.mava.app/api/identify', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-auth-token': 'YOUR_AUTH_TOKEN_HERE'
  },
  body: JSON.stringify({
    emailAddress: '', 
    mavaCustomerId: '',
    customAttributes: [
      {
        label: 'exampleLabel',
        value: 'exampleValue'
      }
    ]
  })
})
.then(response => response.json())
.then(data => console.log(data))
.catch((error) => console.error('Error:', error));

Schema

{
  "type": "object",
  "properties": {
    "emailAddress": {
      "type": "string"
    },
    "plaformUserId": {
      "type": "string"
    },
    "mavaCustomerId": {
      "type": "string"
    },
    "customAttributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": ["label", "value"]
      }
    }
  }
}

API Endpoints

1. Get Categories

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

Endpoint

GET /api/categories

Authentication

  • Requires API token authentication

  • Subject to rate limiting

Response

Success (200 OK)

{
  "categories": [
    {
      "_id": "string",
      "name": "string"
    }
  ]
}

Error (500 Internal Server Error)

{
  "error": "Internal server error"
}

2. Update Ticket

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

Endpoint

PUT /api/ticket

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)

{
  "message": "Ticket updated"
}

Error Responses

Ticket not found (400)

{
  "error": "Ticket not found"
}

Invalid category (400)

{
  "error": "Category not found"
}

Invalid status/priority (400)

{
  "error": "Invalid status or priority"
}

Server error (500)

{
  "error": "Internal server error"
}

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

🔗
💻
SDK
book a feedback call
API section