> ## 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.

# Save Connection

> Saves a connection to the database.

NsApiSlow threshold: 5000 ms.
<para />## Online Restricted: ## The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.



## OpenAPI

````yaml /openapi/agent/openapi-v3-ErpSyncAgent.json post /api/v1/Agents/ErpSync/SaveConnection
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - ErpSyncAgent
  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/ErpSync/SaveConnection:
    post:
      tags:
        - ErpSync_Agent
      summary: Save Connection
      description: "Saves a connection to the database.\n\nNsApiSlow threshold: 5000 ms.\r\n<para />## Online Restricted: ## The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps."
      operationId: v1ErpSyncAgent_SaveConnection
      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: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          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.ErpSyncCarriers.SaveConnectionRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ErpSyncCarriers.SaveConnectionRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ErpSyncCarriers.SaveConnectionRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ErpSyncCarriers.SaveConnectionRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ErpSyncCarriers.SaveConnectionRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ErpSyncCarriers.SaveConnectionRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ErpSyncCarriers.SaveConnectionRequest
        description: Connection
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ErpConnection'
            text/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ErpConnection'
            application/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ErpConnection'
            text/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ErpConnection'
            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ErpConnection'
            application/merge-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.ErpConnection'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.ErpSyncCarriers.SaveConnectionRequest:
      description: 'SaveConnection: Saves a connection to the database.'
      type: object
      properties:
        Connection:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.ErpConnection'
    SuperOffice.CRM.Services.ErpConnection:
      description: "Information about a connection to the ERP system.\r\n<para />\r\nCarrier object for ErpConnection.\r\nServices for the ErpConnection Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IErpSyncAgent\">ErpSync Agent</see>."
      type: object
      properties:
        ErpConnectionId:
          format: int32
          description: Primary key
          type: integer
        ErpConnectorId:
          format: int32
          description: The connector that this connection should call
          type: integer
        DisplayName:
          description: Connection name shown to user; multi-language support
          type: string
        DisplayDescription:
          description: Tooltip/description shown to user; multi-language support
          type: string
        Active:
          description: Is this connection currently active
          type: boolean
        ConnectionId:
          description: >-
            The GUID that uniquely identifies this connection; passed to the
            Connector in every call
          type: string
        MostRecentTimestamp:
          description: >-
            Datetime, transaction number or other identification of the point in
            time of the most-recently seen actor in the ERP system
          type: string
        ConfigFields:
          description: The config fields needed to establish a connection to the connector
          type: object
          additionalProperties:
            type: string
        Deleted:
          description: >-
            If true, the connection has been deleted and should not be shown to
            the users.
          type: boolean
        AllAccess:
          description: >-
            Is this connection accessible to everyone?  If not, then the
            ErpConnectionAccess table tells us who can access it
          type: boolean
        UserGroupAccessIds:
          description: >-
            Array of ids containing usergroups that will have access to this
            connection.
          type: array
          items:
            format: int32
            type: integer
        AssociateAccessIds:
          description: >-
            Array of ids containing associates that will have access to this
            connection.
          type: array
          items:
            format: int32
            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

- [Save Connection](/en/api/reference/restful/agent/quote_agent/save-connection.md)
- [Save Connection Config Fields](/en/api/reference/restful/agent/quote_agent/save-connection-config-fields.md)
- [Save Connection List Mappings](/en/api/reference/restful/agent/erpsync_agent/save-connection-list-mappings.md)
- [Setting up ERP Sync connection](/en/api/plugins/erp-connectors/setup-connection.md)
- [SuperOffice.WebApi.Data.Quote SaveConnectionRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Quote_SaveConnectionRequest.md)
- [SuperOffice.WebApi.Data.ErpSync SaveConnectionRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.ErpSync_SaveConnectionRequest.md)
