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

# Update an existing connection

> Returns the url that can be used by your client to update the connection



## OpenAPI

````yaml patch /consumers/{consumer_id}/connections/{connectionid}
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/connections/{connectionid}:
    patch:
      tags:
        - Connections
      summary: Update an existing connection
      description: Returns the url that can be used by your client to update the connection
      operationId: connections_update_connection
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
        - name: connectionid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Connectionid
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/PatchConnectionItem'
                - type: 'null'
              title: Item
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkItem'
        '400':
          content:
            application/json:
              examples:
                Could not retrieve connections:
                  value:
                    message: Existing connections could not be retrived
                    status: error
                Invalid connectionid:
                  value:
                    message: The specified connectionid is not valid
                    status: error
                Missing credentials:
                  value:
                    message: Missing at least one credential for this integration
                    status: error
                Missing postconnection value:
                  value:
                    message: >-
                      Missing at least one post connection value for this
                      integration. When providing post connection values, make
                      sure to provide all mandatory post connection values.
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              example:
                message: The connection does not exist
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          content:
            application/json:
              example:
                message: Invalid datetime format in key {key}
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Unprocessable Entity
      security:
        - mcp_auth:
            - connections
components:
  schemas:
    PatchConnectionItem:
      properties:
        redirect:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Redirect
          description: >-
            Indicates whether you want to return to the consumer's redirectUrl
            after update (true) or whether you want to return on the connection
            page (false)
          default: false
        name:
          anyOf:
            - type: string
              maxLength: 80
            - type: 'null'
          title: Name
          description: Can be used to update the name of an existing connection
        credentials:
          anyOf:
            - items:
                $ref: '#/components/schemas/CredentialItem'
              type: array
            - type: 'null'
          title: Credentials
          description: >-
            Can be used to update the credentials of an existing connection.
            Please use the getIntegrations route to see the available
            credentials for each integration. Note: The preferred approach to
            let a consumer change their credentials is to call this endpoint
            without passing credentials in the body of the request, which will
            return a link that can be reshared with the consumer to update their
            credentials through the Chift UI.
      type: object
      title: PatchConnectionItem
    LinkItem:
      properties:
        url:
          type: string
          title: Url
      type: object
      required:
        - url
      title: LinkItem
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
      type: object
      required:
        - message
      title: ChiftError
    CredentialItem:
      properties:
        key:
          type: string
          title: Key
        value:
          type: string
          title: Value
      type: object
      required:
        - key
        - value
      title: CredentialItem
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````