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

# Update Connection

> Updates the specified Connection. You can modify the name, credentials, or other parameters. The request body follows the same structure as the Create Connection endpoint.


<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />

  <img src="https://cdn.peaka.com/badges/project-api-key-badge.png" />
</span>


## OpenAPI

````yaml put /connections/{projectId}/{connectionId}
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /connections/{projectId}/{connectionId}:
    put:
      tags:
        - Connections
      summary: Update Connection
      description: >
        Updates the specified Connection. You can modify the name, credentials,
        or other parameters. The request body follows the same structure as the
        Create Connection endpoint.
      operationId: updateConnection
      parameters:
        - name: projectId
          in: path
          description: ID of the project
          required: true
          schema:
            type: string
          example: mtKDhe1U
        - name: connectionId
          in: path
          description: ID of the connection
          required: true
          schema:
            type: string
          example: 8db17e23-29de-4dab-8886-af9717e0e742
      requestBody:
        description: Connection Request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectionRequest'
            examples:
              HubSpot Connection Request with Oauth:
                description: Sample HubSpot Connection parameters
                value:
                  name: exampleHubspotConnection
                  type: hubspot
                  credential:
                    clientId: 15d6b8c5-48ea-4955-8ce5-d04bb9adad25
                    clientSecret: 64d70b56-ae19-4fee-9fa2-3e9113bcb202
                    refreshToken: eu1-eae3-1af4-583d-91d4-f6414699feea
              Stripe Connection Request:
                description: Sample Stripe Connection parameters
                value:
                  name: exampleStripeConnection21
                  type: stripe
                  credential:
                    token: <stripeToken>
              AirTable Connection Request:
                description: Sample AirTable Connection parameters
                value:
                  name: exampleAirtableConnection
                  type: airtable
                  credential:
                    personalAccessToken: <yourAirtableApiKey>
        required: true
      responses:
        '200':
          description: Connection updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
              examples:
                Updated Connection:
                  description: Updated Connection
                  value:
                    id: 8db17e23-29de-4dab-8886-af9717e0e742
                    name: exampleAirtableConnection
                    type: airtable
components:
  schemas:
    ConnectionRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the connection given by the user
        type:
          type: string
          description: |-
            Type of connection.
             
             Example: airtable for AirTable, stripe for Stripe, hubspot_access_token for HubSpot (with Access Token), etc.

             Exact list can be fetched by following url: /connections/config
        credential:
          type: object
          additionalProperties: true
          description: >
            Credential object for the connection.


            Its structure is dependent on the connection type and can be fetched
            by following url: /connections/config
        connectionCallback:
          type: string
          description: The url to redirect to after an oauth connection is established.
    Connection:
      type: object
      properties:
        id:
          type: string
          description: Connection ID
        name:
          type: string
          description: Name of the connection
        type:
          type: string
          description: >
            Type of connection.


            Example: airtable for AirTable, stripe for Stripe,
            hubspot_access_token for HubSpot (with Access Token), etc.


            Exact list can be fetched by following url: /connections/config
        url:
          type: string
          description: |
            Oauth callback url if the connection is Oauth based.
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' to
        authenticate. Partner API Keys have full access; Project API Keys are
        limited to their project scope. Learn more:
        https://docs.peaka.com/api-reference/authentication
      scheme: bearer
      bearerFormat: Api Key

````