Docs
Management API
Import Export

Import-Export

Get Redirect Import-Export Jobs

GET /storefront/redirects/imex/jobs

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
  • id in query - string

    Filters results by redirect import-export job ID.

  • type in query

    Filters results by the type of the redirect import-export job.

  • status in query

    Filters results by the status of the Redirect Import-Export job.

  • limit in query with default of 10 - integer

    Determines the number of items returned per page. The default is 10 items per page.

  • page in query - integer

    Specifies the page number to return when the number of items returned exceeds the page limit. Used to paginate large collections.

example

Response

Body

object | application/json
  • data
    array[object]

  • meta
    object

example

Create Redirects Export Job

POST /storefront/redirects/imex/export

Request

Creates a new 301 Redirects export job.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

Body

object | application/json

Data necessary to create a new 301 Redirects export job.

  • site_id
    integer or null

    The site ID for which you wish to export redirects. If no site ID is provided, the request exports all redirects for all sites.

    Default: null

  • redirect_ids
    array[integer]

    A list of the redirect IDs you wish to export. If no redirect IDs are provided, the request exports all redirects for the given site selection.

    Default: []

  • include_dynamic_target_urls
    boolean

    If true, the exported CSV will contain an additional read-only column containing the target URL for dynamic redirects.

    Default: false

example

Response

Created

Body

object | application/json
  • id
    string

    Example: ab1c2de3-f4gh-5678-i90j-klm12n345o67

example

Create Redirects Import Job

POST /storefront/redirects/imex/import

Request

Creates a new 301 Redirects import job.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

Body

object | multipart/form-data

Data necessary to create a new 301 Redirects import job.

  • import_file
    string
    required

    A CSV file containing a list of Redirects to be imported.

    The headers must be defined as follows:

    Domain,Old Path,Manual URL/Path,Dynamic Target Type,Dynamic Target ID

    Not every line will have a value for every column.

    Example: Domain,Old Path,Manual URL/Path,Dynamic Target Type,Dynamic Target ID store.example.com,/old-path,/new-manual-path,, store.example.com,/old-product,,Product,12 store.example.com,/old-brand,,Brand,34 store.example.com,/old-category,,Category,56 store.example.com,/old-page,,Page,78 store.example.com,/old-post,,Post,90

Response

Created

Body

object | application/json
  • id
    string

    Example: ab1c2de3-f4gh-5678-i90j-klm12n345o67

example

Open Redirect Export Event Stream

GET /storefront/redirects/imex/export/{uuid}/events

Request

Opens an event stream to receive live updates from an export job.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

example

Response

Stream of export events. The data attribute is stringified JSON.

Body

string | text/event-stream
Example: event: message\ndata: {"job_id":"cfccdd6e-956e-4484-8cc2-a610db26bad9","status":"complete","completed_items":100,"total_items":100}\n\n

Open Redirect Import Event Stream

GET /storefront/redirects/imex/import/{uuid}/events

Request

Opens an event stream to receive live updates from an import job.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

example

Response

Stream of import events. The data attribute is stringified JSON.

Body

string | text/event-stream
Example: event: message\ndata: {{"job_id":"a4abaf59-9c25-4f37-a09d-66e6054229a1","status":"complete","completed_items":100,"failed_items":100,"total_items":93,"errors":[]}\n\n

Download Redirect Export

GET /storefront/redirects/imex/export/{uuid}/download

Request

Downloads the CSV file containing the results of an export job.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

example

Response

The exported Redirects in CSV format

Did you find what you were looking for?