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

# Upsert Global Connection



## OpenAPI

````yaml POST /v1/global-connections
openapi: 3.0.3
info:
  title: NRAI Documentation
  version: 0.0.0
servers:
  - url: https://cloud.nrai.io/api
    description: Production Server
security: []
externalDocs:
  url: https://nrai.io/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:
                      allOf:
                        - type: object
                          additionalProperties: {}
                        - type: object
                          additionalProperties: {}
                    type:
                      type: string
                      enum:
                        - SECRET_TEXT
                    value:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - SECRET_TEXT
                        secret_text:
                          minLength: 1
                          type: string
                      required:
                        - type
                        - secret_text
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    metadata:
                      allOf:
                        - type: object
                          additionalProperties: {}
                        - type: object
                          additionalProperties: {}
                    type:
                      type: string
                      enum:
                        - OAUTH2
                    value:
                      type: object
                      properties:
                        client_id:
                          minLength: 1
                          type: string
                        code:
                          minLength: 1
                          type: string
                        code_challenge:
                          type: string
                        scope:
                          type: string
                        authorization_method:
                          anyOf:
                            - type: string
                              enum:
                                - HEADER
                            - type: string
                              enum:
                                - BODY
                        client_secret:
                          minLength: 1
                          type: string
                        grant_type:
                          anyOf:
                            - type: string
                              enum:
                                - authorization_code
                            - type: string
                              enum:
                                - client_credentials
                        props:
                          type: object
                          additionalProperties: {}
                        redirect_url:
                          minLength: 1
                          type: string
                        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
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    metadata:
                      allOf:
                        - type: object
                          additionalProperties: {}
                        - type: object
                          additionalProperties: {}
                    type:
                      type: string
                      enum:
                        - CLOUD_OAUTH2
                    value:
                      type: object
                      properties:
                        client_id:
                          minLength: 1
                          type: string
                        code:
                          minLength: 1
                          type: string
                        code_challenge:
                          type: string
                        scope:
                          type: string
                        authorization_method:
                          anyOf:
                            - type: string
                              enum:
                                - HEADER
                            - type: string
                              enum:
                                - BODY
                        props:
                          type: object
                          additionalProperties:
                            type: string
                        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
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    metadata:
                      allOf:
                        - type: object
                          additionalProperties: {}
                        - type: object
                          additionalProperties: {}
                    type:
                      type: string
                      enum:
                        - PLATFORM_OAUTH2
                    value:
                      type: object
                      properties:
                        client_id:
                          minLength: 1
                          type: string
                        code:
                          minLength: 1
                          type: string
                        code_challenge:
                          type: string
                        scope:
                          type: string
                        authorization_method:
                          anyOf:
                            - type: string
                              enum:
                                - HEADER
                            - type: string
                              enum:
                                - BODY
                        props:
                          type: object
                          additionalProperties:
                            type: string
                        type:
                          type: string
                          enum:
                            - PLATFORM_OAUTH2
                        redirect_url:
                          minLength: 1
                          type: string
                      required:
                        - client_id
                        - code
                        - scope
                        - type
                        - redirect_url
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    metadata:
                      allOf:
                        - type: object
                          additionalProperties: {}
                        - type: object
                          additionalProperties: {}
                    type:
                      type: string
                      enum:
                        - BASIC_AUTH
                    value:
                      type: object
                      properties:
                        username:
                          minLength: 1
                          type: string
                        password:
                          minLength: 1
                          type: string
                        type:
                          type: string
                          enum:
                            - BASIC_AUTH
                      required:
                        - username
                        - password
                        - type
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    metadata:
                      allOf:
                        - type: object
                          additionalProperties: {}
                        - type: object
                          additionalProperties: {}
                    type:
                      type: string
                      enum:
                        - CUSTOM_AUTH
                    value:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - CUSTOM_AUTH
                        props:
                          type: object
                          additionalProperties: {}
                      required:
                        - type
                        - props
                    scope:
                      type: string
                      enum:
                        - PLATFORM
                    projectIds:
                      type: array
                      items:
                        type: string
                    externalId:
                      type: string
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
                - type: object
                  properties:
                    displayName:
                      type: string
                    pieceName:
                      type: string
                    metadata:
                      allOf:
                        - type: object
                          additionalProperties: {}
                        - type: object
                          additionalProperties: {}
                    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
                  required:
                    - displayName
                    - pieceName
                    - type
                    - value
                    - scope
                    - projectIds
      responses:
        '201':
          description: App connection is a connection to an external app.
          content:
            application/json:
              schema:
                description: App connection is a connection to an external app.
                type: object
                properties:
                  id:
                    type: string
                  created:
                    type: string
                  updated:
                    type: string
                  externalId:
                    type: string
                  displayName:
                    type: string
                  type:
                    anyOf:
                      - type: string
                        enum:
                          - OAUTH2
                      - type: string
                        enum:
                          - PLATFORM_OAUTH2
                      - type: string
                        enum:
                          - CLOUD_OAUTH2
                      - type: string
                        enum:
                          - SECRET_TEXT
                      - type: string
                        enum:
                          - BASIC_AUTH
                      - type: string
                        enum:
                          - CUSTOM_AUTH
                      - type: string
                        enum:
                          - NO_AUTH
                  pieceName:
                    type: string
                  projectIds:
                    type: array
                    items:
                      pattern: ^[0-9a-zA-Z]{21}$
                      type: string
                  platformId:
                    type: string
                    nullable: true
                  scope:
                    anyOf:
                      - type: string
                        enum:
                          - PROJECT
                      - type: string
                        enum:
                          - PLATFORM
                  status:
                    anyOf:
                      - type: string
                        enum:
                          - ACTIVE
                      - type: string
                        enum:
                          - MISSING
                      - type: string
                        enum:
                          - ERROR
                  ownerId:
                    type: string
                    nullable: true
                  owner:
                    type: object
                    properties:
                      id:
                        type: string
                      email:
                        type: string
                      firstName:
                        type: string
                      status:
                        anyOf:
                          - type: string
                            enum:
                              - ACTIVE
                          - type: string
                            enum:
                              - INACTIVE
                      externalId:
                        type: string
                        nullable: true
                      lastChangelogDismissed:
                        type: string
                        nullable: true
                      platformId:
                        type: string
                        nullable: true
                      platformRole:
                        anyOf:
                          - type: string
                            enum:
                              - ADMIN
                          - type: string
                            enum:
                              - MEMBER
                          - type: string
                            enum:
                              - OPERATOR
                      lastName:
                        type: string
                      created:
                        type: string
                      updated:
                        type: string
                    required:
                      - id
                      - email
                      - firstName
                      - status
                      - platformRole
                      - lastName
                      - created
                      - updated
                    nullable: true
                  metadata:
                    type: object
                    nullable: true
                    additionalProperties: {}
                  flowIds:
                    type: array
                    items:
                      pattern: ^[0-9a-zA-Z]{21}$
                      type: string
                    nullable: true
                required:
                  - id
                  - created
                  - updated
                  - externalId
                  - displayName
                  - type
                  - pieceName
                  - projectIds
                  - scope
                  - status
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      description: Use your api key generated from the admin console
      scheme: bearer

````