---
title: "Add new Email Address based on request"
url: "https://developers.zinnia.com/apis/policy-transactions-1-0-2/versions/d0006570-ab9d-464e-814f-d120ba425e84/operations/emailAddressValidation1"
---

> Full API specification: https://developers.zinnia.com/apis/policy-transactions-1-0-2/versions/d0006570-ab9d-464e-814f-d120ba425e84.md

# Add new Email Address based on request

`POST` `/policy/v1/transactions/{planCode}/{policyNumber}/emailaddress/{partyId}/validation`

Operation ID: `emailAddressValidation1`

Validates email address change requests for policy parties including ADD, UPDATE, and DELETE operations

## Path parameters

- `planCode` (string, required)
- `policyNumber` (string, required)
- `partyId` (string, required)

## Query parameters

- `operation` (string, required) - validate business rule for provided operation
- `bankId` (string, optional) - bank id

## Request body (required)

Content types: `application/json`

## Responses

- `202` - Request accepted successfully and is being processed.
- `400` - Request failed due to rules failure.
- `500` - Unexpected error occured, please check server logs

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Zinnia Policy Transactions API.
  version: 1.0.8
servers:
  - url: https://dev.api.zinnia.io
    description: DEV Environment
  - url: https://qa.api.zinnia.io
    description: QA Environment
paths:
  /policy/v1/transactions/{planCode}/{policyNumber}/emailaddress/{partyId}/validation:
    post:
      tags:
        - Non Financial Transactions
      summary: Add new Email Address based on request
      description: Validates email address change requests for policy parties
        including ADD, UPDATE, and DELETE operations
      operationId: emailAddressValidation1
      parameters:
        - name: planCode
          in: path
          required: true
          schema:
            type: string
        - name: policyNumber
          in: path
          required: true
          schema:
            type: string
        - name: partyId
          in: path
          required: true
          schema:
            type: string
        - name: operation
          in: query
          required: true
          example: ADD
          description: validate business rule for provided operation
          schema:
            type: string
            enum:
              - ADD
              - UPDATE
              - DELETE
        - name: bankId
          in: query
          required: false
          example: "1"
          description: bank id
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailChangeRequest"
      responses:
        "202":
          description: Request accepted successfully and is being processed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionAcceptedResponse"
        "400":
          description: Request failed due to rules failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionResponse"
              examples:
                failure:
                  $ref: "#/components/examples/failureTransactionResponse"
        "500":
          description: Unexpected error occured, please check server logs
      security:
        - Auth0: []
      x-kong-plugin-pre-function:
        config:
          access:
            - >
              local path = kong.request.get_path()

              local new_path = path:gsub("^/policy/v1/transactions",
              "/bpm/v1/policies")

              kong.service.request.set_path(new_path)
security:
  - Auth0: []
components:
  schemas:
    EmailChangeRequest:
      type: object
      allOf:
        - $ref: "#/components/schemas/EmailChange"
      properties:
        caseId:
          type: string
          example: CA00000022023
          description: Zinnia Live Case ID
        deleteRequest:
          type: boolean
          description: Flag for delete or update request. If flag==true then Delete
            Request else Update Request
          default: false
    TransactionAcceptedResponse:
      type: object
      properties:
        correlationId:
          type: string
          example: 3a2a3435-2089-4b81-9959-e0d569ccf4f0
          description: Unique identifier which used by every system to trace the request
        caseId:
          type: string
          example: CA0000369469
          description: Zinnia Live Case ID
        caseStatus:
          type: string
          example: IN_PROGRESS
          description: Zinnia Live Case Status
        pdfId:
          type: string
          description: Identifier for the generated or associated PDF document (e.g.
            OnBase document number). Returned on systematic program setup and
            update submit when available.
          example: DOC-10004567
    TransactionResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - failure
        error:
          type: array
          items:
            $ref: "#/components/schemas/Error"
        quoteResponse:
          type: object
    EmailChange:
      type: object
      properties:
        correlationId:
          type: string
          example: 657b717b7dcf554abf9ef067
          description: The unique ID to track transaction request across all systems
        effectiveDate:
          type: string
          format: date
          pattern: ([0-9]{4})-([0-9]{2})-([0-9]{2})
          description: Date (with pattern "yyyy-mm-dd")
        email:
          $ref: "#/components/schemas/Email"
      required:
        - effectiveDate
        - email
    Error:
      type: object
      properties:
        errorCode:
          type: string
          example: BPM.NM.002
          description: This is the NIGO id generated by BPM system
        attribute:
          type: string
        error:
          type: string
          description: This is the error generated by BPM system
        resolution:
          type: string
          description: Resolution generated by BPM system to resolve the error
    Email:
      type: object
      properties:
        startDate:
          type: string
          format: date
          pattern: ([0-9]{4})-([0-9]{2})-([0-9]{2})
          description: Date (with pattern "yyyy-mm-dd")
        endDate:
          type: string
          format: date
          pattern: ([0-9]{4})-([0-9]{2})-([0-9]{2})
          description: Date (with pattern "yyyy-mm-dd").If provided by the user, the
            system will apply an end date to the emailaddress, ensuring that a
            new emailaddress is not generated.
        emailType:
          type: string
          enum:
            - PERSONAL
            - BUSINESS
            - CUSTOMERSERVICE
            - OTHER
          description: Email type
        emailAddress:
          type: string
          example: will.smith@gmail.com
          description: Type of the email. PERSONAL for personal emails, BUSINESS for
            business emails, CUSTOMERSERVICE for customer service emails, OTHER
            for any other type of emails.
      required:
        - startDate
        - emailType
        - emailAddress
  examples:
    failureTransactionResponse:
      value:
        status: failure
        validationResult:
          - errorCode: BPM.NM.005
            attribute: null
            error: Amount request is invalid.
            resolution: Please check the One Time Premium Amount and submit the request
              again.
          - errorCode: BPM.NM.003
            attribute: null
            error: Party information does not match with information in the Zahara system.
            resolution: Please validate the party information and submit the request again.
  securitySchemes:
    Auth0:
      type: openIdConnect
      openIdConnectUrl: https://login.uat.zinnia.com/.well-known/openid-configuration
      x-kong-security-openid-connect:
        config:
          run_on_preflight: true
          scopes_claim:
            - https://uat.api.zinnia.io/permissions
          audience_claim:
            - aud
          audience_required:
            - https://uat.api.zinnia.io
          client_id:
            - client_id
          auth_methods:
            - bearer
        enabled: true
        protocols:
          - grpc
          - grpcs
          - http
          - https
```
