> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# supportMessageAiFeedbackSet

> Rate a reply the AI agent wrote, as the thumbs up or down and the comment box under an AI reply in the help desk do. Rating a message again replaces its rating and comment. Returns the message, with `aiFeedback` set. Null when no message on a ticket the inbox shows has this id, or the AI agent didn't write it. Throws a 400 BAD_USER_INPUT error when the comment is too long.

**Required scopes:** [`support_tickets_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_write)

## Arguments

**id** `ID!` *required*

The `id` of a message whose `authorType` is AI\_AGENT.

**input** `[SupportMessageAiFeedbackSetInput!](/docs/api-reference/v3/reference/support/support-message-ai-feedback-set-input)` *required*

The rating.

**fields**

**comment** `String`

What was good or could be improved, at most 65536 characters. Leave it out, or send an empty string, for none; that clears an earlier comment.

**rating** `[MessageAiFeedbackRating!](/docs/api-reference/v3/reference/support/message-ai-feedback-rating)` *required*

Whether the response was good or bad.

## Returns

**supportMessageAiFeedbackSet** `[Message](/docs/api-reference/v3/reference/support/message)`

One message, on one channel. Each channel's messages are their own type, with the fields only that channel has.

**fields**

**aiFeedback** `[MessageAiFeedback](/docs/api-reference/v3/reference/support/message-ai-feedback)`

The team's rating of this message. Null unless `authorType` is AI\_AGENT and someone has rated it.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**comment** `String`

What the team said about the response. Null when they left none.

**ratedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the message was last rated.

**rating** `[MessageAiFeedbackRating!](/docs/api-reference/v3/reference/support/message-ai-feedback-rating)` *required*

Whether the response was good or bad.

**aiLookups** `[SupportAiLookupTrace](/docs/api-reference/v3/reference/support/support-ai-lookup-trace)`

What the AI looked up (orders, products, knowledge, links) before this message, as the help desk shows it above the message: each lookup on the thread attaches to the first message after it that the customer didn't write. Null when nothing was looked up before it. A request reads its messages 100 at a time, for 10 points each time.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**steps** `[\[SupportAiLookupStep!\]!](/docs/api-reference/v3/reference/support/support-ai-lookup-step)` *required*

Each lookup, oldest first: at most the 200 newest before the message.

**fields**

**kind** `[SupportAiLookupKind!](/docs/api-reference/v3/reference/support/support-ai-lookup-kind)` *required*

What it looked up.

**knowledge** `[\[SupportAiLookupKnowledge!\]!](/docs/api-reference/v3/reference/support/support-ai-lookup-knowledge)` *required*

The knowledge entries the reply was given. Only the last knowledge step before a reply lists them; empty on the others. Readable with `support_tickets_read`, as the help desk shows them to anyone who can view the ticket; reading an entry as a `KnowledgeArticle` needs `commerce_agent_knowledge_read`.

**occurredAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the AI looked it up.

**query** `String`

What a knowledge or product search asked for. Null for other steps, and when it wasn't recorded.

**resultCount** `Int`

How many results a knowledge or product search returned. Null for other steps.

**url** `String`

The link the AI followed. Null unless the step followed one.

**attachments** `[\[MessageAttachment!\]](/docs/api-reference/v3/reference/support/message-attachment)`

The message's files, oldest first, as the help desk shows them, an email's inline images included. A removed file is left out, and so is one whose link can't be made right now. Empty when the message has none. Null, with an error, when they can't be read. A request reads its messages' files 100 messages at a time, for 10 points each time.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**contentId** `String`

The id an email's HTML uses to show this image, as `cid:` followed by it. Null unless `inline` is true.

**description** `String`

The file's name, as shown in the help desk. Null when none was saved; the help desk then shows it as Attachment.

**id** `ID!` *required*

The id of this attachment.

**inline** `Boolean!` *required*

Whether this is an image an email's HTML shows in its body, referenced as `cid:` followed by `contentId`. False for a regular file.

**mimeType** `String`

The file's MIME type, such as image/png. Null when it wasn't recorded.

**url** `String!` *required*

Download link. A file the store keeps private gets a signed link that works for about one hour after the read; read the message again for a fresh one. Any other file's link doesn't expire.

**authorType** `[MessageAuthorType!](/docs/api-reference/v3/reference/support/message-author-type)` *required*

Who wrote the message.

**channel** `[MessageChannel!](/docs/api-reference/v3/reference/support/message-channel)` *required*

The channel the message is on.

**content** `String`

The message as plain text. Null for a message with no text, such as an image.

**customer** `[Customer](/docs/api-reference/v3/reference/customers/customer)`

The customer who wrote it. Null unless `authorType` is CUSTOMER, and null when their record was deleted.

**Requires:** [`customers_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-customers_read)

**fields**

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the customer record was created.

**customFields** `[JSON](/docs/api-reference/v3/reference/common/json)`

Merchant-defined custom field values, keyed by each field's name. Null when the customer has no custom fields set.

**email** `String`

The customer's primary email address.

**events** `[CustomerEventConnection](/docs/api-reference/v3/pagination)`

What this shopper did, newest first: the events the help desk's ticket timeline shows for them, of every type unless `types` narrows it. Each read costs 10 points plus the page size; each `events` field in a query reserves 10 reads, and the request is refunded the ones it didn't make. A request can read the events of at most 10 customers, and past that this field errors with TOO\_MANY\_CUSTOMER\_EVENT\_READS. One customer read again with the same arguments is read once.

**Requires:** [`customers_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-customers_read)

**fields**

**Arguments**

**after** `String`

Read events older than this cursor, from `pageInfo.endCursor`.

**before** `String`

Read events newer than this cursor, from `pageInfo.startCursor`.

**first** `Int`

Page size reading older events (default 25, max 100).

**last** `Int`

Page size reading newer events (default 25, max 100).

**occurredAfter** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

Only events at or after this instant.

**occurredBefore** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

Only events before this instant.

**types** `[\[CustomerEventType!\]](/docs/api-reference/v3/reference/events/customer-event-type)`

Only events of these types. Omitted: every type, as the help desk's ticket timeline shows them. An empty list fails with INVALID\_FILTER.

**Fields**

**edges** `[\[CustomerEventEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** `[\[CustomerEvent!\]!](/docs/api-reference/v3/reference/events/customer-event)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**firstName** `String`

The customer's first name.

**id** `ID!` *required*

The id of this customer.

**lastName** `String`

The customer's last name.

**legacyId** `String!` *required*

The customer's legacy identifier (the source Mongo ObjectId), accepted anywhere an `id` is.

**location** `[CustomerLocation](/docs/api-reference/v3/reference/customers/customer-location)`

The customer's current location, if known.

**fields**

**city** `String`

The city, town, or village.

**country** `String`

The country name.

**countryCode** `String`

The country code.

**ianaTimeZoneName** `String`

The IANA time zone name for the location (e.g. America/New\_York).

**latitude** `Float`

The latitude of the location, if geocoded.

**longitude** `Float`

The longitude of the location, if geocoded.

**postalCode** `String`

The postal or ZIP code.

**state** `String`

The state, province, or region name.

**stateCode** `String`

The state, province, or region code.

**street1** `String`

The first line of the street address.

**street2** `String`

The second line of the street address.

**phoneNumber** `String`

The customer's primary phone number.

**subscriptions** `[\[CustomerSubscription!\]](/docs/api-reference/v3/reference/customers/customer-subscription)`

The customer's subscriptions in the store's subscription provider (Recharge), found by their email, as the help desk ticket sidebar lists them: active first, then expired, then canceled. Empty when the customer has no email or the store has no Recharge integration. Null, with an error, when Recharge can't be read for this customer; the sidebar shows none then. A request reads them for at most 10 customers, as each costs Recharge calls the store's sidebar and customer portal share; past that the field is null with BAD\_USER\_INPUT. Each customer costs 10 points.

**Requires:** [`subscriptions_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-subscriptions_read)

**fields**

**canceledAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When it was canceled. Null unless it is canceled.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When it was created in the provider.

**externalReference** `[ExternalReference!](/docs/api-reference/v3/reference/common/external-reference)` *required*

Its id in the subscription provider (provider recharge, type subscription), for opening it there.

**frequency** `[CustomerSubscriptionFrequency](/docs/api-reference/v3/reference/customers/customer-subscription-frequency)`

How often it delivers. Null when the provider has no schedule for it.

**id** `ID!` *required*

The id of this subscription.

**nextChargeDate** `[Date](/docs/api-reference/v3/reference/common/date)`

The day the next charge is scheduled, in the store's subscription provider. Null when none is scheduled, as for a canceled subscription. `customerSubscriptionSkip` takes this date.

**price** `[Money](/docs/api-reference/v3/reference/common/money)`

The price of one unit on each charge, in the subscription's currency. Null when the provider doesn't report the currency.

**product** `[CustomerSubscriptionProduct](/docs/api-reference/v3/reference/customers/customer-subscription-product)`

What it delivers. Null when the product isn't in the store's catalog.

**quantity** `Int!` *required*

How many units each delivery holds.

**shippingAddress** `[MailingAddress](/docs/api-reference/v3/reference/common/mailing-address)`

Where deliveries ship. `country` is null; read `countryCode`. Null when the provider has no address for it.

**status** `[CustomerSubscriptionStatus!](/docs/api-reference/v3/reference/customers/customer-subscription-status)` *required*

Whether it is active, canceled or expired.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the provider last changed it.

**supportTickets** `[SupportTicketConnection!](/docs/api-reference/v3/pagination)` *required*

The help desk tickets this customer is the primary contact on any thread of, newest first. Every ticket whose `customer` is this customer is here.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns tickets after it.

**before** `String`

Backward pagination cursor — returns tickets before it.

**first** `Int`

Forward pagination: returns the first N tickets (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N tickets (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**Fields**

**edges** `[\[SupportTicketEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** `[\[SupportTicket!\]!](/docs/api-reference/v3/reference/support/support-ticket)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**tags** `[CustomerTagConnection!](/docs/api-reference/v3/pagination)` *required*

The tags on this customer, from the store's customer tag catalog, A–Z by name.

**Requires:** [`customers_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-customers_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns tags after it.

**before** `String`

Backward pagination cursor — returns tags before it.

**first** `Int`

Forward pagination: returns the first N tags (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N tags (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**Fields**

**edges** `[\[CustomerTagEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** `[\[CustomerTag!\]!](/docs/api-reference/v3/reference/marketing/customer-tag)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the customer record was last updated.

**id** `ID!` *required*

The id of this message.

**inReplyTo** `[Message](/docs/api-reference/v3/reference/support/message)`

The message this one replies to. Null when it isn't a reply, or that message is hidden.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**sentAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the message was sent or received.

**teamMember** `[TeamMember](/docs/api-reference/v3/reference/common/team-member)`

The team member who wrote it. Null unless `authorType` is TEAM\_MEMBER, and null when they've left the team.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**email** `String`

Email address. Null when the user has none.

**id** `ID!` *required*

m\_us\_… id, the same id the app and MCP tools use.

**name** `String`

Display name. Null when the user hasn't set one.

**supportNotificationPreferences** `[SupportNotificationPreferences](/docs/api-reference/v3/reference/support/support-notification-preferences)`

Which help desk notifications the team member gets: what the help desk's notifier reads for them, with defaults for what they never saved. The same settings as the Notifications tab of their profile. Null when the user can't be read. A request reads its team members 100 at a time, for 10 points each time.

**Requires:** [`support_config_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_config_read)

**fields**

**playSoundOnDesktop** `Boolean!` *required*

Whether a browser notification plays a sound.

**preferences** `[\[SupportNotificationPreference!\]!](/docs/api-reference/v3/reference/support/support-notification-preference)` *required*

One entry for every platform and event, including ones the team member never changed, which read as their defaults.

**supportShiftStatus** `[SupportShiftStatus!](/docs/api-reference/v3/reference/support/support-shift-status)` *required*

The agent's live shift status, worked out when the request runs.

**Requires:** [`support_config_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_config_read)

**fields**

**manualOverride** `[SupportShiftOverride](/docs/api-reference/v3/reference/support/support-shift-override)`

The agent's manual on/off toggle. Null when they follow their schedule.

**nextChange** `[SupportShiftChange!](/docs/api-reference/v3/reference/support/support-shift-change)` *required*

The next time the schedule alone flips onShift. Ignores any manual override. Always in the future, or the next local midnight when nothing changes within 14 days.

**onShift** `Boolean!` *required*

True when auto-assignment can give the agent tickets now.

**reason** `[SupportShiftStatusReason!](/docs/api-reference/v3/reference/support/support-shift-status-reason)` *required*

Which layer decided onShift.

**supportWorkSchedule** `[SupportWorkSchedule!](/docs/api-reference/v3/reference/support/support-work-schedule)` *required*

The agent's support working hours. An agent with no saved schedule returns enabled false.

**Requires:** [`team_members_manage`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-team_members_manage)

**fields**

**assignableChannels** `[\[SupportChannel!\]](/docs/api-reference/v3/reference/support/support-channel)`

Channels the agent takes auto-assigned tickets on. Null means every channel.

**dateOverrides** `[\[SupportWorkScheduleDateOverride!\]!](/docs/api-reference/v3/reference/support/support-work-schedule-date-override)` *required*

Dates whose hours replace that day's weekly hours, earliest first.

**enabled** `Boolean!` *required*

Whether the schedule is on. When false, the agent counts as on shift at all times.

**timeZone** `String!` *required*

IANA time zone the hours are in, such as America/New\_York. The store's time zone when the agent has never saved a schedule.

**weeklyHours** `[\[SupportWorkScheduleDay!\]!](/docs/api-reference/v3/reference/support/support-work-schedule-day)` *required*

Recurring hours. Always seven entries, Monday through Sunday.

**thread** `[MessageThread](/docs/api-reference/v3/reference/support/message-thread)`

The thread the message is on. Null when the thread is on a channel the API doesn't expose.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**channel** `[MessageChannel!](/docs/api-reference/v3/reference/support/message-channel)` *required*

The channel the thread is on.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the thread started.

**id** `ID!` *required*

The id of this thread.

**messages** `[MessageConnection!](/docs/api-reference/v3/pagination)` *required*

Every message on the thread, oldest first, including internal notes. A thread can span several tickets, so this can hold messages no one ticket has.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns messages after it.

**before** `String`

Backward pagination cursor — returns messages before it.

**first** `Int`

Forward pagination: returns the first N messages (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N messages (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**Fields**

**edges** `[\[MessageEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** `[\[Message!\]!](/docs/api-reference/v3/reference/support/message)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**Possible types:** [`ChatMessage`](https://developers.redo.com/docs/api-reference/v3/reference/support/chat-message), [`ContactFormMessage`](https://developers.redo.com/docs/api-reference/v3/reference/support/contact-form-message), [`EmailMessage`](https://developers.redo.com/docs/api-reference/v3/reference/support/email-message), [`InternalNote`](https://developers.redo.com/docs/api-reference/v3/reference/support/internal-note), [`SmsMessage`](https://developers.redo.com/docs/api-reference/v3/reference/support/sms-message), [`SocialComment`](https://developers.redo.com/docs/api-reference/v3/reference/support/social-comment), [`SocialMessage`](https://developers.redo.com/docs/api-reference/v3/reference/support/social-message), [`VoiceMessage`](https://developers.redo.com/docs/api-reference/v3/reference/support/voice-message)

## Errors

Besides the [errors any request can return](https://developers.redo.com/docs/api-reference/v3/errors.md), this operation fails with these codes in `extensions.code`.

| Code | HTTP status | Meaning | Retry |
| - | - | - | - |
| `API_TOKEN_REQUIRED` | `403` | The credential has no API token to attribute the change to, such as a first-party token. Nothing was sent. | Call with a store API token. |
| `BAD_USER_INPUT` | `400` | An argument is invalid, or names something the store doesn't have. The message says which. Nothing was written. | Fix the input the message names, then send it again. |
| `INTERNAL_SERVER_ERROR` | `500` | Something failed on Redo's side. The change may or may not have been made. | Read the record to see whether the change was made before sending it again. A send with an idempotencyKey is safe to retry with the same key. |

## Example

```graphql theme={null}
mutation {
  supportMessageAiFeedbackSet(id: "...", input: { ... }) {
    authorType
    channel
    content
    id
    sentAt
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.