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

# Upsert Connection

> Upsert an app connection based on the app name



## OpenAPI

````yaml POST /v1/app-connections
openapi: 3.1.0
info:
  title: Activepieces Documentation
  version: 0.0.0
servers:
  - url: https://cloud.activepieces.com/api
    description: Production Server
security: []
externalDocs:
  url: https://www.activepieces.com/docs
  description: Find more info here
paths:
  /v1/app-connections:
    post:
      tags:
        - app-connections
      description: Upsert an app connection based on the app name
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - SECRET_TEXT
                    value:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - SECRET_TEXT
                        secret_text:
                          type: string
                          minLength: 1
                      required:
                        - type
                        - secret_text
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                    - value
                  description: Secret Text
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - OAUTH2
                    value:
                      type: object
                      properties:
                        client_id:
                          type: string
                          minLength: 1
                        code:
                          type: string
                          minLength: 1
                        code_challenge:
                          type: string
                        scope:
                          type: string
                        authorization_method:
                          type: string
                          enum:
                            - HEADER
                            - BODY
                        client_secret:
                          type: string
                          minLength: 1
                        grant_type:
                          type: string
                          enum:
                            - authorization_code
                            - client_credentials
                        props:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                        redirect_url:
                          type: string
                          minLength: 1
                        type:
                          type: string
                          enum:
                            - OAUTH2
                      required:
                        - client_id
                        - code
                        - scope
                        - client_secret
                        - redirect_url
                        - type
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                    - value
                  description: OAuth2
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - CLOUD_OAUTH2
                    value:
                      type: object
                      properties:
                        client_id:
                          type: string
                          minLength: 1
                        code:
                          type: string
                          minLength: 1
                        code_challenge:
                          type: string
                        scope:
                          type: string
                        authorization_method:
                          type: string
                          enum:
                            - HEADER
                            - BODY
                        props:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                        type:
                          type: string
                          enum:
                            - CLOUD_OAUTH2
                      required:
                        - client_id
                        - code
                        - scope
                        - type
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                    - value
                  description: Cloud OAuth2
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - PLATFORM_OAUTH2
                    value:
                      type: object
                      properties:
                        client_id:
                          type: string
                          minLength: 1
                        code:
                          type: string
                          minLength: 1
                        code_challenge:
                          type: string
                        scope:
                          type: string
                        authorization_method:
                          type: string
                          enum:
                            - HEADER
                            - BODY
                        props:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                        type:
                          type: string
                          enum:
                            - PLATFORM_OAUTH2
                        redirect_url:
                          type: string
                          minLength: 1
                      required:
                        - client_id
                        - code
                        - scope
                        - type
                        - redirect_url
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                    - value
                  description: Platform OAuth2
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - BASIC_AUTH
                    value:
                      type: object
                      properties:
                        username:
                          type: string
                          minLength: 1
                        password:
                          type: string
                          minLength: 1
                        type:
                          type: string
                          enum:
                            - BASIC_AUTH
                      required:
                        - username
                        - password
                        - type
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                    - value
                  description: Basic Auth
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - CUSTOM_AUTH
                    value:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - CUSTOM_AUTH
                        props:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      required:
                        - type
                        - props
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                    - value
                  description: Custom Auth
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - NO_AUTH
                    value:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - NO_AUTH
                      required:
                        - type
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                    - value
                  description: No Auth
                - type: object
                  properties:
                    externalId:
                      type: string
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    projectId:
                      type: string
                    metadata:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    pieceVersion:
                      type: string
                    type:
                      type: string
                      enum:
                        - PLACEHOLDER
                  required:
                    - externalId
                    - displayName
                    - pieceName
                    - projectId
                    - type
                  description: Placeholder
      responses:
        '200':
          description: Default Response
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      description: Use your api key generated from the admin console
      scheme: bearer

````