> ## 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.

# Import a product feed from a URL

> Downloads a Google Merchant Center product feed from a URL and imports it into the catalog.

The feed is downloaded during the request, so the response can take several seconds. The import itself runs in the background, in the same way as for an uploaded `.xml` file. To track it, use [Check import status](/docs/api/product-directory/catalog/check-import-status) with the returned `job_id`. If the organization has no catalog, this method creates one.

The URL is saved for the catalog, and the feed is turned on so that it's refreshed automatically. To replace the saved URL, call this method again with a new URL. Each call starts a new import. To stop automatic refreshes, use [Turn a catalog feed on or off](/docs/api/product-directory/catalog/turn-a-catalog-feed-on-or-off).

A feed that is on is refreshed about once an hour. If a refresh can't download the feed or the feed isn't valid, the catalog doesn't change. If the import of a downloaded feed fails, products that were imported before the failure stay in the catalog. The next refresh tries again.

Each refresh is merged into the catalog in the same way as an upload. For the merge rules, see [Catalog updates](/docs/api/product-directory#catalog-updates).

The feed must be in the <a href="https://support.google.com/merchants/answer/7052112" target="_blank" rel="noreferrer">Google Merchant Center format</a> and can be up to 50MB. If the feed is rejected, the catalog doesn't change.

**Required scopes:** `accounts--my:ro`


## OpenAPI

````yaml /api/product-directory/openapi.json put /v1/catalogs/feed
openapi: 3.0.0
info:
  title: Product Directory API
  description: >-
    A service for uploading and managing a product catalog for use by an AI
    Agent.
  version: 1.0.0
servers:
  - url: https://api.text.com/product-directory
    description: Main production server URL
security:
  - PersonalAccessToken: []
paths:
  /v1/catalogs/feed:
    put:
      tags:
        - Catalog
      summary: Import a product feed from a URL
      description: >-
        Downloads a Google Merchant Center product feed from a URL and imports
        it into the catalog.


        The feed is downloaded during the request, so the response can take
        several seconds. The import itself runs in the background, in the same
        way as for an uploaded `.xml` file. To track it, use [Check import
        status](/docs/api/product-directory/catalog/check-import-status) with
        the returned `job_id`. If the organization has no catalog, this method
        creates one.


        The URL is saved for the catalog, and the feed is turned on so that it's
        refreshed automatically. To replace the saved URL, call this method
        again with a new URL. Each call starts a new import. To stop automatic
        refreshes, use [Turn a catalog feed on or
        off](/docs/api/product-directory/catalog/turn-a-catalog-feed-on-or-off).


        A feed that is on is refreshed about once an hour. If a refresh can't
        download the feed or the feed isn't valid, the catalog doesn't change.
        If the import of a downloaded feed fails, products that were imported
        before the failure stay in the catalog. The next refresh tries again.


        Each refresh is merged into the catalog in the same way as an upload.
        For the merge rules, see [Catalog
        updates](/docs/api/product-directory#catalog-updates).


        The feed must be in the <a
        href="https://support.google.com/merchants/answer/7052112"
        target="_blank" rel="noreferrer">Google Merchant Center format</a> and
        can be up to 50MB. If the feed is rejected, the catalog doesn't change.
      operationId: import-a-product-feed-from-a-url
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportFeedRequest'
            example:
              url: https://shop.example.com/feeds/google.php?lang=en
      responses:
        '202':
          description: The feed was downloaded and the import job was queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadCatalogResponse'
              example:
                job_id: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: Missing or invalid token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  type: authentication
                  message: No Authorization header.
        '413':
          description: The feed exceeds 50MB, or exceeds 50MB after it's converted to JSON.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  type: entity_too_large
                  message: max_file_size_exceeded
        '422':
          description: >-
            The URL isn't allowed, the feed can't be downloaded, or the
            downloaded content isn't a valid feed.


            For `fetch_failed`, `data.reason` is one of:


            - `dns_error`

            - `connection_failed`

            - `timeout`

            - `status_<code>`, for example `status_404`

            - `response_too_large`

            - `address_not_allowed`

            - `too_many_redirects`

            - `invalid_redirect`


            For `invalid_file`, `data.reason` describes the problem. It's
            intended for people and can change, so don't compare it in code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_url:
                  summary: URL isn't allowed
                  value:
                    error:
                      type: validation
                      message: invalid_url
                fetch_failed:
                  summary: Feed can't be downloaded
                  value:
                    error:
                      type: validation
                      message: fetch_failed
                      data:
                        reason: status_404
                invalid_file:
                  summary: Content isn't a valid feed
                  value:
                    error:
                      type: validation
                      message: invalid_file
                      data:
                        reason: root element must be <rss>, got <html>
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    ImportFeedRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: >-
            The absolute `http` or `https` URL of the feed. The URL must use the
            default port (80 or 443), must not contain credentials, and must
            point to a public address. The same rules apply to redirect targets.
    UploadCatalogResponse:
      type: object
      required:
        - job_id
      properties:
        job_id:
          type: string
          format: uuid
          description: Unique import job identifier. Use it to poll `Check import status`.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              description: The error category.
            message:
              type: string
              description: A message describing the error.
            data:
              type: object
              description: Additional error details, if available.
              properties:
                reason:
                  type: string
                  description: The cause of the error.
  responses:
    TooManyRequests:
      description: >-
        Too many requests were sent in a short time. Wait for the number of
        seconds in the `Retry-After` header, then send the request again.
      headers:
        Retry-After:
          description: The number of seconds to wait before you send the request again.
          schema:
            type: integer
          example: 12
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: too_many_requests
              message: Too many requests
  securitySchemes:
    PersonalAccessToken:
      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="/docs/authentication/personal-access-tokens">personal access
        tokens guide</a>.
      type: http
      scheme: basic

````

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