BigCommerce
Management API
Redirects

Redirects

Manage 301 redirects for one or more storefronts powered by a single BigCommerce backend. For a list of redirects that are not allowed, see the 301 Redirects FAQ (opens in a new tab) in our Help Center.

Get Redirects

GET /storefront/redirects

Request

Returns a collection of the store's 301 redirects across all sites.

Authentication

  • X-Auth-Token in header - required

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string - required

    The MIME type of the response body.

  • site_id in query - integer

    Filters items by site_id.

  • id:in in query - array

    Filters items by redirect id. Also accepts comma-separated values to filter for multiple redirects.

  • limit in query - integer

    Controls the number of items to return per page.

  • page in query - integer

    Specifies the page number in a limited (paginated) list of items. Used to paginate large collections.

  • sort in query - string

    Field name to sort by. Note: Since redirect id increments when new redirects are added, you can use that field to sort by redirect create date.

    Allowed values: from_path | type | site_id | id
  • direction in query - string

    Sort direction. Acceptable values are asc, desc.

    Allowed values: asc | desc
  • include in query - string

    Indicates whether to include redirect sub-resources. Only to_url is supported.

    Allowed values: to_url
  • keyword in query - string

    Filters redirects by the specified keyword. Will only search from the beginning of a URL path. For example, blue will match /blue and /blue-shirt , not /royal-blue-shirt.

example

Response

Body

object | application/json
  • data
    array[object]

  • meta
    object

example

Upsert Redirects

PUT /storefront/redirects

Request

Upserts new redirect data across all storefronts.

Authentication

  • X-Auth-Token in header - required

Parameters

  • store_hash in path - string
  • Content-Type in header with default of application/json - string - required

    The MIME type of the request body.

Body

array | application/json
  • from_path
    string
    required

    Example: /old-url/

  • site_id
    integer
    required

  • to
    object

example

Response

Created

Body

object | application/json
  • data
    array[object]

  • meta
    object

example

Delete Redirects

DELETE /storefront/redirects

Request

Deletes redirects.

Authentication

  • X-Auth-Token in header - required

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string - required

    The MIME type of the response body.

  • id:in in query - array - required

    List of Redirect IDs to delete explicitly.

  • site_id in query - integer

    Site ID provided to delete all redirects for a given Site.

example

Response

No Content

Did you find what you were looking for?