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

# Create a draft connection definition



## OpenAPI

````yaml /api-reference/openapi.json post /v2/admin/connections/definitions
openapi: 3.1.0
info:
  title: Base39 API
  description: Base39 API
  version: 1.0.0
  contact:
    name: Base39 Team
    url: https://base39.com.br
    email: suporte@base39.com.br
  termsOfService: https://base39.com.br/termos
  license:
    name: Proprietary
    url: https://base39.com.br/termos
servers:
  - url: http://localhost:3000
    description: Local
  - url: https://api.dev.base39.cloud
    description: Development
  - url: https://api.base39.com.br
    description: Production
security:
  - OAuth2: []
tags:
  - name: pages
    description: Profiles and reports pages
  - name: pipelines
    description: Pipeline boards (kanban) of pages
  - name: blocks
    description: Blocks operations
  - name: search
    description: Search across content
  - name: targets
    description: Lookup targets via datasets
  - name: CognitoTriggers
    description: Cognito triggers
paths:
  /v2/admin/connections/definitions:
    post:
      tags:
        - connections-admin
      summary: Create a draft connection definition
      operationId: connections_admin_create_definition
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectionDefinitionInput'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionDefinitionOutput'
components:
  schemas:
    CreateConnectionDefinitionInput:
      type: object
      properties:
        slug:
          type: string
        name:
          type: string
        description:
          type: string
        developer_name:
          type: string
        icon_url:
          type: string
        app:
          $ref: '#/components/schemas/ConnectionDefinitionAppInput'
        visibility:
          type: string
          enum:
            - public
            - private
            - internal
        status:
          type: string
          enum:
            - draft
            - active
            - disabled
            - archived
        adapter:
          $ref: '#/components/schemas/ConnectionDefinitionAdapterInput'
        supported_account_scopes:
          type: array
          items:
            type: string
            enum:
              - cross-org
              - org
              - user
        category:
          type: string
        sort_order:
          type: number
        connection_type:
          type: string
          enum:
            - app
            - mcp
            - ai
            - api
            - webhook
            - channel
        origin:
          type: string
          enum:
            - base39
            - partner
            - custom
        installation_method:
          type: string
          enum:
            - oauth
            - static
            - task_id
        mcp_catalog:
          type: object
        tool_policy:
          type: object
        allowed_tools:
          type: array
          items:
            type: string
        allowed_actions:
          type: array
          items:
            type: string
        allowed_triggers:
          type: array
          items:
            type: string
        risk_summary:
          type: object
        settings_schema:
          type: object
      required:
        - slug
        - name
        - app
        - adapter
        - supported_account_scopes
        - connection_type
        - origin
        - installation_method
    ConnectionDefinitionOutput:
      type: object
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        developer_name:
          type: string
          nullable: true
        icon_url:
          type: string
          nullable: true
        method:
          type: string
        status:
          type: string
        visibility:
          type: string
        supported_account_scopes:
          type: array
          items:
            type: string
        category:
          type: string
          nullable: true
        installed:
          type: boolean
        connection_type:
          type: string
          enum:
            - app
            - mcp
            - ai
            - api
            - webhook
            - channel
        origin:
          type: string
          enum:
            - base39
            - partner
            - custom
        installation_method:
          type: string
        connect_strategy:
          type: string
          enum:
            - connect_link
            - install
        reconciles_on_connect:
          type: boolean
        loads_external_identities:
          type: boolean
        mcp_catalog:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConnectionMcpCatalogOutput'
        static_credential_params:
          type: array
          items:
            $ref: '#/components/schemas/StaticCredentialParamSpecOutput'
        settings_schema:
          type: object
          nullable: true
      required:
        - id
        - slug
        - name
        - description
        - developer_name
        - icon_url
        - method
        - status
        - visibility
        - supported_account_scopes
        - category
        - installed
        - connection_type
        - origin
        - installation_method
        - connect_strategy
        - reconciles_on_connect
        - loads_external_identities
        - static_credential_params
    ConnectionDefinitionAppInput:
      type: object
      properties:
        slug:
          type: string
        name:
          type: string
        description:
          type: string
        developer_name:
          type: string
        icon_url:
          type: string
        visibility:
          type: string
          enum:
            - public
            - private
            - internal
        category:
          type: string
        origin:
          type: string
          enum:
            - base39
            - partner
            - custom
        domain:
          type: string
        sort_order:
          type: number
      required:
        - slug
        - name
        - origin
    ConnectionDefinitionAdapterInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - native
            - pipedream
        key:
          type: string
        app:
          type: string
        auth:
          type: object
        member_sync:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionMemberSyncInput'
      required:
        - type
        - auth
    ConnectionMcpCatalogOutput:
      type: object
      properties:
        server_instructions:
          type: string
          nullable: true
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionMcpCatalogToolOutput'
        prompts:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionMcpCatalogPromptOutput'
        resources:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionMcpCatalogResourceOutput'
        resource_templates:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionMcpCatalogResourceTemplateOutput'
      required:
        - server_instructions
        - tools
        - prompts
        - resources
        - resource_templates
    StaticCredentialParamSpecOutput:
      type: object
      properties:
        in:
          type: string
          enum:
            - header
            - query
            - body
        key:
          type: string
        label:
          type: string
        secret:
          type: boolean
      required:
        - in
        - key
    ConnectionMemberSyncInput:
      type: object
      properties:
        task_id:
          type: string
        'on':
          type: array
          items:
            type: string
        identity:
          type: object
      required:
        - task_id
        - 'on'
        - identity
    ConnectionMcpCatalogToolOutput:
      type: object
      properties:
        name:
          type: string
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        input_schema:
          type: object
        output_schema:
          type: object
          nullable: true
        annotations:
          type: object
          nullable: true
        risk:
          type: string
          enum:
            - read
            - write
            - write_external
            - destructive
            - permission_change
            - financial
            - bulk_write
      required:
        - name
        - title
        - description
        - input_schema
        - output_schema
        - annotations
        - risk
    ConnectionMcpCatalogPromptOutput:
      type: object
      properties:
        name:
          type: string
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        arguments:
          nullable: true
          type: array
          items:
            type: object
      required:
        - name
        - title
        - description
        - arguments
    ConnectionMcpCatalogResourceOutput:
      type: object
      properties:
        uri:
          type: string
        name:
          type: string
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        mime_type:
          type: string
          nullable: true
      required:
        - uri
        - name
        - title
        - description
        - mime_type
    ConnectionMcpCatalogResourceTemplateOutput:
      type: object
      properties:
        uri_template:
          type: string
        name:
          type: string
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        mime_type:
          type: string
          nullable: true
      required:
        - uri_template
        - name
        - title
        - description
        - mime_type
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://id.local.base39.cloud/oauth2/authorize
          tokenUrl: https://id.local.base39.cloud/oauth2/token
          scopes:
            profile: Read user profile
            email: Read user email
            openid: OpenID authentication
      description: OAuth2 Authorization Code flow

````