kustomer-client
    Preparing search index...

    Function createMessageFromConversation

    • Create message from conversation Creates a new message from a conversation.

      The new message created by the endpoint will be associated with the same customer as the conversation.

      Any one of the following roles is required for this endpoint:

      Legacy Role Equivalent Permission Set Role
      org.user.message.write org.permission.message.create

      org.admin role is required for setting createdAt, createdBy, modifiedAt, and modifiedBy. Otherwise, the token automatically sets these attributes.

      Messages are subject to a rate limit. A single client can create up to 120 messages per minute per customer. Messages with importedAt in their body will not be subject to the rate limit.

      A 429 Too Many Requests response will be returned if the rate limit has been reached for a customer.

      Type Parameters

      • ThrowOnError extends boolean = true

      Returns RequestResult<
          {
              data: {
                  attributes: {
                      app: string;
                      channel: string;
                      createdAt: string;
                      direction: string;
                      meta: { [key: string]: unknown };
                      modifiedAt: string;
                      sentAt: string;
                      size: number;
                      status: string;
                      updatedAt: string;
                  };
                  id: string;
                  links: { self: string };
                  relationships: {
                      conversation: {
                          data: { id: string; type: string };
                          links: { self: string };
                      };
                      createdBy: {
                          data: { id: string; type: string };
                          links: { self: string };
                      };
                      customer: {
                          data: { id: string; type: string };
                          links: { self: string };
                      };
                      modifiedBy: {
                          data: { id: string; type: string };
                          links: { self: string };
                      };
                      org: { data: { id: string; type: string }; links: { self: string } };
                  };
                  type: string;
              };
          },
          unknown,
          ThrowOnError,
      >