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

# Put organisations connections

> Updates an existing Connection by ID in the current organisation.




## OpenAPI

````yaml put /organisations/{organisationId}/connections/{connectionId}
openapi: 3.0.3
info:
  title: Switchboard API
  description: >-
    The Switchboard API provides users the ability to manage their Apps,
    Integrations and Workflows
  version: 0.0.1-alpha.0
servers:
  - url: https://platform.versori.com/api/switchboard/v1alpha1/
    description: Production server
  - url: http://localhost:8080/v1alpha1/
    description: Localhost
security:
  - apiKey: []
paths:
  /organisations/{organisationId}/connections/{connectionId}:
    put:
      tags:
        - connections
      description: |
        Updates an existing Connection by ID in the current organisation.
      operationId: UpdateConnection
      parameters:
        - name: organisationId
          in: path
          required: true
          schema:
            type: string
          example: '101'
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateConnectionRequest'
      responses:
        '200':
          $ref: '#/components/responses/UpdateConnectionResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  requestBodies:
    UpdateConnectionRequest:
      description: >-
        UpdateConnectionRequest is the payload for updating an existing
        Connection.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateConnectionRequestBody'
  responses:
    UpdateConnectionResponse:
      description: A single Connection result.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Connection'
    ErrorResponse:
      description: The default error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    UpdateConnectionRequestBody:
      type: object
      description: >
        UpdateConnectionRequestBody is the request body to update an existing
        connection. This will replace the existing

        connection details.
      properties:
        name:
          type: string
        data:
          type: object
          oneOf:
            - $ref: '#/components/schemas/ConnectionDataAPIKey'
            - $ref: '#/components/schemas/ConnectionDataHTTPBasicAuth'
            - $ref: '#/components/schemas/ConnectionDataSecret'
            - $ref: '#/components/schemas/ConnectionDataOAuth2ClientCredentials'
            - $ref: '#/components/schemas/ConnectionDataJWTBearer'
            - $ref: '#/components/schemas/ConnectionDataCustomFunction'
      required:
        - name
        - data
    Connection:
      type: object
      properties:
        id:
          type: string
        orgId:
          type: string
        name:
          type: string
        app:
          $ref: '#/components/schemas/App'
        authConfig:
          $ref: '#/components/schemas/AppAuthConfig'
        credentialId:
          type: string
        usedByBoards:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionBoardReference'
      required:
        - id
        - orgId
        - name
        - app
        - authType
        - credentialId
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        extensions:
          type: object
      required:
        - code
        - message
    ConnectionDataAPIKey:
      description: >
        ConnectionDataAPIKey is the data element of a connection which is using
        an apikey authentication type.
      properties:
        apiKey:
          type: string
      required:
        - apiKey
    ConnectionDataHTTPBasicAuth:
      description: >
        ConnectionDataHTTPBasicAuth is the data element of a connection which is
        using a HTTP Basic Auth authentication type.
      properties:
        user:
          type: string
        password:
          type: string
      required:
        - user
        - password
    ConnectionDataSecret:
      description: >
        ConnectionDataSecret is the data element of a connection for an
        authentication type requiring a secret (eg HTTPRefresh).
      properties:
        secret:
          type: string
      required:
        - secret
    ConnectionDataOAuth2ClientCredentials:
      description: >
        ConnectionDataOAuth2ClientCredentials is the data element of a
        connection for OAuth2 using the client_credentials flow.
      properties:
        clientId:
          type: string
        clientSecret:
          type: string
        username:
          type: string
        password:
          type: string
        additionalParameters:
          type: string
          description: >
            AdditionalParameters is a URL-encoded query string which can be used
            to be pass extra parameters the OAuth2

            provider.
          example: audience=https://example.com
        issueToken:
          type: boolean
          description: >
            IssueToken is a flag which indicates whether the connection should
            issue a token when it is created. The

            request to create/update a connection will fail if this is true and
            issuing fails.
          default: false
        authStyle:
          type: integer
          description: >
            AuthStyle determines how the clientId and clientSecret are sent to
            the OAuth2 provider. The default is 0

            which means auto-detect, 1 means in the request body and 2 means in
            the Authorization header as base64 encoded

            (clientId:clientSecret).
          default: 0
      required:
        - clientId
        - clientSecret
    ConnectionDataJWTBearer:
      description: >
        ConnectionDataJWTBearer holds the configuration required to issue access
        tokens from a JWT Bearer token.
      properties:
        secret:
          description: |
            Secret is the secret used to sign the JWT
          type: string
        payload:
          description: |
            Payload is the payload of the JWT
          type: object
        algorithm:
          description: |
            Algorithm is the algorithm used to sign the JWT
          type: string
          enum:
            - HS256
            - HS384
            - HS512
            - RS256
            - RS384
            - RS512
        prefix:
          description: >
            Prefix is the prefix to use when setting the token in the header,
            such as "Bearer". Defaults to "Bearer" if

            not set.
          type: string
        expiresIn:
          description: |
            ExpiresIn is the duration for which the token is valid.
          type: string
      required:
        - secret
        - payload
        - algorithm
    ConnectionDataCustomFunction:
      description: >
        ConnectionDataCustomFunction is the data element of a connection for a
        custom function.
      properties:
        data:
          type: string
      required:
        - data
    App:
      type: object
      properties:
        id:
          type: string
        orgId:
          type: string
        name:
          type: string
        public:
          type: boolean
        server:
          $ref: '#/components/schemas/Server'
        schemaMetadata:
          $ref: '#/components/schemas/SchemaMetadata'
        supportedAuthConfigs:
          description: >
            SupportedAuthConfigs is a list of authentication standards which can
            be used to connect a user's account to

            this app. At least one auth type needs to be valid for the App to be
            used by a user.
          type: array
          items:
            $ref: '#/components/schemas/AppAuthConfig'
        imageUrl:
          type: string
        schema:
          $ref: '#/components/schemas/Schema'
        schemaId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
      required:
        - id
        - orgId
        - name
        - public
        - server
        - schemaMetadata
        - schema
        - createdAt
        - updatedAt
    AppAuthConfig:
      description: >
        AppAuthConfig describes how an organisation can authenticate with an
        app.
      type: object
      properties:
        type:
          description: >
            Type denotes the method of authentication. Valid values are:
            `"oidc"`, `"oauth2"`, `"apikey"`, `"httpBasicAuth"
          type: string
        isValid:
          description: >
            IsValid is true if and only if the `data` field is populated with
            all the required information to enable

            an organisation to connect to the App via this auth type. It is
            allowed for an App to have invalid auth

            configs providing there is at least one valid.
          type: boolean
        data:
          $ref: '#/components/schemas/AppAuthConfigData'
      required:
        - type
        - isValid
        - data
    ConnectionBoardReference:
      description: Describes which boards a connection is in use by.
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    Server:
      type: object
      properties:
        name:
          description: >
            Description is a human-friendly name for this server address. If a
            friendly name isn't available then this

            defaults to the URL.
          type: string
        url:
          description: |
            URL is the server address listening for requests.
          type: string
      required:
        - name
        - url
    SchemaMetadata:
      type: object
      properties:
        type:
          description: >
            Type denotes the type of schema the corresponding App is backed by.
            Currently the only supported value is

            "openapi", but other types such as "soap", "graphql" and "grpc" are
            on the roadmap.
          type: string
        version:
          description: >
            Version denotes the version of the schema specification. This
            property is contextual based on the schema

            type, for example openapi schemas will contain the OpenAPI
            specification version (currently only 3.0.x is

            supported), but `grpc` APIs could be "proto2" or "proto3".
          type: string
        url:
          description: >
            URL is the private address for accessing the schema. This is not
            guaranteed to be publicly accessible and

            could be a non-HTTP protocol (i.e. gs:// or s3://)
          type: string
      required:
        - type
        - version
        - url
    Schema:
      type: object
      properties:
        id:
          type: string
        type:
          description: >
            Type denotes the type of schema the corresponding App is backed by.
            Currently the only supported value is

            "openapi", but other types such as "soap", "graphql" and "grpc" are
            on the roadmap.
          type: string
        version:
          description: >
            Version denotes the version of the schema specification. This
            property is contextual based on the schema

            type, for example openapi schemas will contain the OpenAPI
            specification version (currently only 3.0.x is

            supported), but `grpc` APIs could be "proto2" or "proto3".
          type: string
        sourceUrl:
          description: >
            URL is the private address for accessing the schema. This is not
            guaranteed to be publicly accessible and

            could be a non-HTTP protocol (i.e. gs:// or s3://)
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
      required:
        - id
        - type
        - version
        - sourceUrl
        - createdAt
        - updatedAt
    AppAuthConfigData:
      type: object
      description: >
        AppAuthConfigData should JSON-marshal to one of the types specified in
        the jsonschema oneOf:


        - AppAuthConfigOIDC

        - AppAuthConfigOAuth2

        - AppAuthConfigApiKey

        - AppAuthConfigHTTPRefresh

        - AppAuthConfigHTTPBasicAuth

        - AppAuthConfigJWTBearer

        - AppAuthConfigCustomFunction
      oneOf:
        - $ref: '#/components/schemas/AppAuthConfigOIDC'
        - $ref: '#/components/schemas/AppAuthConfigOAuth2'
        - $ref: '#/components/schemas/AppAuthConfigApiKey'
        - $ref: '#/components/schemas/AppAuthConfigHTTPRefresh'
        - $ref: '#/components/schemas/AppAuthConfigHTTPBasicAuth'
        - $ref: '#/components/schemas/AppAuthConfigJWTBearer'
        - $ref: '#/components/schemas/AppAuthConfigCustomFunction'
    AppAuthConfigOIDC:
      description: >
        AppAuthConfigOIDC specifies the configuration for authenticating using
        the OpenID Connect specification.
      type: object
      properties:
        discoveryUrl:
          description: >-
            Takes precedent over the endpoint properties. If this property is
            set, it will be queried and override any defined endpoint
            properties.
          type: string
        clientId:
          type: string
        clientSecret:
          description: >
            ClientSecret is the OAuth2.0 client's secret. This should be
            write-only, and not be viewable after

            creation.
          type: string
        scopes:
          $ref: '#/components/schemas/Scopes'
    AppAuthConfigOAuth2:
      type: object
      properties:
        flowType:
          type: string
          enum:
            - authorization_code
            - client_credentials
            - resource_owner_password
          description: >
            FlowType is the type of OAuth2 Flow supported. Valid values are
            `authorization_code` and `client_credentials` and
            `resource_owner_password`.
        authorizationEndpoint:
          type: string
        tokenEndpoint:
          type: string
        username:
          type: string
        password:
          type: string
        clientId:
          type: string
        clientSecret:
          description: >
            ClientSecret is the OAuth2.0 client's secret. This should be
            write-only, and not be viewable after

            creation.
          type: string
        scopes:
          $ref: '#/components/schemas/Scopes'
    AppAuthConfigApiKey:
      type: object
      properties:
        name:
          description: >
            Name is the header, query param or cookie name which the API key
            should be provided as.
          type: string
        in:
          description: >
            In denotes where the API key should be set when calling the API.
            Possible values are: `"query"`,

            `"header"` or `"cookie"`.
          type: string
      required:
        - name
        - in
    AppAuthConfigHTTPRefresh:
      type: object
      properties:
        tokenEndpoint:
          description: |
            TokenEndpoint is the URL to use to Request a token.
          type: string
        method:
          description: The http method to use for the token request.
          type: string
          enum:
            - GET
            - PUT
            - POST
            - DELETE
            - OPTIONS
            - HEAD
            - PATCH
            - TRACE
        tokenTTL:
          description: >
            TokenTTL is the duration in seconds for a token to last before
            refreshing to get a new one.
          type: integer
          x-go-type: int64
        secretIn:
          description: >
            SecretIn denotes where the client secret should be set when calling
            the API. Possible values are: `"header"` or `"body"`.
          type: string
        headerDestination:
          description: >
            HeaderDestination is used if `"in"` is set to `"header"` to specify
            the header key for the ClientSecret data to be sent with.

            This can be empty if the `"in"` is not set to `"header"`.
          type: string
        headers:
          description: >
            Headers is a list of static headers to send along with the token
            request.
          type: object
          x-go-type: map[string][]string
          example:
            headers:
              summary: Example headers to send
              value: Payload `{"header1":["value1","value2"],"header2":["value3"]}`
        selector:
          description: >
            Selector is an expression to evaluate to obtain the token from the
            Response returned from the TokenEndpoint.

            This always extracts from the body response from the TokenEndpoint.
          type: string
          example:
            token contained in a single level field:
              summary: Extracting token from response `{"tok""my_token"}`
              value: tok
            token contained in a nested field:
              summary: Extracting token from response `{"result"`:{"tok""my_token"}}`
              value: result.tok
        name:
          description: >
            Name is the header, query param or cookie name which the token
            should be provided as.
          type: string
        in:
          description: >
            In denotes where the token should be set when calling the API.
            Possible values are: `"query"`,

            `"header"` or `"cookie"`.
          type: string
        prefix:
          description: >
            Prefix contains any prefix that should be used to set the token in
            the header, such as `"Bearer"`.
          type: string
      required:
        - tokenEndpoint
        - method
        - tokenTTL
        - secretIn
        - selector
        - name
        - in
        - prefix
    AppAuthConfigHTTPBasicAuth:
      type: object
      properties:
        user:
          description: |
            User is the identifier to perform the basic authentication.
          type: string
        password:
          description: |
            Password is the secret used to perform the basic authentication.
          type: string
      required:
        - user
        - password
    AppAuthConfigJWTBearer:
      type: object
      properties:
        payload:
          description: |
            Payload is the JWT payload.
          type: object
          x-go-type: map[string]interface{}
        secret:
          description: |
            The secret used to sign the JWT.
          type: string
        algorithm:
          description: |
            The algorithm used to sign the JWT.
          type: string
        prefix:
          description: >
            The prefix of the JWT in the header. Defaults to "Bearer" if not
            set.
          type: string
        expiresIn:
          description: |
            The duration for a token to last before refreshing to get a new one.
          type: string
      required:
        - algorithm
    AppAuthConfigCustomFunction:
      type: object
      properties:
        function_url:
          description: The url to the function to call to authenticate the request.
          type: string
      required:
        - function_url
    Scopes:
      description: >
        Scopes is a map of scopes this API supports, with the scope name as keys
        and a description as the value.

        It may not be required to specify them all to connect the App.
      type: object
      x-go-type: map[string]string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization

````