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

# Sync Email Accounts

> Start syncing of the given accounts, from mail server to SuperOffice database cache.

Only one of these API calls may run at a time. If one is already active, we return after 1 (one) second, with no indication that the sync was not really started. This is a way to throttle sync'ing to avoid making the mail servers angry at us. <br/> There is an <b>additional</b> level of throttling within the implementation as well, limiting us to a maximum of 10 tasks, regardless of how many associates are to to be sync'ed. The outer, API-level lock is released when all those tasks are done.
NsApiSlow threshold: 5000 ms.
<para />## Online Restricted: ## The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.



## OpenAPI

````yaml /openapi/agent/openapi-v3-EMailAgent.json post /api/v1/Agents/EMail/SyncEmailAccounts
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - EMailAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/EMail/SyncEmailAccounts:
    post:
      tags:
        - EMail_Agent
      summary: Sync Email Accounts
      description: "Start syncing of the given accounts, from mail server to SuperOffice database cache.\n\nOnly one of these API calls may run at a time. If one is already active, we return after 1 (one) second, with no indication that the sync was not really started. This is a way to throttle sync'ing to avoid making the mail servers angry at us. <br/> There is an <b>additional</b> level of throttling within the implementation as well, limiting us to a maximum of 10 tasks, regardless of how many associates are to to be sync'ed. The outer, API-level lock is released when all those tasks are done.\r\nNsApiSlow threshold: 5000 ms.\r\n<para />## Online Restricted: ## The EMail agent is not available in Online by default. Access must be requested specifically when app is registered."
      operationId: v1EMailAgent_SyncEmailAccounts
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest
        description: SyncUserAccounts
        required: true
      responses:
        '204':
          description: No Content
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.EMailCarriers.SyncEmailAccountsRequest:
      description: >-
        SyncEmailAccounts: Start syncing of the given accounts, from mail server
        to SuperOffice database cache. Only one of these API calls may run at a
        time. If one is already active, we return after 1 (one) second, with no
        indication that the sync was not really started. This is a way to
        throttle sync'ing to avoid making the mail servers angry at us. <br/>
        There is an <b>additional</b> level of throttling within the
        implementation as well, limiting us to a maximum of 10 tasks, regardless
        of how many associates are to to be sync'ed. The outer, API-level lock
        is released when all those tasks are done.
      type: object
      properties:
        SyncUserAccounts:
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.SyncUserAccount'
    SuperOffice.CRM.Services.SyncUserAccount:
      description: "Details for syncing email user accounts\r\n<para />\r\nCarrier object for SyncUserAccount.\r\nServices for the SyncUserAccount Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IEMailAgent\">EMail Agent</see>."
      type: object
      properties:
        AccountId:
          format: int32
          description: The account primary key
          type: integer
        AssociateName:
          description: The username of the associate owning the account
          type: string
        AssociateId:
          format: int32
          description: Id of the associate who owns this account
          type: integer
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.TableRight:
      description: "Wraps a table right together with an explanatory reason.\r\nCode can indicate why access is restricted."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string
    SuperOffice.CRM.Security.FieldProperty:
      description: >-
        Class holding properties like field length, field type about a field in
        the carrier.
      type: object
      properties:
        FieldRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldRight'
        FieldType:
          type: string
        FieldLength:
          format: int32
          description: ''
          type: integer
    SuperOffice.CRM.Security.FieldRight:
      description: "Wraps the field right together with an explanatory reason.\r\nAlso adds logical operators to the field rights so that they can be easily combined."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string

````

## Related topics

- [Sync Email Account](/en/api/reference/restful/agent/email_agent/sync-email-account.md)
- [Get Ready Sync Email Accounts](/en/api/reference/restful/agent/email_agent/get-ready-sync-email-accounts.md)
- [SuperOffice.WebApi.Data.EMail SyncEmailAccountRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.EMail_SyncEmailAccountRequest.md)
- [SuperOffice.WebApi.Data.EMail SyncEmailAccountsRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.EMail_SyncEmailAccountsRequest.md)
- [SuperOffice.WebApi.Data.EMail GetReadySyncEmailAccountsRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.EMail_GetReadySyncEmailAccountsRequest.md)
- [SuperOffice.WebApi.Agents.EMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.EMailAgent.md)
