Smart Support REST API

The Smart Support REST API lets you connect Smart Support with external tools such as CRMs, automation platforms, import scripts, reporting tools, and custom applications.

Use this guide if you want to create, update, retrieve, or manage support tickets programmatically.

Overview

API namespace: smart-support/v1

Base URL:

https://example.com/wp-json/smart-support/v1

Replace https://example.com with your own WordPress site URL.

By default, the Smart Support REST API is protected and requires authentication. Public, unauthenticated ticket creation is not enabled by default and is not recommended unless your site also uses CAPTCHA, nonce validation, rate limiting, and anti-spam monitoring.

Enable the REST API

To enable the API:

  1. Log in to your WordPress admin area.
  2. Go to Smart Support → Settings → Advanced → API.
  3. Enable REST API.
  4. Create an API key.
  5. Copy and store the API key securely.

The API key is shown only once. Treat it like a password.

Authentication

The recommended authentication method is to send your API key in the following request header:

X-Smart-Support-API-Key: YOUR_API_KEY

Example:

curl "https://example.com/wp-json/smart-support/v1/ping" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

You may also use the following alternative header:

Authorization: Bearer YOUR_API_KEY

Content Type

For requests that send JSON data, include this header:

Content-Type: application/json

This is required for endpoints such as creating tickets, updating tickets, assigning agents, and adding replies.

Standard Response Format

All API endpoints return JSON.

A successful response uses this format:

{
  "success": true,
  "message": "Human readable message",
  "data": {},
  "meta": {}
}

An error response uses this format:

{
  "success": false,
  "code": "error_code",
  "message": "Human readable error message"
}

Common HTTP Status Codes

Status Code Meaning
200 OK
201 Created
400 Bad request or validation error
401 Missing or invalid API key
403 Authenticated, but not allowed
404 Resource not found
500 Server error

Available Endpoints

Health Check

GET /ping

Use this endpoint to confirm that the API is working. It returns the plugin version and server time.

Example:

curl "https://example.com/wp-json/smart-support/v1/ping" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Tickets

List Tickets

GET /tickets

Use this endpoint to retrieve a paginated list of tickets.

Optional query parameters:

Parameter Description
page Page number. Default: 1
per_page Number of tickets per page. Default: 20, maximum: 100
status Filter by ticket status
state Filter by ticket state
priority Filter by priority
department_id Filter by department ID
product_id Filter by product ID
agent_id Filter by assigned agent ID
user_id Filter by customer user ID
customer_email Filter by customer email
search Search subject, message, or ticket number
updated_after Return tickets updated after a specific MySQL datetime
orderby Sort field. Default: updated_at
order Sort direction: ASC or DESC. Default: DESC

Example:

curl "https://example.com/wp-json/smart-support/v1/tickets?page=1&per_page=20&status=open" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Example using updated_after:

curl "https://example.com/wp-json/smart-support/v1/tickets?updated_after=2026-05-07%2012:00:00" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Create a Ticket

POST /tickets

Use this endpoint to create a new support ticket.

Required JSON fields:

Field Description
email Customer email address
subject Ticket subject
message Ticket message

Optional JSON fields:

Field Description
name Customer name. Used if a new WordPress user must be created
priority Ticket priority: low, medium, high, or urgent
department_id Numeric department ID
department_slug Department slug
department Department ID string, slug, or exact department name
product_id Numeric product ID
agent_id Numeric agent ID
status Ticket status: new, open, closed, or delayed
state Ticket state. Defaults to opened

Example:

curl -X POST "https://example.com/wp-json/smart-support/v1/tickets" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{
    "name": "Customer Name",
    "email": "customer@example.com",
    "subject": "Payment issue",
    "message": "I paid but my order is still pending.",
    "department": "Billing",
    "priority": "high"
  }'

Department Matching Rules

When creating a ticket, the API checks department values in this order:

  1. department_id
  2. department_slug
  3. department

The department field can be:

  • A numeric department ID string
  • A department slug
  • An exact department name

If a department value is provided but does not match an existing department, the API returns a 400 error with allowed_departments.

Get Ticket Details

GET /tickets/{id}

Use this endpoint to retrieve details for a single ticket.

Example:

curl "https://example.com/wp-json/smart-support/v1/tickets/123" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Replace 123 with the ticket ID.

Update a Ticket

PATCH /tickets/{id}

Use this endpoint to update general ticket fields.

Allowed fields:

  • subject
  • status
  • state
  • priority
  • department_id
  • product_id
  • agent_id

Example:

curl -X PATCH "https://example.com/wp-json/smart-support/v1/tickets/123" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{ "priority": "urgent" }'

Update Ticket Status

PUT /tickets/{id}/status

PATCH /tickets/{id}/status

Use this endpoint to update only the ticket status.

Example body:

{
  "status": "closed"
}

Example:

curl -X PATCH "https://example.com/wp-json/smart-support/v1/tickets/123/status" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{ "status": "closed" }'

Update Ticket Priority

PUT /tickets/{id}/priority

PATCH /tickets/{id}/priority

Use this endpoint to update only the ticket priority.

Example body:

{
  "priority": "high"
}

Example:

curl -X PATCH "https://example.com/wp-json/smart-support/v1/tickets/123/priority" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{ "priority": "high" }'

Assign a Ticket to an Agent

PUT /tickets/{id}/assign

PATCH /tickets/{id}/assign

Use this endpoint to assign a ticket to a Smart Support agent.

Example body:

{
  "agent_id": 25
}

Example:

curl -X PATCH "https://example.com/wp-json/smart-support/v1/tickets/123/assign" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{ "agent_id": 25 }'

The assigned user must be a valid Smart Support agent, supervisor, or administrator.

Close a Ticket

POST /tickets/{id}/close

Use this endpoint to close a ticket.

Example:

curl -X POST "https://example.com/wp-json/smart-support/v1/tickets/123/close" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Reopen a Ticket

POST /tickets/{id}/reopen

Use this endpoint to reopen a closed ticket.

Example:

curl -X POST "https://example.com/wp-json/smart-support/v1/tickets/123/reopen" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Replies

List Ticket Replies

GET /tickets/{id}/replies

Use this endpoint to retrieve replies for a ticket.

Optional query parameter:

Parameter Description
include_internal Include internal notes. Default: false

Example:

curl "https://example.com/wp-json/smart-support/v1/tickets/123/replies" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Example including internal replies:

curl "https://example.com/wp-json/smart-support/v1/tickets/123/replies?include_internal=true" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

Internal replies are excluded by default unless the caller is authorized to view them.

Add a Reply

POST /tickets/{id}/replies

Alias:

POST /tickets/{id}/reply

Use this endpoint to add a reply to a ticket.

Required field:

Field Description
message Reply message

Author fields:

Field Description
user_id Required unless author_email is provided
author_email Used to resolve the user ID
author_type Either agent or customer
is_internal Whether the reply is an internal note

When author_type is set to customer, is_internal is automatically forced to false.

Example:

curl -X POST "https://example.com/wp-json/smart-support/v1/tickets/123/reply" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{
    "message": "Thanks — we are looking into this.",
    "author_email": "agent@example.com",
    "author_type": "agent"
  }'

Example internal note:

curl -X POST "https://example.com/wp-json/smart-support/v1/tickets/123/replies" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{
    "message": "Internal note for support team only.",
    "author_email": "agent@example.com",
    "author_type": "agent",
    "is_internal": true
  }'

Customer Lookups

List Tickets for a Customer

GET /customers/{email}/tickets

Use this endpoint to list tickets for a specific customer email address.

The email address should be URL encoded.

Example:

curl "https://example.com/wp-json/smart-support/v1/customers/customer%40example.com/tickets?page=1&per_page=20" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY"

In the example above, customer%40example.com is the URL-encoded version of customer@example.com.

Permissions and Privacy

API access depends on the authentication method used.

When using API keys, access is controlled by the key’s scopes.

When using WordPress-authenticated requests, Smart Support capability checks apply. These may include admin permissions, agent permissions, or customer ownership rules.

Internal replies are excluded by default. They are only returned when include_internal=true and the caller has permission to view internal notes.

Endpoint Summary

Method Endpoint Description
GET /ping Check API health
GET /tickets List tickets
POST /tickets Create ticket
GET /tickets/{id} Get ticket details
PATCH /tickets/{id} Update ticket
PUT/PATCH /tickets/{id}/status Update ticket status
PUT/PATCH /tickets/{id}/priority Update ticket priority
PUT/PATCH /tickets/{id}/assign Assign ticket to agent
POST /tickets/{id}/close Close ticket
POST /tickets/{id}/reopen Reopen ticket
GET /tickets/{id}/replies List ticket replies
POST /tickets/{id}/replies Add ticket reply
POST /tickets/{id}/reply Add ticket reply alias
GET /customers/{email}/tickets List tickets for a customer

Security Recommendations

For production use:

  • Keep your API key private.
  • Do not expose API keys in frontend JavaScript.
  • Use HTTPS for all API requests.
  • Rotate keys if they are exposed.
  • Use limited API key scopes where possible.
  • Avoid enabling unauthenticated public ticket creation unless you have anti-spam protections in place.
  • Monitor API usage for suspicious activity.

Quick Example: Create a Ticket

curl -X POST "https://example.com/wp-json/smart-support/v1/tickets" \
  -H "Content-Type: application/json" \
  -H "X-Smart-Support-API-Key: YOUR_API_KEY" \
  -d '{
    "name": "Jane Customer",
    "email": "jane@example.com",
    "subject": "Unable to access my account",
    "message": "I cannot log in after resetting my password.",
    "department": "Support",
    "priority": "medium"
  }'

This creates a new Smart Support ticket for jane@example.com in the Support department with medium priority.