> ## 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 one of the brand's websites to send AI referral rows for. Rows can only be sent once a connection exists.

A website reads from one source at a time: one with Google Analytics connected, or an active connection already, returns `409`.

Use provider `custom` for any analytics tool; `adobe_analytics` is also accepted.



## 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 one of the brand's websites to send AI referral rows for. Rows
        can only be sent once a connection exists.


        A website reads from one source at a time: one with Google Analytics
        connected, or an active connection already, returns `409`.


        Use provider `custom` for any analytics tool; `adobe_analytics` is also
        accepted.
      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.
        '404':
          description: Brand not found, or the AI Referrals API isn't enabled for it.
        '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: >-
            Where the data comes from: "custom" for any analytics tool, or
            "adobe_analytics". Both are read the same way.
          example: custom
          enum:
            - custom
            - 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: >-
            Where the data comes from: "custom" for any analytics tool, or
            "adobe_analytics". Both are read the same way.
          example: custom
          enum:
            - custom
            - 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'
        sends_engagement:
          type: boolean
          description: >-
            Whether the connection's rows carry users, engagement and key
            events. Set by its first push.
      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

````

## Related topics

- [List AI Referrals Connections](https://developers.scrunch.com/api-reference/ai-referrals/list-ai-referrals-connections.md)
- [Disable AI Referrals Connection](https://developers.scrunch.com/api-reference/ai-referrals/disable-ai-referrals-connection.md)
- [AI Referrals API: Send traffic from any analytics tool](https://developers.scrunch.com/api-reference/ai-referrals/overview.md)


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