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

# Update an email account intent

> Change the credentials recipient, the personal email or the groups, roles, licenses and organization units of an email account intent before its mailbox is created — typically while its task sleeps until its date. Only the fields you send change; a resource list is replaced whole. The employee cannot change: create a new intent for someone else. Refused with `INTENT_ALREADY_EXECUTED` once the mailbox exists, `EXECUTION_IN_PROGRESS` while it is being created, `TICKET_CLOSED` when its task is completed or cancelled. For an onboarding still on the classic email step, the step is handled by the onboarding itself; this intent is the email work tracked as a task on a ticket (an EMAIL_ACCOUNT task), and never closes an onboarding email step.

<span className="badge-write">Key: Write</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json patch /email-account-intents/{intentId}
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /email-account-intents/{intentId}:
    patch:
      tags:
        - Onboardings
      summary: Update an email account intent
      description: >-
        Change the credentials recipient, the personal email or the groups,
        roles, licenses and organization units of an email account intent before
        its mailbox is created — typically while its task sleeps until its date.
        Only the fields you send change; a resource list is replaced whole. The
        employee cannot change: create a new intent for someone else. Refused
        with `INTENT_ALREADY_EXECUTED` once the mailbox exists,
        `EXECUTION_IN_PROGRESS` while it is being created, `TICKET_CLOSED` when
        its task is completed or cancelled. For an onboarding still on the
        classic email step, the step is handled by the onboarding itself; this
        intent is the email work tracked as a task on a ticket (an EMAIL_ACCOUNT
        task), and never closes an onboarding email step.
      operationId: updateEmailAccountIntent
      parameters:
        - name: intentId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEmailAccountIntentBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailAccountIntent_Output'
components:
  schemas:
    UpdateEmailAccountIntentBody:
      type: object
      properties:
        groups:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
        roles:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
        licenses:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
        organizationUnits:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
        personalEmail:
          description: The employee's personal address, saved on the employee on execute.
          anyOf:
            - type: string
              format: email
              pattern: >-
                ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
            - type: 'null'
        credentialsRecipient:
          type: object
          properties:
            type:
              description: >-
                Who receives the temporary password. EMPLOYEE sends it to
                `personalEmail`.
              type: string
              enum:
                - ADMIN
                - EMPLOYEE
                - MANAGER
                - TASK_OWNER
            email:
              description: The address the password is sent to
              anyOf:
                - type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                - type: string
                  const: ''
          required:
            - type
            - email
    EmailAccountIntent_Output:
      type: object
      properties:
        id:
          type: string
          description: >-
            Intent id — pass it to `updateEmailAccountIntent` and
            `executeEmailAccountIntent`
        taskId:
          description: The EMAIL_ACCOUNT task that tracks the mailbox
          anyOf:
            - type: string
            - type: 'null'
        ticketId:
          description: >-
            The ticket holding that task: the parentTicketId sent, or the one
            Primo opened. Null if unreadable.
          anyOf:
            - type: string
            - type: 'null'
        employeeId:
          type: string
        companySaasApplicationId:
          type: string
          description: The company's email provider
        credentialsRecipient:
          type: object
          properties:
            type:
              description: >-
                Who receives the temporary password. EMPLOYEE sends it to
                `personalEmail`.
              type: string
              enum:
                - ADMIN
                - EMPLOYEE
                - MANAGER
                - TASK_OWNER
            email:
              description: The address the password is sent to
              anyOf:
                - type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                - type: string
                  const: ''
          required:
            - type
            - email
          additionalProperties: false
        personalEmail:
          anyOf:
            - type: string
            - type: 'null'
        groups:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
            additionalProperties: false
        roles:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
            additionalProperties: false
        licenses:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
            additionalProperties: false
        organizationUnits:
          type: array
          items:
            type: object
            properties:
              id:
                description: The entitlement id from `getSaasById` of the email provider
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
            additionalProperties: false
        createdEmail:
          description: The address the provider created, null until executed
          anyOf:
            - type: string
            - type: 'null'
        executedAt:
          description: When the mailbox was created; null while the intent can change
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        updatedAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - taskId
        - ticketId
        - employeeId
        - companySaasApplicationId
        - credentialsRecipient
        - personalEmail
        - groups
        - roles
        - licenses
        - organizationUnits
        - createdEmail
        - executedAt
        - createdAt
        - updatedAt
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````

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