Ticket predictions deliver data for a given ticket from a variety of ML models.

These predictions provide additional data using machine learning to enrich a ticket with important metadata such as written language or intent so that they can be routed more effectively.

Note: Support for the Ticket Predictions API has been placed on hold and the EAP has been closed for the time being. If you are actively using or have signed up for this EAP, we will be contacting you with next steps. For anyone else interested in adding predictive intents and language prediction to your customer interactions, please consider the Automated Triage EAP to see if that fits your requirements.

Making predictions

Predictions are made automatically when a ticket is created. Its relevant information is sent to various ML models for evaluation. The results are surfaced with this API.

Prediction Data Availability

There will be a slight delay from when the ticket is created until the prediction data is available. Similarly, data from each prediction type may become available at different rates.

Supported Prediction Types

Language Detection

Language predictions determine what language the ticket was written.

Intent Detection

Intent predictions detect the ticket's problem category. It answers the question, What problem(s) is this ticket trying to solve?

JSON Format

Predictions are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
predictions array true true The prediction set
ticket_id string true true The ticket's identifier

This object contains the set of predictions for a given ticket.

Example

{  "predictions": [    {      "id": "ABC123",      "prediction_data": {        "prediction": [          {            "language_code": "en",            "score": 0.9754506349563599          },          {            "language_code": "hu",            "score": 0.2410602867603302          },          {            "language_code": "eo",            "score": 0.2256614863872528          }        ]      },      "prediction_type": "LANGUAGE"    },    {      "id": "123XYZ",      "prediction_data": {        "prediction": [          {            "name": "order__fulfilment__delivered",            "score": 0.9951220154762268          },          {            "name": "account__update__phone",            "score": 0.00007570574234705          }        ]      },      "prediction_type": "INTENT"    }  ],  "ticket_id": "42"}

List ML predictions for a ticket

  • GET /api/v2/tickets/{ticket_id}/predictions

This returns the prediction data for the specified ticket.

Note: Some predictions may not be accessible to users due to user permissions.

Allowed for

  • Agents

Parameters

Name Type In Required Description
ticket_id string Path true The ticket's id.

Using curl

curl https://{subdomain}.zendesk.com/api/v2/tickets/{ticket_id}/predictions -v -u {email_address}/token:{api_token}

Example Response(s)

200 OK
Status 200 OK
{  "predictions": [    {      "id": "2V89036SK4C9HKECHN00000000",      "prediction_data": {        "prediction": [          {            "language_code": "en",            "score": 0.55744404          },          {            "language_code": "fr",            "score": 0.08380914          },          {            "language_code": "ru",            "score": 0.05690828          }        ]      },      "prediction_type": "LANGUAGE"    },    {      "id": "2V89036E9S6CSKERHH00000000",      "prediction_data": {        "prediction": [          {            "name": "order__status__what_is_status",            "score": 0.2668222          },          {            "name": "billing__refund__request",            "score": 0.2589306          },          {            "name": "order__availability__stock",            "score": 0.2509685          }        ]      },      "prediction_type": "INTENT"    }  ],  "ticket_id": "850"}
400 Bad Request
Status 400 Bad Request
{  "errors": [    {      "code": "InvalidTicketId",      "status": "400",      "title": "Validation failed for ticketId : Value is not a valid number."    }  ]}
401 Unauthorized
Status 401 Unauthorized
{  "errors": [    {      "code": "Unauthorized",      "status": "401",      "title": "Unauthorized access"    }  ]}
403 Forbidden
Status 403 Forbidden
{  "errors": [    {      "code": "NotEnabled",      "status": "403",      "title": "This feature is not enabled for this account."    }  ]}
404 Not Found
Status 404 Not Found
{  "errors": [    {      "code": "NotFound",      "status": "404",      "title": "Could not find something"    }  ]}
500 Internal Server Error
Status 500 Internal Server Error
{  "errors": [    {      "code": "InternalServerError",      "status": "500",      "title": "Unknown error"    }  ]}
503 Service Unavailable
Status 503 Service Unavailable
{  "errors": [    {      "code": "ServiceUnavailable",      "status": "503",      "title": "Service unavailable"    }  ]}