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

# Create temporary channel connection link

> Use when the user asks to add or reconnect an Instagram, Messenger or WhatsApp channel. A current business-admin-owned credential is required. Give connectionUrl to the human admin, who signs in, grants provider consent and selects resources in the browser. MCP never collects provider passwords. Link expiry is 15 minutes. Reuse exact type and idempotencyKey on uncertain creation retries for 24 hours; a changed type conflicts. Link creation does not connect a channel. Save attemptId and call get_channel_connection_attempt for actual completion, channelIds or failureCode. Existing grants are never widened. Reconnecting the same provider resource uses native upsert behavior; choosing a different resource can create another channel. Requires `channels:connect:write`.



## OpenAPI

````yaml /openapi.json post /channels/connection-attempts
openapi: 3.0.3
info:
  title: Visito M2M API
  version: 1.0.0
  description: >-
    Tenant-scoped server-to-server API for channels, conversations, commerce,
    custom AI tools, and WhatsApp templates. Send operations are asynchronous
    and return queued acknowledgements. Expansion adds conversation controls,
    knowledge, sales opportunities, delivery status, reporting, and signed
    webhooks.
servers:
  - url: https://platform-api.visitoai.com/m2m/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Channels
  - name: Conversations
  - name: Commerce
  - name: Custom tools
  - name: WhatsApp templates
  - name: Properties
  - name: Knowledge
  - name: Sales CRM
  - name: Delivery
  - name: Reporting
  - name: Webhooks
paths:
  /channels/connection-attempts:
    post:
      tags:
        - Channels
      summary: Create temporary channel connection link
      description: >-
        Use when the user asks to add or reconnect an Instagram, Messenger or
        WhatsApp channel. A current business-admin-owned credential is required.
        Give connectionUrl to the human admin, who signs in, grants provider
        consent and selects resources in the browser. MCP never collects
        provider passwords. Link expiry is 15 minutes. Reuse exact type and
        idempotencyKey on uncertain creation retries for 24 hours; a changed
        type conflicts. Link creation does not connect a channel. Save attemptId
        and call get_channel_connection_attempt for actual completion,
        channelIds or failureCode. Existing grants are never widened.
        Reconnecting the same provider resource uses native upsert behavior;
        choosing a different resource can create another channel. Requires
        `channels:connect:write`.
      operationId: create_channel_connection_link
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Stable caller-generated key for this type and intended business.
            Reuse with the exact input on creation retry; retain attemptId to
            reconcile. Deduplication lasts 24 hours.
          schema:
            type: string
            minLength: 8
            maxLength: 128
            pattern: ^[A-Za-z0-9._:-]{8,128}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - instagram
                    - messenger
                    - whatsapp
                  description: >-
                    Supported Meta channel type. Read
                    get_channel_connection_options for human requirements.
              additionalProperties: false
              required:
                - type
      responses:
        '200':
          description: Create temporary channel connection link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelConnectionAttempt'
        default:
          $ref: '#/components/responses/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    ChannelConnectionAttempt:
      type: object
      properties:
        attemptId:
          type: string
        tenantId:
          type: string
        type:
          type: string
          enum:
            - instagram
            - messenger
            - whatsapp
        provider:
          type: string
          enum:
            - meta
        status:
          type: string
          enum:
            - pending
            - authorizing
            - processing
            - selecting
            - completed
            - partial
            - failed
            - expired
        expiresAt:
          type: string
          format: date-time
        channelIds:
          type: array
          items:
            type: string
          maxItems: 100
        failureCode:
          type: string
        nextAction:
          type: string
        connectionUrl:
          type: string
          format: uri
          description: >-
            Temporary browser link. Share with the intended business admin; do
            not log, index or expose to third parties.
        failures:
          type: array
          maxItems: 100
          description: >-
            Saved failed provider resources and safe reason codes. Resolve
            ownership_conflict with the owning business; missing_messaging_task
            requires provider messaging permission; activation_failed requires
            WhatsApp activation checks; persistence failures require
            reconciliation before another attempt. Raw provider text is omitted.
          items:
            type: object
            properties:
              resourceId:
                type: string
              reason:
                type: string
                enum:
                  - ownership_conflict
                  - missing_messaging_task
                  - activation_failed
                  - channel_upsert_failed
                  - binding_write_failed
                  - resource_failed
            required:
              - resourceId
              - reason
            additionalProperties: false
      additionalProperties: false
      required:
        - attemptId
        - tenantId
        - type
        - provider
        - status
        - expiresAt
        - channelIds
        - nextAction
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: M2M_AUTH_INSUFFICIENT_SCOPE
            message:
              type: string
            details:
              type: object
              additionalProperties: true
      example:
        error:
          code: M2M_AUTH_INSUFFICIENT_SCOPE
          message: M2M credential does not have required scope.
          details:
            requiredScopes:
              - conversations:write
            missingScopes:
              - conversations:write
  responses:
    Error:
      description: Structured error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Visito M2M API key
      description: Server-side tenant-scoped credential created from Build > API Keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.