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

# Register AI Referrals Connection

> Register an AI Referrals push connection for a (brand, website, provider) tuple. Events can only be pushed once a connection exists.

A brand cannot have both a Google Analytics integration and an active AI Referrals push connection for the same website — the conflicting integration must be disabled first.

MVP provider allow-list: `adobe_analytics`.



## OpenAPI

````yaml /api-reference/openapi.json post /{brand_id}/ai-referrals/connections
openapi: 3.1.0
info:
  title: Scrunch Data API
  version: 0.1.0
servers:
  - url: https://api.scrunchai.com/v1
security: []
paths:
  /{brand_id}/ai-referrals/connections:
    post:
      tags:
        - ai-referrals
      summary: Register AI Referrals Connection
      description: >-
        Register an AI Referrals push connection for a (brand, website,
        provider) tuple. Events can only be pushed once a connection exists.


        A brand cannot have both a Google Analytics integration and an active AI
        Referrals push connection for the same website — the conflicting
        integration must be disabled first.


        MVP provider allow-list: `adobe_analytics`.
      operationId: registerAiReferralsConnection
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: integer
            title: Brand Id
          description: The unique identifier for the brand.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiReferralsConnectionCreate'
      responses:
        '201':
          description: Connection registered.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiReferralsConnection'
        '400':
          description: Invalid provider or payload.
        '409':
          description: >-
            A connection or conflicting integration already exists for this
            (brand, website).
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer:
            - configure
components:
  schemas:
    AiReferralsConnectionCreate:
      type: object
      description: Payload to register a new AI Referrals connection.
      required:
        - website
        - provider
      properties:
        website:
          type: string
          minLength: 1
          maxLength: 2048
          description: Hostname or URL of the website whose referrals will be pushed.
          example: example.com
        provider:
          type: string
          minLength: 1
          maxLength: 64
          description: 'Source analytics provider. MVP allow-list: ''adobe_analytics''.'
          example: adobe_analytics
    AiReferralsConnection:
      type: object
      description: A registered AI Referrals push connection.
      properties:
        id:
          type: string
          description: ULID identifier for the connection.
        brand_id:
          type: integer
        website:
          type: string
          description: >-
            Hostname or URL of the website whose referrals are pushed against
            this connection.
        provider:
          type: string
          description: 'Source analytics provider. MVP allow-list: ''adobe_analytics''.'
          example: adobe_analytics
        status:
          type: string
          enum:
            - active
            - disabled
        created_at:
          type: string
          format: date-time
        last_pushed_at:
          type:
            - string
            - 'null'
          format: date-time
        last_push_error:
          type:
            - string
            - 'null'
      required:
        - id
        - brand_id
        - website
        - provider
        - status
        - created_at
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````