Web msg participant attrs missing in architect data action

can anyone clarify why participant attributes set via web messaging are not populating in the inbound message flow data action? the docs state that “attributes are available in the participant object” but my json payload returns null for custom fields. tried using the getrestproxy snippet to fetch them directly but getting 401 unauthorized on the internal api call.

I typically get around this by ensuring the Web Messaging SDK explicitly pushes the attributes to the Genesys Cloud backend before the data action executes. The 401 error you are seeing in getrestproxy is a classic symptom of the server-side context lacking a valid access token, as the internal API call does not inherit the client-side session.

Error: 401 Unauthorized - Access token missing or invalid for internal API call

To fix this, update your frontend code to use the setParticipantAttributes method from the Genesys Cloud Web Messaging SDK. This ensures the attributes are persisted on the server and available to Architect.

import { GcWebMessagingClient } from '@genesyscloud/web-messaging-sdk';

const client = new GcWebMessagingClient({
 orgGuid: 'YOUR_ORG_GUID',
 deploymentGuid: 'YOUR_DEPLOYMENT_GUID'
});

await client.conversation.setParticipantAttributes({
 attributes: {
 customField1: 'value1',
 customField2: 'value2'
 }
});

Once the SDK call completes, trigger your data action. The attributes will now populate correctly in the participant.attributes object within Architect. Avoid using getrestproxy for this scenario as it introduces unnecessary latency and authentication complexity.

The best way to fix this is to bypass the REST proxy and inject the token directly into the request header.

{
 "headers": {
 "Authorization": "Bearer {{ $.context.token }}"
 }
}

The 401 occurs because the proxy action does not inherit the flow’s OAuth context by default.

Make sure you are not relying on the getrestproxy action to fetch participant data during the initial conversation start, as the token context is often incomplete at that stage.

“can anyone clarify why participant attributes set via web messaging are not populating in the inbound message flow data action? the docs state that “attributes are available in the participant object” but my json payload returns null for custom fields. tried using the getrestproxy snippet to fetch them directly but getting 401 unauthorized on the internal api call.”

The 401 error in getrestproxy happens because the action does not automatically inherit the OAuth token from the flow context unless explicitly configured. However, fetching attributes via REST is inefficient if they are already available in the conversation object. The real issue is likely a timing mismatch or incorrect path traversal in your data action.

Participant attributes are nested under participants[].attributes. If you are querying the root level, you will get null. Ensure your data action uses the correct path. Here is the correct JSON structure for a Get Conversation action in Architect:

{
 "path": "participants[0].attributes.customField",
 "type": "conversation"
}

If you still need to fetch via API (e.g., for historical data), you must pass the token explicitly. In an Azure Function webhook consumer, I handle this by extracting the token from the X-Genesys-Auth-Token header if present, or using a Managed Identity to acquire a fresh token for the https://api.mypurecloud.com resource.

For the Architect flow, update your getrestproxy configuration to include the token:

{
 "uri": "https://api.mypurecloud.com/api/v2/conversations/webmsg/{conversationId}/participants",
 "headers": {
 "Authorization": "Bearer {{ $.context.token }}"
 },
 "method": "GET"
}

Check if $.context.token is null in your debug logs. If it is, the flow has not yet established the authenticated session. You may need to add a “Set Variable” action to capture the token earlier in the flow or ensure the conversation has fully initialized before accessing these fields.

It depends, but generally…

Hey there. You are definitely running into a context mismatch. The suggestion above about injecting the token is correct for the 401, but it misses the root cause of why the attributes are null in the first place.

Web Messaging participant attributes are not immediately available in the standard $.conversation.participants object during the initial conversation:created or conversation:updated events if they were set via the client SDK after the conversation started. The Architect data action often executes before the backend has fully synced those dynamic custom fields from the Web Messaging channel.

The getrestproxy failing with 401 is because the internal server-to-server call does not automatically inherit the flow’s OAuth token. You need to explicitly pass the token from the flow context. However, even with the token, if you query /api/v2/conversations/messages/{conversationId}/participants, you might still get stale data if the sync hasn’t completed.

Here is how I handle this in my Express webhook middleware to ensure I have the latest state before triggering downstream logic:

const axios = require('axios');
const { platformClient } = require('genesys-cloud-purecloud-platform-client');

async function fetchParticipantAttrs(conversationId, flowToken) {
 try {
 // Use the flow token for the internal API call
 const response = await axios.get(
 `https://api.mypurecloud.com/api/v2/conversations/messages/${conversationId}/participants`,
 {
 headers: {
 Authorization: `Bearer ${flowToken}`,
 'Content-Type': 'application/json'
 }
 }
 );
 
 // Filter for the specific participant and custom attrs
 const webParticipant = response.data.find(p => p.channelType === 'webchat');
 return webParticipant ? webParticipant.customAttributes : {};
 } catch (error) {
 console.error('Failed to fetch attrs:', error.response?.status);
 return {};
 }
}

If you are doing this strictly inside Architect, you need to add a small delay or a loop checking for the attribute existence before your data action runs. The 401 is just a symptom of missing auth context; the null values are a symptom of timing. Check your event sequence.