General Topic status mismatch on /api/v2/speechandtextanalytics/topics/general/status

400 Bad Request on a GET call to /api/v2/speechandtextanalytics/topics/general/status. The dialect query parameter is set to en-US but it’s returning a malformed response when the TOPIC_STATUS is set to PENDING for specific entries.

It’s making the dashboard flicker because the status field is returning null instead of a string. This is killing the reporting for our general topics.

const response = await platformClient.speechAndTextAnalytics.getGeneralTopicsStatus('en-US');
console.log(response.entities); // returns [ { "name": "Topic1", "status": null } ]

This usually happens because the system hasn’t finished processing the topic for that specific dialect. When status is PENDING, the object isn’t fully populated yet. It’s a known quirk where the API doesn’t return a placeholder string, just null.

A 400 on a GET is strange. Usually, it’s a 200 with null values. If it’s actually a 400, check if the dialect string is exactly en-US. Even a small trailing space in the query param can trigger this.

To stop the dashboard flickering, don’t rely only on the status endpoint. Try fetching the full topic details to see if the state is updated there:

curl -X GET "https://api.mypurecloud.com/api/v2/speechandtextanalytics/topics?dialects=en-US" \
-H "Authorization: Bearer YOUR_TOKEN"

If you’re using a custom trigger in Zapier or a script, add a filter to ignore any entries where the status is null. We did this for a similar sync and it took like 2 hrs to figure out the nulls were causing the crashes.

edit: check if the dialect is actually supported by calling /api/v2/speechandtextanalytics/topics/dialects first. If the dialect isn’t active, the status call can behave unpredictably.

1 Like

Yeah, that’s exactly it. In CIC we used to just have static reporting tables where the data was either there or it wasn’t, so this kind of “pending” null state is a bit weird.

Try adding a simple check for nulls in the dashboard logic before it hits the UI. If the status is null, just force it to display “Processing” so it doesn’t flicker.

1 Like
# Simple Python check to prevent dashboard flicker
# Using the Genesys Cloud Python SDK
import purecloudplatformclient

# Assume api is already authenticated
try:
 response = api.speech_and_text_analytics.get_general_topics_status(dialect='en-US')
 # Map nulls to 'Pending' or 'Unknown' before sending to the UI
 sanitized_data = [
 {**item, 'status': item.get('status') if item.get('status') is not None else 'PENDING'}
 for item in response
 ]
except Exception as e:
 print(f"Error fetching status: {e}")

Handling Null Status States

We’ve run into a similar pattern with our healthcare reporting dashboards where the API returns null during the processing window. It’s a bit of a pain because the frontend usually expects a string and just crashes or flickers when it hits a null value.

Recommended Workarounds

  1. Data Normalization: Don’t pass the raw API response directly to your dashboard. Use a middleware layer or a simple map function to coerce null values into a string like "PENDING".
  2. Retry Logic: If the status is null, implement a short back-off timer before the next poll. FWIW, polling every 30 seconds usually avoids the flicker once the processing job completes.
  3. Validation: Check if the specific topic ID is actually active via /api/v2/speechandtextanalytics/topics/{topicId} to see if the issue is a transient state or a config error.

YMMV depending on the volume of topics you’re tracking, but the mapping approach is the most stable. Are you seeing this across all en-US topics or just a few specific ones?

Our current environment is a multi-tier IVR hosted on Genesys Cloud in the London region.

[API REQUEST] → [TOPIC_STATUS: PENDING] → [RESPONSE: NULL]
|
v
[LOGIC: NULL CHECK] → [UI: PLACEHOLDER]

const status = response.data.status || 'Processing';

The behavior mentioned in the earlier reply is common. It’s more reliable to handle the NULL value within the DATA ACTION or frontend logic to avoid the flicker.