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

# Add auto access

> Creates an auto access rule.

An auto access rule is a set of conditions for the tracking URL and geolocation of a customer. Auto access rules are ordered using a linked list; each rule points to the next element via the `next_id` field.

**Required scopes:** `access_rules:rw`


## OpenAPI

````yaml /api/configuration/v3.7/openapi.json post /action/add_auto_access
openapi: 3.1.0
info:
  title: Configuration API
  version: v3.7
servers:
  - url: https://api.livechatinc.com/v3.7/configuration
security:
  - PersonalAccessToken: []
  - OAuth2BearerToken: []
paths:
  /action/add_auto_access:
    post:
      tags:
        - Auto access
      summary: Add auto access
      description: >-
        Creates an auto access rule.


        An auto access rule is a set of conditions for the tracking URL and
        geolocation of a customer. Auto access rules are ordered using a linked
        list; each rule points to the next element via the `next_id` field.
      operationId: add-auto-access
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddAutoAccessRequest'
            example:
              description: Chats on text.com from United States
              access:
                groups:
                  - 1
              conditions:
                domain:
                  values:
                    - value: text.com
                      exact_match: true
                geolocation:
                  values:
                    - country: United States
                      country_code: US
              next_id: 1faad6f5f1d6e8fdf27e8af9839783b7
      responses:
        '200':
          description: Auto access created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddAutoAccessResponse'
              example:
                id: pqi8oasdjahuakndw9nsad9na
components:
  schemas:
    AddAutoAccessRequest:
      type: object
      required:
        - access
        - conditions
      properties:
        access:
          $ref: '#/components/schemas/AutoAccessAccess'
          description: The destination access. Required.
        conditions:
          $ref: '#/components/schemas/AutoAccessConditions'
          description: >-
            The conditions to check. At least one of `url`, `domain`, or
            `geolocation` must be set.
        description:
          type: string
          description: A description of the auto access.
        next_id:
          type: string
          description: >-
            The ID of an existing auto access. Leave empty if the new auto
            access should be the last one in the list.
    AddAutoAccessResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the created auto access.
    AutoAccessAccess:
      type: object
      required:
        - groups
      properties:
        groups:
          type: array
          items:
            type: integer
          description: The destination group IDs.
    AutoAccessConditions:
      type: object
      properties:
        url:
          $ref: '#/components/schemas/UrlCondition'
          description: >-
            The condition that matches on `customer_page.url` from Login or
            `url` from Update Customer Page.
        domain:
          $ref: '#/components/schemas/UrlCondition'
          description: The condition that matches on the domain of the customer URL.
        geolocation:
          $ref: '#/components/schemas/GeolocationCondition'
          description: The condition that matches on the customer's geolocation.
    UrlCondition:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/MatchObject'
          description: A positive match. Cannot be used together with `exclude_values`.
        exclude_values:
          type: array
          items:
            $ref: '#/components/schemas/MatchObject'
          description: A negative match.
    GeolocationCondition:
      type: object
      required:
        - values
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/GeolocationObject'
          description: >-
            An array of geolocation objects. Matches when at least one
            subcondition matches. Each subcondition is fulfilled only when all
            of its specified fields match.
    MatchObject:
      type: object
      required:
        - value
      properties:
        value:
          type: string
          description: A value to match.
        exact_match:
          type: boolean
          description: >-
            If set to `true`: the value must match the customer URL or domain
            exactly. If set to `false`: the value is matched as a substring of
            the customer URL or domain.
          default: false
    GeolocationObject:
      type: object
      properties:
        country:
          type: string
          description: The country name. For example, `"United States"`.
        country_code:
          type: string
          description: The ISO 3166-1 alpha-2 country code. For example, `"US"`.
        region:
          type: string
          description: The region or state name. For example, `"California"`.
        city:
          type: string
          description: The city name. For example, `"Mountain View"`.
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: basic
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
    OAuth2BearerToken:
      type: http
      scheme: bearer
      description: Authenticate using an OAuth 2.0 Bearer token.
      x-example: us-south1:MQraNrGCsoJvtxD7KNJQB1kM3d5

````