How can a BigCommerce redirect export include resolved dynamic target URLs?

The Citead team, updated

In short. Set include_dynamic_target_urls to true in the BigCommerce redirect export request to add a read-only target URL column.

Definition: BigCommerce's redirect export job accepts include_dynamic_target_urls: true to add a read-only CSV column containing the target URL for dynamic redirects. The option belongs in the export request body and applies to the redirects selected by the job.

Key facts

  • BigCommerce documents the operation as a POST request that creates a new 301 redirects export job in its Create Redirects Export Job reference.
  • The include_dynamic_target_urls field is an optional Boolean with a default of false; setting it to true adds an additional read-only CSV column for dynamic redirect target URLs.
  • BigCommerce's Storefront Routes documentation describes a dynamic redirect as an entity type and entity ID for an existing store resource.
  • BigCommerce's webhook reference says that a manual target has a url, while a dynamic target has an entity_id and a type, such as product, category, brand, page, or post, in its redirect update event documentation.

How do I turn on the extra CSV column?

The export request body carries the option. BigCommerce's Create Redirects Export Job reference lists include_dynamic_target_urls as an optional Boolean, with false as its default. Send true when the CSV should include the additional read-only column containing the target URL for dynamic redirects.

{
  "include_dynamic_target_urls": true
}

The same reference identifies the endpoint as POST https://api.bigcommerce.com/stores/{store_hash}/v3/storefront/redirects/imex/export and says the successful response contains an export job id. The setting controls what the export writes to its CSV output; it is not a redirect creation field.

What does BigCommerce mean by a dynamic target URL?

BigCommerce's GraphQL Storefront API route documentation describes a route response as an entity, a redirect, or nothing when a path has no matching entity or redirect. Its redirect model has two forms. A manual redirect returns a fixed destination URL and may require another route query when that destination leads to another redirect. A dynamic redirect returns the entity type and entity ID of an existing store resource.

The routes documentation names five dynamic redirect types: ProductRedirect, BrandRedirect, BlogPostRedirect, CategoryRedirect, and PageRedirect. With redirectBehavior: FOLLOW, the route response can place the dynamic target entity in node. The webhook documentation uses the REST event representation: a manual target has url, while a dynamic target has entity_id and type. These descriptions explain why the export option refers specifically to a target URL for dynamic redirects rather than a user-entered destination field.

How do I control which redirects the job exports?

The export reference provides two selectors in the same request body. site_id is optional and nullable. Omitting it exports redirects for all sites. redirect_ids is an optional list of integer IDs with an empty list as its default. Omitting redirect IDs exports all redirects for the selected sites.

The option can therefore be combined with the selectors when the CSV should cover a particular site or a chosen set of redirect records. BigCommerce documents the job as a store-level API request authenticated with the X-Auth-Token header, and the request path contains the store's permanent store_hash.

How can I check a resolved value?

BigCommerce's route documentation shows a FOLLOW query that requests both redirect details and the target product node. A spot check can use the path represented by an exported redirect and inspect the returned toUrl, to fragment, and node together:

query {
  site {
    route(path: "/mug" redirectBehavior: FOLLOW) {
      redirect {__typename to {__typename ...on ProductRedirect{entityId path}} toUrl}
      node {
        id
        ... on Product {
          name
        }
      }
    }
  }
}

The documented FOLLOW behavior returns the target entity for a dynamic redirect. The webhook representation supplies site_id, from_path, and the target object, so those fields provide identifiers for matching a redirect record during review. BigCommerce's export reference describes the added column's purpose but does not publish its exact CSV header or a sample row.

FAQ

Does the option add a writable redirect field?

The documented behavior adds an additional read-only CSV column. The request field is an export-job option named include_dynamic_target_urls.

What happens when I omit site_id?

BigCommerce documents site_id as optional and says that omitting it exports redirects for all sites. redirect_ids then limits the records only when a list of IDs is supplied.

Can the route API inspect the dynamic target behind an exported redirect?

Yes. With redirectBehavior: FOLLOW, BigCommerce's route documentation describes a response in which node returns the target entity for a dynamic redirect, while redirect exposes the redirect details.

Does the reference give the CSV column name?

No exact header or sample CSV row is published in the export reference. It describes the output as an additional read-only column containing the target URL for dynamic redirects.

Sources

  1. BigCommerce, "Create Redirects Export Job", undated
  2. BigCommerce, "Storefront Routes with the GraphQL Storefront API", undated
  3. BigCommerce, "Webhook Events", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark