Notrus
Beta

Referência do schema

Todos os tipos, campos e argumentos da API de leitura da Notrus, gerados a partir do schema em produção.

tipo

Query

categories
[Category!]!

Active categories in the authenticated organization's classification catalog.

conversation
Conversation

Uma única conversa pelo seu id de conversa nativo da plataforma; nulo se não encontrada.

  • conversationIdString!— Seu id de conversa nativo da plataforma.
conversations
ConversationConnection!

Lista paginada de conversas da organização autenticada, das mais antigas para as mais recentes por padrão (veja `orderBy`).

  • afterString— Cursor opaco do `pageInfo.endCursor` de uma página anterior.
  • filterConversationFilter— Filtro booleano opcional sobre os tag-links das threads (retorna apenas as threads correspondentes), mais uma janela opcional e inclusiva de startDate/endDate sobre quando a conversa começou (nunca restringe as threads retornadas).
  • firstInt— Tamanho da página (limitado pelo servidor).
  • orderByConversationSortDirection— Direção de ordenação por quando cada conversa começou. Padrão ASC (mais antigas primeiro) — o comportamento histórico, inalterado a menos que você opte por DESC. Repita o mesmo valor em todas as páginas de uma mesma execução de paginação; cursores de `after` só são válidos combinados com a direção sob a qual foram emitidos.
conversationsCount
ConversationCount!

Total conversations matching the filter, without paginating — prefer this over walking every page of `conversations` just to count. Computing the total still requires scanning every matching conversation once (no way around that for an exact count), but skips hydrating and returning their threads/messages. Also returns a per-day breakdown within the date window, a per-category breakdown (thread-level), and, when `filter.should` has more than one clause, each clause's own contribution.

  • filterConversationCountFilter— Bool (must/should/mustNot) filter over thread tag-links, plus an optional inclusive startDate/endDate window over when the conversation started.
enum

CaseResolution

How a closed case ended.

  • NAO_RESOLVIDO— The customer request was not solved.
  • RESOLVIDO— The customer request was solved.
enum

CaseStatus

Status of an imported case.

  • ABERTO— Waiting for an agent in the queue.
  • AGENDADO— Follow-up scheduled.
  • ATENDIMENTO_HUMANO— With a human agent.
  • ENCERRADO— Closed. Requires `resolution`.
  • NOTRUS_ATENDIMENTO— Handled by the Notrus AI.
tipo

Category

A category from your classification catalog.

definition
String!

Description of when this category applies.

identifier
String!

Stable machine identifier of the category.

name
String!

Human-readable name of the category.

subcategory
String

Subcategory grouping, when defined.

tipo

ClassifiedCategory

A categoria em que uma thread foi classificada, do seu catálogo de categorias.

identifier
String!

Identificador estável (de máquina) da categoria.

name
String!

Nome legível da categoria.

subcategory
String

Agrupamento de subcategoria, quando definido.

tipo

Conversation

Uma conversa — as threads que compartilham um mesmo id de conversa nativo da plataforma.

conversationId
String!

Seu id de conversa nativo da plataforma, exatamente como enviado à Notrus.

threads
[Thread!]!

As threads que pertencem a esta conversa, das mais antigas para as mais recentes.

tipo

ConversationConnection

Uma página de conversas no estilo Relay.

edges
[ConversationTypeEdge!]!
pageInfo
PageInfo!
tipo

ConversationCount

Total conversations matching the filter, plus optional breakdowns.

byCategory
[ConversationCountByCategory!]!
byDay
[ConversationCountByDay!]!
byTag
[ConversationCountByTag!]!
total
Int!
tipo

ConversationCountByCategory

How many matching threads (not deduplicated by conversation — a conversation touching more than one category is counted in each) were classified into this category.

count
Int!
identifier
String!
name
String!
subcategory
String
tipo

ConversationCountByDay

How many matching conversations started on this UTC calendar day.

count
Int!
date
DateTime!

The UTC calendar day, at midnight UTC.

tipo

ConversationCountByTag

How many matching conversations individually satisfy this `should` clause, on top of the shared must/mustNot/date bounds — only populated when `should` has more than one clause.

count
Int!
reference
String
value
String!
enum

ConversationSortDirection

Direção de ordenação de `conversations`, por quando cada conversa começou.

  • ASC— Oldest conversations first (the default).
  • DESC— Most recent conversations first.
tipo

ConversationTypeEdge

cursor
String!

Cursor opaco que identifica esta aresta para paginação.

node
Conversation!

O item nesta aresta.

escalar

DateTime

Uma data-hora em UTC, como 2019-12-03T09:54:33Z, em conformidade com o formato date-time.

tipo

DeletedCase

A case removed by a deletion.

code
String!

Readable case code, e.g. CS-0042. It is never reused.

id
ID!

Notrus case id.

tipo

DeletedCustomer

A customer removed by a deletion.

id
ID!

Notrus customer id.

tipo

DeleteImportedCaseResult

What a case deletion removed.

case
DeletedCase

Null when `NOT_FOUND`.

outcome
DeleteOutcome!

Overall result of the deletion.

threads
Int!

Threads deleted.

traces
Int!

Messages deleted.

tipo

DeleteImportedCustomerResult

What a customer deletion removed.

cases
[DeletedCase!]!

Every case of the customer that was deleted.

customer
DeletedCustomer

Null when `NOT_FOUND`.

outcome
DeleteOutcome!

Overall result of the deletion.

threads
Int!

Threads deleted.

traces
Int!

Messages deleted.

enum

DeleteOutcome

What a deletion did.

  • DELETED— The data was deleted.
  • NOT_FOUND— Nothing to delete: it does not exist or was already deleted.
tipo

Document

Um documento armazenado no armazenamento de objetos.

bucketName
String!

Bucket em que o documento está armazenado.

fileName
String!

Nome do objeto dentro do bucket.

filePath
String!

Caminho do objeto dentro do bucket.

mimeType
String!

Content type com que o documento foi armazenado.

originalName
String!

O nome de arquivo com que você o enviou.

tipo

ImportCaseResult

What an import stored.

case
ImportedCase!
conversations
[ImportedConversation!]!

The conversations, in the order you sent them.

customer
ImportedCustomer!
outcome
ImportChange!

Overall result of the import.

warnings
[String!]!

Codes of the problems that did not stop the import. See the case import guide.

enum

ImportChange

What an import did to a record.

  • CREATED— Something new was created.
  • UNCHANGED— Everything sent was already stored.
  • UPDATED— It already existed and changed.
tipo

ImportedCase

The case written by an import.

code
String!

Readable case code generated by Notrus, e.g. CS-0042.

id
ID!

Notrus case id.

outcome
ImportChange!

What the import did to the case.

tipo

ImportedConversation

A conversation written by an import.

conversationId
String!

The conversation key you sent.

threads
[ImportedThread!]!

Its threads, in the order you sent them.

tipo

ImportedCustomer

The customer the case was linked to.

id
ID!

Notrus customer id.

outcome
ImportedRecordOutcome!

Whether the customer is new.

tipo

ImportedMessageCounts

Messages of a thread in an import.

duplicated
Int!

Messages that were already stored.

inserted
Int!

New messages stored.

missingFromPayload
Int!

Messages stored earlier that were not in this request. They stay stored.

enum

ImportedRecordOutcome

Whether an imported record is new or already existed.

  • CREATED— Created by this import.
  • REUSED— Already existed.
tipo

ImportedTagCounts

Tags of a thread in an import.

linked
Int!

Tag values linked to the thread.

replaced
Int!

Previous values of the same tag that were replaced.

tagsCreated
Int!

Tags created in the organization catalog.

valuesCreated
Int!

Tag values created in the organization catalog.

tipo

ImportedThread

A thread written by an import.

active
Boolean!

Whether this is the most recent thread of its conversation.

id
ID!

Notrus thread id.

outcome
ImportedRecordOutcome!

Whether the thread is new.

tags
ImportedTagCounts!
traces
ImportedMessageCounts!
escalar

JSONObject

A JSON object, e.g. { "plan": "gold", "customerSince": 2019 }.

tipo

Mutation

deleteImportedCase
DeleteImportedCaseResult!

Delete an imported case with its threads and messages. The customer is kept. Deleting a case that no longer exists returns NOT_FOUND.

  • inputDeleteImportedCaseInput!
deleteImportedCustomer
DeleteImportedCustomerResult!

Delete a customer and every imported case of that customer, with their threads and messages. Refused when the customer also has data that was not imported.

  • inputDeleteImportedCustomerInput!
importCase
ImportCaseResult!

Import a case handled in your system, with its conversations, threads and messages. Sending the same case again never duplicates data.

  • inputImportCaseInput!
uploadDocument
Document!

Envia um documento. Mande como requisição multipart do GraphQL; o nome do arquivo e o content type são lidos da parte do arquivo.

  • fileUpload!— O arquivo a armazenar.
  • folderString— Subpasta opcional em que gravar o documento, dentro da pasta de documentos da sua organização — ex.: `chats` grava em `<organizationId>/documents/chats/`. Um único segmento de caminho com letras minúsculas, dígitos, hífen e underscore. Omita para gravar direto em `<organizationId>/documents/`.
tipo

PageInfo

Metadados de paginação no estilo Relay para uma página de conexão.

endCursor
String

Cursor opaco para passar como `after` na próxima página; nulo em uma página vazia.

hasNextPage
Boolean!

Verdadeiro se houver mais itens após esta página.

tipo

Thread

Uma thread dentro de uma conversa, projetada para o seu estado de classificação.

chatState
[TagLink!]!

Valores de chat-state aplicados à thread, dos mais antigos para os mais recentes.

classifiedCategory
ClassifiedCategory

A categoria em que a thread foi classificada; nulo quando não categorizada.

classifierState
[TagLink!]!

Valores de classifier-state aplicados à thread, dos mais antigos para os mais recentes.

summary
String

Resumo justificativo da Notrus para a thread, quando produzido.

tags
[TagLink!]!

Every tag link on the thread — system references (classifierState/chatState above) and your organization's catalog references alike (e.g. classified_category, l1, brand). Full link history, oldest first.

threadId
ID!

Identificador interno de thread da Notrus (opaco, estável).

traces
[Trace!]!

The thread's messages, most recent first.

tipo

Trace

One message within a thread, with the role that produced it.

agentName
String

The specialist agent that wrote this message, when one did. Null for the client, for the AI and for system notices — `ownerId` says which channel the message left by, this says who wrote it.

createdAt
DateTime!

When this message was recorded (ISO-8601, UTC).

isDammed
Boolean!

Whether this message was flagged/blocked by Notrus at the time.

message
String!

The message text.

ownerId
String!

Who this message is attributed to (e.g. "client", "system").

rawRole
String!

The role exactly as stored — the same as `role` in lower case, or the free text a case import sent.

role
TraceRole!

Who produced this message.

enum

TraceRole

Who produced a message within a thread.

  • AI— Sent by Notrus.
  • HUMAN— Sent by a human agent.
  • OTHER— Any other author, as sent by a case import. See `rawRole`.
  • USER— Sent by the customer.
escalar

Upload

O escalar `Upload` representa o envio de um arquivo.