> ## 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 Global Connection



## OpenAPI

````yaml POST /v1/global-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/global-connections:
    post:
      tags:
        - global-connections
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      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
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                    preSelectForNewProjects:
                      type: boolean
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      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
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                    preSelectForNewProjects:
                      type: boolean
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      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
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                    preSelectForNewProjects:
                      type: boolean
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      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
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                    preSelectForNewProjects:
                      type: boolean
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      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
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                    preSelectForNewProjects:
                      type: boolean
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      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
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                    preSelectForNewProjects:
                      type: boolean
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      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
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                    preSelectForNewProjects:
                      type: boolean
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app-connection'
      security:
        - apiKey: []
components:
  schemas:
    app-connection:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/app-connection'
      type: object
      properties:
        id:
          type: string
        created:
          type: string
        updated:
          type: string
        externalId:
          type: string
        displayName:
          type: string
        type:
          type: string
          enum:
            - OAUTH2
            - PLATFORM_OAUTH2
            - CLOUD_OAUTH2
            - SECRET_TEXT
            - BASIC_AUTH
            - CUSTOM_AUTH
            - NO_AUTH
        pieceName:
          type: string
        projectIds:
          type: array
          items:
            type: string
            pattern: ^[0-9a-zA-Z]{21}$
        platformId:
          anyOf:
            - type: string
            - type: 'null'
        scope:
          type: string
          enum:
            - PROJECT
            - PLATFORM
        status:
          type: string
          enum:
            - ACTIVE
            - MISSING
            - ERROR
        ownerId:
          anyOf:
            - type: string
            - type: 'null'
        owner:
          anyOf:
            - $ref: '#/components/schemas/user'
            - type: 'null'
        metadata:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties: {}
            - type: 'null'
        flowIds:
          anyOf:
            - type: array
              items:
                type: string
                pattern: ^[0-9a-zA-Z]{21}$
            - type: 'null'
        pieceVersion:
          type: string
        preSelectForNewProjects:
          type: boolean
        usingSecretManager:
          type: boolean
      required:
        - id
        - created
        - updated
        - externalId
        - displayName
        - type
        - pieceName
        - projectIds
        - scope
        - status
        - pieceVersion
        - preSelectForNewProjects
        - usingSecretManager
      additionalProperties: false
    user:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/user'
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        firstName:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        externalId:
          anyOf:
            - type: string
            - type: 'null'
        platformId:
          anyOf:
            - type: string
            - type: 'null'
        platformRole:
          type: string
          enum:
            - ADMIN
            - MEMBER
            - OPERATOR
        lastName:
          type: string
        created:
          type: string
        updated:
          type: string
        lastActiveDate:
          anyOf:
            - type: string
            - type: 'null'
        imageUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - id
        - email
        - firstName
        - status
        - platformRole
        - lastName
        - created
        - updated
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      description: Use your api key generated from the admin console
      scheme: bearer

````