2.0info: 3.1.0 email x-senior-domain: platform x-senior-domain-path: platform x-senior-service-path: email contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: platform.senior.com.br /t/senior.com.br/bridge/1.0/rest/platformsecurityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorizationsecurity: – APIKeyHeader: [] – application/json – application/jsonpaths: /email/queries/healthCheck: post: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PRIVATE parameters: responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/queries/getOAuthAuthorizationURL: post: description: Obtém a URL de autorização OAuth tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – redirect – provider properties: redirect: type: string description: Endereço de redirecionamento provider: type: string allOf: – #/definitions/oAuthProvider description: Provedor OAuth state: type: string description: Informações adicionais para retornar no callback responses: 200: description: Ok schema: type: object required: – authenticationURL properties: authenticationURL: type: string description: URL para autenticação 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/queries/listBlacklistedEmails: post: description: Retorna as informações dos e-mails existentes na blacklist tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: string description: Filtro de pesquisa reason: type: string allOf: – #/definitions/blacklistReason description: Motivo pelo qual o e-mail foi inserido na blacklist pagination: type: object allOf: – #/definitions/pagination description: As configurações de paginação da listagem. Se não definido, retornará os 10 primeiros resultados responses: 200: description: Ok schema: type: object required: – emailBlacklist – listInformation properties: emailBlacklist: type: array items: type: object allOf: – #/definitions/completeBlacklistedEmail minimum: 1 description: Lista com os e-mails que estão na blacklist listInformation: type: object allOf: – #/definitions/listInformation description: Informações sobre os resultados da listagem 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/queries/getBlacklistedEmail: post: description: Retorna as informações de um e-mail na blacklist se ele existir tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – emailAddress properties: emailAddress: type: string description: Endereço de e-mail responses: 200: description: Ok schema: type: object allOf: – #/definitions/completeBlacklistedEmail 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Retorna as informações de um e-mail na blacklist se ele existir tags: – Queries x-senior-visibility: PRIVATE parameters: – name: emailAddress description: Endereço de e-mail in: query required: true type: string responses: 200: description: Ok schema: type: object allOf: – #/definitions/completeBlacklistedEmail 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/queries/mailLogs: post: description: Lista os logs de e-mails enviados tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: string description: Filtro para localizar logs específicos, sendo possível pesquisar por remetente, destinatário ou assunto do e-mail. startDate: type: string format: date-time description: Data de inicio endDate: type: string format: date-time description: Data Fim status: type: string allOf: – #/definitions/statusMail description: Enum de status page: type: integer format: int64 description: O número da página retornado. A primeira página corresponde ao índice 0 default: 0 limit: type: integer format: int64 description: Quantidade de registros por página default: 10 responses: 200: description: Ok schema: type: object required: – lastAccessInfo – logs – listInformation properties: lastAccessInfo: type: object allOf: – #/definitions/lastAccessInfo description: Informações de último acesso logs: type: array items: type: object allOf: – #/definitions/mailLog minimum: 1 description: Logs de e-mails enviados listInformation: type: object allOf: – #/definitions/listInformation description: Informações sobre os resultados da listagem 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/queries/accessedLogInfo: post: description: Lista os usuários que tiveram acessos aos logs de e-mail tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: filter: type: string description: Filtros para retringir a consulta page: type: integer format: int64 description: Número da página, se não informado o valor padrão é 0 default: 0 limit: type: integer format: int64 description: Número de registros por página, se não informado o valor padrão é 10 default: 10 responses: 200: description: Ok schema: type: object required: – accessInfos – listInformation properties: accessInfos: type: array items: type: object allOf: – #/definitions/lastAccessInfo minimum: 1 description: Informações de usuários que acesso os logs listInformation: type: object allOf: – #/definitions/listInformation description: Informações da listagem 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Lista os usuários que tiveram acessos aos logs de e-mail tags: – Queries x-senior-visibility: PRIVATE parameters: – name: filter description: Filtros para retringir a consulta in: query type: string – name: page description: Número da página, se não informado o valor padrão é 0 in: query type: integer format: int64 – name: limit description: Número de registros por página, se não informado o valor padrão é 10 in: query type: integer format: int64 responses: 200: description: Ok schema: type: object required: – accessInfos – listInformation properties: accessInfos: type: array items: type: object allOf: – #/definitions/lastAccessInfo minimum: 1 description: Informações de usuários que acesso os logs listInformation: type: object allOf: – #/definitions/listInformation description: Informações da listagem 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/queries/getMetadata: post: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: metadataFormat: type: string description: responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: metadataFormat description: in: query type: string responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/queries/getDependencies: post: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/actions/sendEmail: post: description: Envio do e-mail tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – content – destination properties: content: type: object allOf: – #/definitions/content description: Conteúdo do e-mail source: type: string description: E-mail de origem do envio de e-mail destination: type: object allOf: – #/definitions/destination description: Destino do envio de e-mail replyTo: type: string description: Responder para headers: type: array items: type: object allOf: – #/definitions/header description: Headers enviados junto ao e-mail origin: type: object allOf: – #/definitions/service description: Origem do envio de e-mail, se informado, será obtida a configuração de e-mail esta origem validate: type: boolean description: Indica se deverá fazer uma validação de forma síncrona da mensagem default: false responses: 200: description: Ok schema: type: object required: – ticket properties: ticket: type: string description: Ticket do envio do e-mail 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /email/actions/setOAuthAuthorization: post: description: Persiste as informações de autorização OAuth tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – domain – service – authorization properties: domain: type: string description: Domínio da configuração service: type: string description: Serviço da configuração authorization: type: object allOf: – #/definitions/authorization description: As informações de autorização responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/actions/testEmail: post: description: Efetua um teste de envio de e-mail tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – destination properties: origin: type: object allOf: – #/definitions/service description: Origem do envio de e-mail, se informado, será obtida a configuração de e-mail desta origem destination: type: string description: Destino do teste de envio de e-mail responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials 400: description: Requisição inválida, parâmetros obrigatórios não informados ou campo informado incorretamente default: description: Error response schema: #/definitions/genericError /email/actions/insertEmailsInBlacklist: post: description: Insere novos e-mails na blacklist tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – emailsToBlacklist properties: emailsToBlacklist: type: array items: type: object allOf: – #/definitions/blacklistedEmail minimum: 1 description: Lista com os endereços de e-mail e os motivos pelo qual eles serão adicionados na blacklist responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/actions/removeEmailsFromBlacklist: post: description: Remove e-mails da blacklist tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – emailAddresses properties: emailAddresses: type: array items: type: string minimum: 1 description: Lista com os endereços de e-mail que serão removidos da blacklist responses: 200: description: Ok schema: type: object 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /email/events/emailSent: post: description: E-mail enviado com sucesso. Caso tenha sido informado uma origem, o evento a ser escutado é emailSent-{domain}-{service}. x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – ticket properties: ticket: type: string description: Ticket do envio do e-mail responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /email/events/emailSentError: post: description: E-mail enviado com erro. Caso tenha sido informado uma origem, o evento a ser escutado é emailSentError-{domain}-{service}. x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – ticket properties: ticket: type: string description: Ticket do envio do e-mail message: type: string description: Mensagem de erro responses: 200: description: OK default: description: Error response schema: #/definitions/genericErrordefinitions: oAuthProvider: description: Provedor OAuth suportado type: string enum: – GOOGLE blacklistReason: description: Motivo do e-mail ter ido para a blacklist type: string enum: – SOFT_BOUNCE – HARD_BOUNCE – COMPLAINT statusMail: description: ALL|DONE|ERROR|SENDING type: string enum: – ALL – DONE – ERROR – SENDING upDown: description: type: string enum: – UP – DOWN userNotificationKind: description: User notification kind. type: string enum: – Operational – Management – News userNotificationPriority: description: User notification priority. type: string enum: – Error – Alert – None eventEmailFormat: description: Format of the email type: string enum: – HTML – PLAIN_TEXT header: description: Headers do email type: object required: – name – values properties: name: type: string description: Nome values: type: array items: type: string minimum: 1 description: Valores content: description: Conteúdo do e-mail type: object required: – body – subject properties: body: type: object allOf: – #/definitions/body description: Conteúdo do corpo subject: type: string description: Assunto do -email attachments: type: array items: type: object allOf: – #/definitions/attachment description: Anexos destination: description: Destino do e-mail type: object required: – to properties: to: type: array items: type: string minimum: 1 description: E-mails dos destinários cc: type: array items: type: string description: E-mails que serão adicionados em cópia bcc: type: array items: type: string description: E-mails que serão adicionados em cópia oculta body: description: Corpo do conteúdo do e-mail type: object properties: html: type: string description: Conteúdo HTML text: type: string description: Conteúdo em formato text para dispositivos que não conseguem renderizar service: description: Serviço de origem do envio type: object required: – domain – service properties: domain: type: string description: Domínio service: type: string description: Serviço attachment: description: Anexo type: object required: – name – url properties: name: type: string description: Nome do anexo url: type: string description: Localização do arquivo a ser anexado authorization: description: discriminator: _discriminator type: object required: – provider – _discriminator properties: provider: type: string allOf: – #/definitions/oAuthProvider description: Provedor OAuth _discriminator: type: string description: seniorClientAuthorization: description: Informações de autorização para o client da senior allOf: – #/definitions/authorization – type: object required: – authorizationCode – redirect properties: authorizationCode: type: string description: Código de autorização redirect: type: string description: Endereço de redirecionamento, o mesmo usado para obter a URL de autorização pagination: description: As configurações de paginação de uma listagem type: object properties: pageNumber: type: integer format: int64 description: O número da página retornado. A primeira página corresponde ao índice 0 default: 0 pageSize: type: integer format: int64 description: Quantidade de registros por página default: 10 listInformation: description: As informações sobre os resultados de listagem realizada type: object required: – totalElements – totalPages properties: totalElements: type: integer format: int64 description: Quantidade total de resultados encontrados totalPages: type: integer format: int64 description: Quantidade total de páginas encontradas blacklistedEmail: description: Informações básicas de um e-mail colocado na blacklist discriminator: _discriminator type: object required: – emailAddress – reason – _discriminator properties: emailAddress: type: string description: Endereço de e-mail reason: type: string allOf: – #/definitions/blacklistReason description: Motivo do e-mail ter ido para a blacklist _discriminator: type: string description: completeBlacklistedEmail: description: Informações completas de um e-mail que está na blacklist allOf: – #/definitions/blacklistedEmail – type: object properties: insertedDate: type: string description: Data na qual o e-mail foi inserido mailLog: description: Log de emails enviados type: object required: – createdBy – destination – subject – createdDate – status – service – domain – lastModifiedDate – errorMessage properties: createdBy: type: string description: Remetente destination: type: string description: Destinatário subject: type: string description: Assunto createdDate: type: string format: date-time description: Data de envio status: type: string allOf: – #/definitions/statusMail description: Enum de status service: type: string description: Identifica qual foi o serviço que fez a solicitação do envio de e-mail. domain: type: string description: Identifica qual foi o domínio que fez a solicitação do envio de e-mail. lastModifiedDate: type: string format: date-time description: Data da ultima atualização. errorMessage: type: string description: Descrição da causa do erro. lastAccessInfo: description: Dados do usuário que acessou os logs de e-mail type: object required: – username – ipAddress – accessDate properties: username: type: string description: Usuário que acessou os logs ipAddress: type: string description: Ip do usuário que solicitou o acesso accessDate: type: string format: date-time description: Data do acesso checkData: description: Dados do healthcheck type: object required: – name – status properties: name: type: string description: Nome do healthcheck status: type: string allOf: – #/definitions/upDown description: Status do healthcheck notifyUserEventPayload: description: Represents a regular user event notification payload discriminator: _discriminator type: object required: – notificationKind – notificationPriority – notificationSubject – notificationContent – sourceDomain – sourceService – destinationUser – _discriminator properties: notificationClass: type: string description: Class of notification notificationOrigin: type: string description: Origin of notification. Free text. Optional. notificationKind: type: string allOf: – #/definitions/userNotificationKind description: Notification kind. notificationPriority: type: string allOf: – #/definitions/userNotificationPriority description: Notification priority. notificationSubject: type: string description: Notification subject. notificationContent: type: string description: Notification content. sourceDomain: type: string description: Domain that generates the notification. sourceService: type: string description: Service that generates the notification. destinationUser: type: string description: Username of the destination user. link: type: string description: Notification link _discriminator: type: string description: emailNotifyUserEventPayload: description: Represents an email notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – from properties: from: type: string description: Email sender address sendTo: type: array items: type: string description: Additional recipients to send the email to format: type: string allOf: – #/definitions/eventEmailFormat description: Email format pushNotifyUserEventPayload: description: Represents a push notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – applicationId properties: applicationId: type: string description: Apple/Google application id blobReference: description: Default blob reference type. Every service defines its own. type: object required: – targetObjectId properties: domainName: type: string description: The domain the blob belongs to. serviceName: type: string description: The service the blob belongs to. targetObjectId: type: string description: The basic id of the blob. targetCopyId: type: string description: The id of the blob copy. basicErrorPayload: description: Default error payload type. Every service defines its own. type: object properties: message: type: string description: The user-facing error message, if any. errorCode: type: string description: The program-accessible (and service-specific) error code. dependency: description: Represents a service dependency type: object required: – domain – service – version properties: domain: type: string description: Domain of the dependency service service: type: string description: Name of the dependency service type: string description: Version of the dependency service genericError: properties: message: type: string description: Messaging describing the error. reason: type: string description: A symbolic code identifying the category of the reason of the error. enum: – BAD_REQUEST – UNAUTHORIZED – PAYMENT_REQUIRED – FORBIDDEN – OBJECT_NOT_FOUND – REQUEST_TIMEOUT – GONE – UNPROCESSABLE – INTERNAL_ERROR – NOT_IMPLEMENTED – SERVICE_UNAVAILABLE – INSUFFICIENT_STORAGE