Skip to Content
devhelp shopDocs

Admin — Online Store & Site

Site documents, releases, publishing, rollbacks, and templates.

List site documents

GET
/admin/v1/site/documents

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

kind?string
Value in"theme""layout""template""page""component""menu""assignments""code"
pageType?string
Value in"home""product""collection""collection-list""page""article""blog""search""cart""account""not-found"
includeRetired?boolean
Defaultfalse

Response Body

OK

application/json
  1. response
items*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/documents'
Example Response
{  "items": [    {      "id": "string",      "kind": "theme",      "handle": "string",      "title": "string",      "pageType": "home",      "draftVersion": 0,      "hasDraft": true,      "publishedRevisionId": "string",      "retired": true,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ]}

Create a document

POST
/admin/v1/site/documents

Creates a document of kind from document, or a minimal valid one when omitted. A store has one theme, layout, assignments and code document.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
kind*string
Value in"theme""layout""template""page""component""menu""assignments""code"
document?

Response Body

OK

application/json
  1. response
id*string
kind*string
Value in"theme""layout""template""page""component""menu""assignments""code"
handle*string|null
title*string
pageType*|null
draftVersion*number
hasDraft*boolean
publishedRevisionId*string|null
retired*boolean
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
draft*
warnings?array<>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/documents' \  -H 'Content-Type: application/json' \  -d '{  "kind": "theme"}'
Example Response
{  "id": "string",  "kind": "theme",  "handle": "string",  "title": "string",  "pageType": "home",  "draftVersion": 0,  "hasDraft": true,  "publishedRevisionId": "string",  "retired": true,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "draft": {    "kind": "theme",    "schemaVersion": 0,    "defs": {      "property1": 0,      "property2": 0    },    "meta": {      "property1": null,      "property2": null    },    "body": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  },  "warnings": [    {      "path": [        "string"      ],      "code": "string",      "message": "string",      "severity": "error",      "nodeId": "string",      "documentId": "string"    }  ]}
GET
/admin/v1/site/documents/{id}

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Query Parameters

includeRetired?boolean
Defaultfalse

Response Body

OK

application/json
  1. response
id*string
kind*string
Value in"theme""layout""template""page""component""menu""assignments""code"
handle*string|null
title*string
pageType*|null
draftVersion*number
hasDraft*boolean
publishedRevisionId*string|null
retired*boolean
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
draft*
warnings?array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/documents/string'
Example Response
{  "id": "string",  "kind": "theme",  "handle": "string",  "title": "string",  "pageType": "home",  "draftVersion": 0,  "hasDraft": true,  "publishedRevisionId": "string",  "retired": true,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "draft": {    "kind": "theme",    "schemaVersion": 0,    "defs": {      "property1": 0,      "property2": 0    },    "meta": {      "property1": null,      "property2": null    },    "body": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  },  "warnings": [    {      "path": [        "string"      ],      "code": "string",      "message": "string",      "severity": "error",      "nodeId": "string",      "documentId": "string"    }  ]}

Save the shared draft

PUT
/admin/v1/site/documents/{id}/draft

Replaces the document's one shared draft. baseVersion is the draftVersion the editor started from; a newer save in between answers 409 with currentVersion.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
baseVersion*number
document*

Response Body

OK

application/json
  1. response
id*string
kind*string
Value in"theme""layout""template""page""component""menu""assignments""code"
handle*string|null
title*string
pageType*|null
draftVersion*number
hasDraft*boolean
publishedRevisionId*string|null
retired*boolean
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
draft*
warnings?array<>
Example Request
curl -X PUT 'https://api.devhelp.pk/admin/v1/site/documents/string/draft' \  -H 'Content-Type: application/json' \  -d '{  "baseVersion": 0,  "document": {    "kind": "theme",    "schemaVersion": 0,    "meta": {      "property1": null,      "property2": null    },    "body": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  }}'
Example Response
{  "id": "string",  "kind": "theme",  "handle": "string",  "title": "string",  "pageType": "home",  "draftVersion": 0,  "hasDraft": true,  "publishedRevisionId": "string",  "retired": true,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "draft": {    "kind": "theme",    "schemaVersion": 0,    "defs": {      "property1": 0,      "property2": 0    },    "meta": {      "property1": null,      "property2": null    },    "body": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  },  "warnings": [    {      "path": [        "string"      ],      "code": "string",      "message": "string",      "severity": "error",      "nodeId": "string",      "documentId": "string"    }  ]}
POST
/admin/v1/site/documents/{id}/discard

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
baseVersion?number

Response Body

OK

application/json
  1. response
id*string
kind*string
Value in"theme""layout""template""page""component""menu""assignments""code"
handle*string|null
title*string
pageType*|null
draftVersion*number
hasDraft*boolean
publishedRevisionId*string|null
retired*boolean
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
draft*
warnings?array<>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/documents/string/discard' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "kind": "theme",  "handle": "string",  "title": "string",  "pageType": "home",  "draftVersion": 0,  "hasDraft": true,  "publishedRevisionId": "string",  "retired": true,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "draft": {    "kind": "theme",    "schemaVersion": 0,    "defs": {      "property1": 0,      "property2": 0    },    "meta": {      "property1": null,      "property2": null    },    "body": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  },  "warnings": [    {      "path": [        "string"      ],      "code": "string",      "message": "string",      "severity": "error",      "nodeId": "string",      "documentId": "string"    }  ]}

Retire a document

POST
/admin/v1/site/documents/{id}/retire

Soft-deletes the document. Refused with 409 and usedBy while other documents use it, unless force. It leaves the live site with the next publish.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
force?boolean
Defaultfalse

Response Body

OK

application/json
  1. response
id*string
kind*string
Value in"theme""layout""template""page""component""menu""assignments""code"
handle*string|null
title*string
pageType*|null
draftVersion*number
hasDraft*boolean
publishedRevisionId*string|null
retired*boolean
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/documents/string/retire' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "kind": "theme",  "handle": "string",  "title": "string",  "pageType": "home",  "draftVersion": 0,  "hasDraft": true,  "publishedRevisionId": "string",  "retired": true,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}
POST
/admin/v1/site/documents/{id}/restore

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
revisionId*string
baseVersion?number

Response Body

OK

application/json
  1. response
id*string
kind*string
Value in"theme""layout""template""page""component""menu""assignments""code"
handle*string|null
title*string
pageType*|null
draftVersion*number
hasDraft*boolean
publishedRevisionId*string|null
retired*boolean
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
draft*
warnings?array<>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/documents/string/restore' \  -H 'Content-Type: application/json' \  -d '{  "revisionId": "string"}'
Example Response
{  "id": "string",  "kind": "theme",  "handle": "string",  "title": "string",  "pageType": "home",  "draftVersion": 0,  "hasDraft": true,  "publishedRevisionId": "string",  "retired": true,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "draft": {    "kind": "theme",    "schemaVersion": 0,    "defs": {      "property1": 0,      "property2": 0    },    "meta": {      "property1": null,      "property2": null    },    "body": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  },  "warnings": [    {      "path": [        "string"      ],      "code": "string",      "message": "string",      "severity": "error",      "nodeId": "string",      "documentId": "string"    }  ]}
GET
/admin/v1/site/documents/{id}/usages

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Response Body

OK

application/json
  1. response
items*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/documents/string/usages'
Example Response
{  "items": [    {      "id": "string",      "kind": "theme",      "title": "string"    }  ]}
GET
/admin/v1/site/documents/{id}/revisions

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Query Parameters

limit?number
Default50
beforeNumber?number

Response Body

OK

application/json
  1. response
items*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/documents/string/revisions'
Example Response
{  "items": [    {      "id": "string",      "number": 0,      "source": "editor",      "label": "string",      "contentHash": "string",      "createdBy": "string",      "createdAt": "2019-08-24T14:15:22Z",      "live": true    }  ]}
GET
/admin/v1/site/documents/{id}/revisions/{revisionId}

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string
revisionId*string

Response Body

OK

application/json
  1. response
id*string
number*number
source*string
Value in"editor""ai""import""restore""template""migration"
label*string|null
contentHash*string
createdBy*string|null
createdAt*string
Formatdate-time
live*boolean
content*
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/documents/string/revisions/string'
Example Response
{  "id": "string",  "number": 0,  "source": "editor",  "label": "string",  "contentHash": "string",  "createdBy": "string",  "createdAt": "2019-08-24T14:15:22Z",  "live": true,  "content": {    "kind": "theme",    "schemaVersion": 0,    "defs": {      "property1": 0,      "property2": 0    },    "meta": {      "property1": null,      "property2": null    },    "body": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  }}
GET
/admin/v1/site/releases

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

limit?number
Default50
beforeNumber?number

Response Body

OK

application/json
  1. response
items*array<>
liveReleaseId*string|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/releases'
Example Response
{  "items": [    {      "id": "string",      "number": 0,      "kind": "publish",      "label": "string",      "changes": [        {          "documentId": "string",          "change": "added",          "revisionId": "string"        }      ],      "previousReleaseId": "string",      "rollbackOfReleaseId": "string",      "activatedAt": "2019-08-24T14:15:22Z",      "createdBy": "string",      "createdAt": "2019-08-24T14:15:22Z",      "live": true    }  ],  "liveReleaseId": "string"}
GET
/admin/v1/site/releases/{id}

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Response Body

OK

application/json
  1. response
id*string
number*number
kind*string
Value in"publish""rollback"
label*string|null
changes*array<>
previousReleaseId*string|null
rollbackOfReleaseId*string|null
activatedAt*|null
createdBy*string|null
createdAt*string
Formatdate-time
live*boolean
entries*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/releases/string'
Example Response
{  "id": "string",  "number": 0,  "kind": "publish",  "label": "string",  "changes": [    {      "documentId": "string",      "change": "added",      "revisionId": "string"    }  ],  "previousReleaseId": "string",  "rollbackOfReleaseId": "string",  "activatedAt": "2019-08-24T14:15:22Z",  "createdBy": "string",  "createdAt": "2019-08-24T14:15:22Z",  "live": true,  "entries": [    {      "documentId": "string",      "revisionId": "string",      "kind": "theme",      "pageType": "home",      "handle": "string",      "title": "string",      "revisionNumber": 0    }  ]}
POST
/admin/v1/site/dependencies

The transitive dependency closure of documentIds, through drafts (mode: draft) or the live release. site adds the theme, layout, assignments and code documents.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
documentIds*array<string>
mode?string
Default"draft"
Value in"draft""live"
site?boolean
Defaultfalse

Response Body

OK

application/json
  1. response
documents*array<>
missing*array<string>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/dependencies' \  -H 'Content-Type: application/json' \  -d '{  "documentIds": [    "string"  ]}'
Example Response
{  "documents": [    {      "id": "string",      "kind": "theme",      "title": "string",      "pageType": "home",      "live": true,      "hasDraft": true,      "requested": true    }  ],  "missing": [    "string"  ]}
POST
/admin/v1/site/publish

Publishes the selected drafts, plus anything they need that is not live yet, as one new release in one transaction. versions maps document ids to the draftVersion that was reviewed; a newer save answers 409.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
documentIds*array<string>
versions?
label?string|null

Response Body

OK

application/json
  1. response
release*
addedDependencies*array<string>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/publish' \  -H 'Content-Type: application/json' \  -d '{  "documentIds": [    "string"  ]}'
Example Response
{  "release": {    "id": "string",    "number": 0,    "kind": "publish",    "label": "string",    "changes": [      {        "documentId": "string",        "change": "added",        "revisionId": "string"      }    ],    "previousReleaseId": "string",    "rollbackOfReleaseId": "string",    "activatedAt": "2019-08-24T14:15:22Z",    "createdBy": "string",    "createdAt": "2019-08-24T14:15:22Z"  },  "addedDependencies": [    "string"  ]}
POST
/admin/v1/site/rollback

Creates a new release from an earlier one's entries, leaving out documents retired since. Drafts with unpublished changes keep them.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
releaseId*string
label?string|null

Response Body

OK

application/json
  1. response
id*string
number*number
kind*string
Value in"publish""rollback"
label*string|null
changes*array<>
previousReleaseId*string|null
rollbackOfReleaseId*string|null
activatedAt*|null
createdBy*string|null
createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/rollback' \  -H 'Content-Type: application/json' \  -d '{  "releaseId": "string"}'
Example Response
{  "id": "string",  "number": 0,  "kind": "publish",  "label": "string",  "changes": [    {      "documentId": "string",      "change": "added",      "revisionId": "string"    }  ],  "previousReleaseId": "string",  "rollbackOfReleaseId": "string",  "activatedAt": "2019-08-24T14:15:22Z",  "createdBy": "string",  "createdAt": "2019-08-24T14:15:22Z"}
GET
/admin/v1/site/registry

Inspector schemas and presets for every built-in definition and the store's components, plus the field catalogue, page types and bindable context.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
definitions*array<>
components*array<>
fields*
pageTypes*array<>
context*
versions*
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/registry'
Example Response
{  "definitions": [    {      "type": "string",      "kind": "section",      "label": "string",      "version": 0,      "tabs": {        "property1": [          {            "property1": null,            "property2": null          }        ],        "property2": [          {            "property1": null,            "property2": null          }        ]      },      "presets": [        {          "property1": null,          "property2": null        }      ],      "property1": null,      "property2": null    }  ],  "components": [    {      "type": "string",      "kind": "section",      "label": "string",      "version": 0,      "tabs": {        "property1": [          {            "property1": null,            "property2": null          }        ],        "property2": [          {            "property1": null,            "property2": null          }        ]      },      "presets": [        {          "property1": null,          "property2": null        }      ],      "property1": null,      "property2": null    }  ],  "fields": {    "kinds": [      "string"    ],    "responsive": [      "string"    ],    "bindable": {      "property1": "string",      "property2": "string"    },    "templates": [      "string"    ],    "codeLanguages": [      "string"    ],    "tabs": [      "string"    ]  },  "pageTypes": [    {      "pageType": "home",      "main": true,      "context": [        "string"      ],      "rules": true    }  ],  "context": {    "globals": [      "string"    ],    "shapes": {      "property1": {        "property1": "string",        "property2": "string"      },      "property2": {        "property1": "string",        "property2": "string"      }    },    "bindCompatibility": {      "property1": [        "string"      ],      "property2": [        "string"      ]    }  },  "versions": {    "property1": 0,    "property2": 0  }}
GET
/admin/v1/site/preview-resolve

Resolves a route like the storefront does, but from the current drafts instead of the live release. For the editor; never cached.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

pageType*string
Value in"home""product""collection""collection-list""page""article""blog""search""cart""account""not-found"
handle?string
id?string
templateId?string

Response Body

OK

application/json
  1. response
release*|null
preview*boolean
pageType*string
Value in"home""product""collection""collection-list""page""article""blog""search""cart""account""not-found"
template*|null
templateChoice*|||
page*|null
layout*|null
theme*|null
code*|null
customCode*string
Value in"on""paused""blocked""off"
components*array<>
menus*array<>
resource*||||null
context*
data*
media*
links*
expressions*
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/preview-resolve?pageType=home'
Example Response
{  "release": {    "id": "string",    "number": 0  },  "preview": true,  "pageType": "home",  "template": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "templateChoice": {    "templateId": "string",    "source": "explicit"  },  "page": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "layout": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "theme": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "code": {    "css": "string",    "snippets": [      {        "property1": null,        "property2": null      }    ]  },  "customCode": "on",  "components": [    {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    }  ],  "menus": [    {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    }  ],  "resource": {    "kind": "product",    "product": {      "id": "string",      "slug": "string",      "title": "string",      "description": "string",      "status": "draft",      "kind": "physical",      "vendor": "string",      "productType": "string",      "tags": [        "string"      ],      "customBadge": "string",      "badges": [        "string"      ],      "rating": {        "average": 0,        "count": 0      },      "relatedProductIds": [        "string"      ],      "tabs": [        {          "title": "string",          "pageId": "string",          "sizeGuide": true        }      ],      "publishedAt": "2019-08-24T14:15:22Z",      "taxClassId": "string",      "options": [        {          "id": "string",          "name": "string",          "position": 0,          "values": [            {              "id": "string",              "value": "string",              "colour": "string",              "position": 0            }          ]        }      ],      "variants": [        {          "id": "string",          "pricePaisa": 0,          "compareAtPricePaisa": 0,          "sku": "string",          "barcode": "string",          "weightGrams": 0,          "position": 0,          "optionValues": [            {              "optionId": "string",              "optionName": "string",              "valueId": "string",              "value": "string"            }          ],          "imageId": "string",          "trackInventory": true,          "allowOversell": true,          "sellable": true,          "availability": "in_stock",          "sale": {            "discountId": "string",            "title": "string",            "percentageBps": 0,            "basePricePaisa": 0,            "endsAt": "2019-08-24T14:15:22Z"          }        }      ],      "images": [        {          "id": "string",          "status": "pending",          "url": "string",          "contentType": "string",          "byteSize": 0,          "width": 0,          "height": 0,          "alt": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "seoTitle": "string",      "seoDescription": "string",      "seoImageId": "string",      "seo": {        "title": "string",        "description": "string",        "image": {          "id": "string",          "status": "pending",          "url": "string",          "contentType": "string",          "byteSize": 0,          "width": 0,          "height": 0,          "alt": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      },      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  },  "context": {    "property1": null,    "property2": null  },  "data": {    "property1": {      "source": "products",      "items": [        {          "id": "string",          "slug": "string",          "title": "string",          "description": "string",          "status": "draft",          "kind": "physical",          "vendor": "string",          "productType": "string",          "tags": [            "string"          ],          "customBadge": "string",          "badges": [            "string"          ],          "rating": {            "average": 0,            "count": 0          },          "relatedProductIds": [            "string"          ],          "tabs": [            {              "title": "string",              "pageId": "string",              "sizeGuide": true            }          ],          "publishedAt": "2019-08-24T14:15:22Z",          "taxClassId": "string",          "options": [            {              "id": "string",              "name": "string",              "position": 0,              "values": [                {                  "id": "string",                  "value": "string",                  "colour": "string",                  "position": 0                }              ]            }          ],          "variants": [            {              "id": "string",              "pricePaisa": 0,              "compareAtPricePaisa": 0,              "sku": "string",              "barcode": "string",              "weightGrams": 0,              "position": 0,              "optionValues": [                {                  "optionId": "string",                  "optionName": "string",                  "valueId": "string",                  "value": "string"                }              ],              "imageId": "string",              "trackInventory": true,              "allowOversell": true,              "sellable": true,              "availability": "in_stock",              "sale": {                "discountId": "string",                "title": "string",                "percentageBps": 0,                "basePricePaisa": 0,                "endsAt": "2019-08-24T14:15:22Z"              }            }          ],          "images": [            {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          ],          "seoTitle": "string",          "seoDescription": "string",          "seoImageId": "string",          "seo": {            "title": "string",            "description": "string",            "image": {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          },          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z"        }      ]    },    "property2": {      "source": "products",      "items": [        {          "id": "string",          "slug": "string",          "title": "string",          "description": "string",          "status": "draft",          "kind": "physical",          "vendor": "string",          "productType": "string",          "tags": [            "string"          ],          "customBadge": "string",          "badges": [            "string"          ],          "rating": {            "average": 0,            "count": 0          },          "relatedProductIds": [            "string"          ],          "tabs": [            {              "title": "string",              "pageId": "string",              "sizeGuide": true            }          ],          "publishedAt": "2019-08-24T14:15:22Z",          "taxClassId": "string",          "options": [            {              "id": "string",              "name": "string",              "position": 0,              "values": [                {                  "id": "string",                  "value": "string",                  "colour": "string",                  "position": 0                }              ]            }          ],          "variants": [            {              "id": "string",              "pricePaisa": 0,              "compareAtPricePaisa": 0,              "sku": "string",              "barcode": "string",              "weightGrams": 0,              "position": 0,              "optionValues": [                {                  "optionId": "string",                  "optionName": "string",                  "valueId": "string",                  "value": "string"                }              ],              "imageId": "string",              "trackInventory": true,              "allowOversell": true,              "sellable": true,              "availability": "in_stock",              "sale": {                "discountId": "string",                "title": "string",                "percentageBps": 0,                "basePricePaisa": 0,                "endsAt": "2019-08-24T14:15:22Z"              }            }          ],          "images": [            {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          ],          "seoTitle": "string",          "seoDescription": "string",          "seoImageId": "string",          "seo": {            "title": "string",            "description": "string",            "image": {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          },          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z"        }      ]    }  },  "media": {    "property1": {      "url": "string",      "alt": "string",      "width": 0,      "height": 0    },    "property2": {      "url": "string",      "alt": "string",      "width": 0,      "height": 0    }  },  "links": {    "property1": {      "title": "string",      "url": "string"    },    "property2": {      "title": "string",      "url": "string"    }  },  "expressions": {    "property1": {      "values": {        "property1": {          "property1": null,          "property2": null        },        "property2": {          "property1": null,          "property2": null        }      },      "errors": [        {          "address": "string",          "setting": "string",          "message": "string"        }      ]    },    "property2": {      "values": {        "property1": {          "property1": null,          "property2": null        },        "property2": {          "property1": null,          "property2": null        }      },      "errors": [        {          "address": "string",          "setting": "string",          "message": "string"        }      ]    }  }}
GET
/admin/v1/site/map

Pages, templates, the layout, menus, assignments and the theme with their drafts, and the product and collection that product and collection pages are shown with. For the AI editor's canvas (SPEC-81a); never cached.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
documents*array<>
samples*
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/map'
Example Response
{  "documents": [    {      "id": "string",      "kind": "theme",      "handle": "string",      "title": "string",      "pageType": "home",      "draftVersion": 0,      "hasDraft": true,      "publishedRevisionId": "string",      "retired": true,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "draft": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      },      "warnings": [        {          "path": [            "string"          ],          "code": "string",          "message": "string",          "severity": "error",          "nodeId": "string",          "documentId": "string"        }      ]    }  ],  "samples": {    "product": "string",    "collection": "string"  }}
GET
/admin/v1/site/library-preview

One route, resolved from the current drafts like previewResolve, whose template holds every insertable section preset and the store's saved sections. For the editor's library thumbnails; never cached.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
route*
items*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/library-preview'
Example Response
{  "route": {    "release": {      "id": "string",      "number": 0    },    "preview": true,    "pageType": "home",    "template": {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    },    "templateChoice": {      "templateId": "string",      "source": "explicit"    },    "page": {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    },    "layout": {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    },    "theme": {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    },    "code": {      "css": "string",      "snippets": [        {          "property1": null,          "property2": null        }      ]    },    "customCode": "on",    "components": [      {        "id": "string",        "revisionId": "string",        "document": {          "kind": "theme",          "schemaVersion": 0,          "defs": {            "property1": 0,            "property2": 0          },          "meta": {            "property1": null,            "property2": null          },          "body": {            "property1": null,            "property2": null          },          "property1": null,          "property2": null        }      }    ],    "menus": [      {        "id": "string",        "revisionId": "string",        "document": {          "kind": "theme",          "schemaVersion": 0,          "defs": {            "property1": 0,            "property2": 0          },          "meta": {            "property1": null,            "property2": null          },          "body": {            "property1": null,            "property2": null          },          "property1": null,          "property2": null        }      }    ],    "resource": {      "kind": "product",      "product": {        "id": "string",        "slug": "string",        "title": "string",        "description": "string",        "status": "draft",        "kind": "physical",        "vendor": "string",        "productType": "string",        "tags": [          "string"        ],        "customBadge": "string",        "badges": [          "string"        ],        "rating": {          "average": 0,          "count": 0        },        "relatedProductIds": [          "string"        ],        "tabs": [          {            "title": "string",            "pageId": "string",            "sizeGuide": true          }        ],        "publishedAt": "2019-08-24T14:15:22Z",        "taxClassId": "string",        "options": [          {            "id": "string",            "name": "string",            "position": 0,            "values": [              {                "id": "string",                "value": "string",                "colour": "string",                "position": 0              }            ]          }        ],        "variants": [          {            "id": "string",            "pricePaisa": 0,            "compareAtPricePaisa": 0,            "sku": "string",            "barcode": "string",            "weightGrams": 0,            "position": 0,            "optionValues": [              {                "optionId": "string",                "optionName": "string",                "valueId": "string",                "value": "string"              }            ],            "imageId": "string",            "trackInventory": true,            "allowOversell": true,            "sellable": true,            "availability": "in_stock",            "sale": {              "discountId": "string",              "title": "string",              "percentageBps": 0,              "basePricePaisa": 0,              "endsAt": "2019-08-24T14:15:22Z"            }          }        ],        "images": [          {            "id": "string",            "status": "pending",            "url": "string",            "contentType": "string",            "byteSize": 0,            "width": 0,            "height": 0,            "alt": "string",            "createdAt": "2019-08-24T14:15:22Z"          }        ],        "seoTitle": "string",        "seoDescription": "string",        "seoImageId": "string",        "seo": {          "title": "string",          "description": "string",          "image": {            "id": "string",            "status": "pending",            "url": "string",            "contentType": "string",            "byteSize": 0,            "width": 0,            "height": 0,            "alt": "string",            "createdAt": "2019-08-24T14:15:22Z"          }        },        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    },    "context": {      "property1": null,      "property2": null    },    "data": {      "property1": {        "source": "products",        "items": [          {            "id": "string",            "slug": "string",            "title": "string",            "description": "string",            "status": "draft",            "kind": "physical",            "vendor": "string",            "productType": "string",            "tags": [              "string"            ],            "customBadge": "string",            "badges": [              "string"            ],            "rating": {              "average": 0,              "count": 0            },            "relatedProductIds": [              "string"            ],            "tabs": [              {                "title": "string",                "pageId": "string",                "sizeGuide": true              }            ],            "publishedAt": "2019-08-24T14:15:22Z",            "taxClassId": "string",            "options": [              {                "id": "string",                "name": "string",                "position": 0,                "values": [                  {                    "id": null,                    "value": null,                    "colour": null,                    "position": null                  }                ]              }            ],            "variants": [              {                "id": "string",                "pricePaisa": 0,                "compareAtPricePaisa": 0,                "sku": "string",                "barcode": "string",                "weightGrams": 0,                "position": 0,                "optionValues": [                  {                    "optionId": null,                    "optionName": null,                    "valueId": null,                    "value": null                  }                ],                "imageId": "string",                "trackInventory": true,                "allowOversell": true,                "sellable": true,                "availability": "in_stock",                "sale": {                  "discountId": "string",                  "title": "string",                  "percentageBps": 0,                  "basePricePaisa": 0,                  "endsAt": "2019-08-24T14:15:22Z"                }              }            ],            "images": [              {                "id": "string",                "status": "pending",                "url": "string",                "contentType": "string",                "byteSize": 0,                "width": 0,                "height": 0,                "alt": "string",                "createdAt": "2019-08-24T14:15:22Z"              }            ],            "seoTitle": "string",            "seoDescription": "string",            "seoImageId": "string",            "seo": {              "title": "string",              "description": "string",              "image": {                "id": "string",                "status": "pending",                "url": "string",                "contentType": "string",                "byteSize": 0,                "width": 0,                "height": 0,                "alt": "string",                "createdAt": "2019-08-24T14:15:22Z"              }            },            "createdAt": "2019-08-24T14:15:22Z",            "updatedAt": "2019-08-24T14:15:22Z"          }        ]      },      "property2": {        "source": "products",        "items": [          {            "id": "string",            "slug": "string",            "title": "string",            "description": "string",            "status": "draft",            "kind": "physical",            "vendor": "string",            "productType": "string",            "tags": [              "string"            ],            "customBadge": "string",            "badges": [              "string"            ],            "rating": {              "average": 0,              "count": 0            },            "relatedProductIds": [              "string"            ],            "tabs": [              {                "title": "string",                "pageId": "string",                "sizeGuide": true              }            ],            "publishedAt": "2019-08-24T14:15:22Z",            "taxClassId": "string",            "options": [              {                "id": "string",                "name": "string",                "position": 0,                "values": [                  {                    "id": null,                    "value": null,                    "colour": null,                    "position": null                  }                ]              }            ],            "variants": [              {                "id": "string",                "pricePaisa": 0,                "compareAtPricePaisa": 0,                "sku": "string",                "barcode": "string",                "weightGrams": 0,                "position": 0,                "optionValues": [                  {                    "optionId": null,                    "optionName": null,                    "valueId": null,                    "value": null                  }                ],                "imageId": "string",                "trackInventory": true,                "allowOversell": true,                "sellable": true,                "availability": "in_stock",                "sale": {                  "discountId": "string",                  "title": "string",                  "percentageBps": 0,                  "basePricePaisa": 0,                  "endsAt": "2019-08-24T14:15:22Z"                }              }            ],            "images": [              {                "id": "string",                "status": "pending",                "url": "string",                "contentType": "string",                "byteSize": 0,                "width": 0,                "height": 0,                "alt": "string",                "createdAt": "2019-08-24T14:15:22Z"              }            ],            "seoTitle": "string",            "seoDescription": "string",            "seoImageId": "string",            "seo": {              "title": "string",              "description": "string",              "image": {                "id": "string",                "status": "pending",                "url": "string",                "contentType": "string",                "byteSize": 0,                "width": 0,                "height": 0,                "alt": "string",                "createdAt": "2019-08-24T14:15:22Z"              }            },            "createdAt": "2019-08-24T14:15:22Z",            "updatedAt": "2019-08-24T14:15:22Z"          }        ]      }    },    "media": {      "property1": {        "url": "string",        "alt": "string",        "width": 0,        "height": 0      },      "property2": {        "url": "string",        "alt": "string",        "width": 0,        "height": 0      }    },    "links": {      "property1": {        "title": "string",        "url": "string"      },      "property2": {        "title": "string",        "url": "string"      }    },    "expressions": {      "property1": {        "values": {          "property1": {            "property1": null,            "property2": null          },          "property2": {            "property1": null,            "property2": null          }        },        "errors": [          {            "address": "string",            "setting": "string",            "message": "string"          }        ]      },      "property2": {        "values": {          "property1": {            "property1": null,            "property2": null          },          "property2": {            "property1": null,            "property2": null          }        },        "errors": [          {            "address": "string",            "setting": "string",            "message": "string"          }        ]      }    }  },  "items": [    {      "nodeId": "string",      "type": "string",      "preset": 0,      "componentId": "string"    }  ]}
GET
/admin/v1/site/catalog-facts

Collections, tags, type and preview states of the store's products (or collections, or blog posts), most recently updated first, for the Templates screen's live counts and the template preview's product picker.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

kind*string
Value in"product""collection""article"

Response Body

OK

application/json
  1. response
items*array<>
truncated*boolean
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/catalog-facts?kind=product'
Example Response
{  "items": [    {      "id": "string",      "title": "string",      "handle": "string",      "status": "string",      "imageUrl": "string",      "collectionIds": [        "string"      ],      "tags": [        "string"      ],      "productType": "string",      "hasVariants": true,      "onSale": true,      "soldOut": true,      "reviewCount": 0,      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "truncated": true}
GET
/admin/v1/site/component-preview

Places the section's current draft on a page of its kind — with the chosen product, collection or post, or the most recent one — and resolves it from drafts like previewResolve. For My sections' live preview; never cached.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

componentId*string
resourceId?string

Response Body

OK

application/json
  1. response
release*|null
preview*boolean
pageType*string
Value in"home""product""collection""collection-list""page""article""blog""search""cart""account""not-found"
template*|null
templateChoice*|||
page*|null
layout*|null
theme*|null
code*|null
customCode*string
Value in"on""paused""blocked""off"
components*array<>
menus*array<>
resource*||||null
context*
data*
media*
links*
expressions*
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/component-preview?componentId=string'
Example Response
{  "release": {    "id": "string",    "number": 0  },  "preview": true,  "pageType": "home",  "template": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "templateChoice": {    "templateId": "string",    "source": "explicit"  },  "page": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "layout": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "theme": {    "id": "string",    "revisionId": "string",    "document": {      "kind": "theme",      "schemaVersion": 0,      "defs": {        "property1": 0,        "property2": 0      },      "meta": {        "property1": null,        "property2": null      },      "body": {        "property1": null,        "property2": null      },      "property1": null,      "property2": null    }  },  "code": {    "css": "string",    "snippets": [      {        "property1": null,        "property2": null      }    ]  },  "customCode": "on",  "components": [    {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    }  ],  "menus": [    {      "id": "string",      "revisionId": "string",      "document": {        "kind": "theme",        "schemaVersion": 0,        "defs": {          "property1": 0,          "property2": 0        },        "meta": {          "property1": null,          "property2": null        },        "body": {          "property1": null,          "property2": null        },        "property1": null,        "property2": null      }    }  ],  "resource": {    "kind": "product",    "product": {      "id": "string",      "slug": "string",      "title": "string",      "description": "string",      "status": "draft",      "kind": "physical",      "vendor": "string",      "productType": "string",      "tags": [        "string"      ],      "customBadge": "string",      "badges": [        "string"      ],      "rating": {        "average": 0,        "count": 0      },      "relatedProductIds": [        "string"      ],      "tabs": [        {          "title": "string",          "pageId": "string",          "sizeGuide": true        }      ],      "publishedAt": "2019-08-24T14:15:22Z",      "taxClassId": "string",      "options": [        {          "id": "string",          "name": "string",          "position": 0,          "values": [            {              "id": "string",              "value": "string",              "colour": "string",              "position": 0            }          ]        }      ],      "variants": [        {          "id": "string",          "pricePaisa": 0,          "compareAtPricePaisa": 0,          "sku": "string",          "barcode": "string",          "weightGrams": 0,          "position": 0,          "optionValues": [            {              "optionId": "string",              "optionName": "string",              "valueId": "string",              "value": "string"            }          ],          "imageId": "string",          "trackInventory": true,          "allowOversell": true,          "sellable": true,          "availability": "in_stock",          "sale": {            "discountId": "string",            "title": "string",            "percentageBps": 0,            "basePricePaisa": 0,            "endsAt": "2019-08-24T14:15:22Z"          }        }      ],      "images": [        {          "id": "string",          "status": "pending",          "url": "string",          "contentType": "string",          "byteSize": 0,          "width": 0,          "height": 0,          "alt": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "seoTitle": "string",      "seoDescription": "string",      "seoImageId": "string",      "seo": {        "title": "string",        "description": "string",        "image": {          "id": "string",          "status": "pending",          "url": "string",          "contentType": "string",          "byteSize": 0,          "width": 0,          "height": 0,          "alt": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      },      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  },  "context": {    "property1": null,    "property2": null  },  "data": {    "property1": {      "source": "products",      "items": [        {          "id": "string",          "slug": "string",          "title": "string",          "description": "string",          "status": "draft",          "kind": "physical",          "vendor": "string",          "productType": "string",          "tags": [            "string"          ],          "customBadge": "string",          "badges": [            "string"          ],          "rating": {            "average": 0,            "count": 0          },          "relatedProductIds": [            "string"          ],          "tabs": [            {              "title": "string",              "pageId": "string",              "sizeGuide": true            }          ],          "publishedAt": "2019-08-24T14:15:22Z",          "taxClassId": "string",          "options": [            {              "id": "string",              "name": "string",              "position": 0,              "values": [                {                  "id": "string",                  "value": "string",                  "colour": "string",                  "position": 0                }              ]            }          ],          "variants": [            {              "id": "string",              "pricePaisa": 0,              "compareAtPricePaisa": 0,              "sku": "string",              "barcode": "string",              "weightGrams": 0,              "position": 0,              "optionValues": [                {                  "optionId": "string",                  "optionName": "string",                  "valueId": "string",                  "value": "string"                }              ],              "imageId": "string",              "trackInventory": true,              "allowOversell": true,              "sellable": true,              "availability": "in_stock",              "sale": {                "discountId": "string",                "title": "string",                "percentageBps": 0,                "basePricePaisa": 0,                "endsAt": "2019-08-24T14:15:22Z"              }            }          ],          "images": [            {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          ],          "seoTitle": "string",          "seoDescription": "string",          "seoImageId": "string",          "seo": {            "title": "string",            "description": "string",            "image": {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          },          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z"        }      ]    },    "property2": {      "source": "products",      "items": [        {          "id": "string",          "slug": "string",          "title": "string",          "description": "string",          "status": "draft",          "kind": "physical",          "vendor": "string",          "productType": "string",          "tags": [            "string"          ],          "customBadge": "string",          "badges": [            "string"          ],          "rating": {            "average": 0,            "count": 0          },          "relatedProductIds": [            "string"          ],          "tabs": [            {              "title": "string",              "pageId": "string",              "sizeGuide": true            }          ],          "publishedAt": "2019-08-24T14:15:22Z",          "taxClassId": "string",          "options": [            {              "id": "string",              "name": "string",              "position": 0,              "values": [                {                  "id": "string",                  "value": "string",                  "colour": "string",                  "position": 0                }              ]            }          ],          "variants": [            {              "id": "string",              "pricePaisa": 0,              "compareAtPricePaisa": 0,              "sku": "string",              "barcode": "string",              "weightGrams": 0,              "position": 0,              "optionValues": [                {                  "optionId": "string",                  "optionName": "string",                  "valueId": "string",                  "value": "string"                }              ],              "imageId": "string",              "trackInventory": true,              "allowOversell": true,              "sellable": true,              "availability": "in_stock",              "sale": {                "discountId": "string",                "title": "string",                "percentageBps": 0,                "basePricePaisa": 0,                "endsAt": "2019-08-24T14:15:22Z"              }            }          ],          "images": [            {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          ],          "seoTitle": "string",          "seoDescription": "string",          "seoImageId": "string",          "seo": {            "title": "string",            "description": "string",            "image": {              "id": "string",              "status": "pending",              "url": "string",              "contentType": "string",              "byteSize": 0,              "width": 0,              "height": 0,              "alt": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          },          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z"        }      ]    }  },  "media": {    "property1": {      "url": "string",      "alt": "string",      "width": 0,      "height": 0    },    "property2": {      "url": "string",      "alt": "string",      "width": 0,      "height": 0    }  },  "links": {    "property1": {      "title": "string",      "url": "string"    },    "property2": {      "title": "string",      "url": "string"    }  },  "expressions": {    "property1": {      "values": {        "property1": {          "property1": null,          "property2": null        },        "property2": {          "property1": null,          "property2": null        }      },      "errors": [        {          "address": "string",          "setting": "string",          "message": "string"        }      ]    },    "property2": {      "values": {        "property1": {          "property1": null,          "property2": null        },        "property2": {          "property1": null,          "property2": null        }      },      "errors": [        {          "address": "string",          "setting": "string",          "message": "string"        }      ]    }  }}

Custom code switches

GET
/admin/v1/site/custom-code

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
paused*boolean
blocked*boolean
blockedReason*string|null
canEdit*boolean
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/custom-code'
Example Response
{  "paused": true,  "blocked": true,  "blockedReason": "string",  "canEdit": true}
POST
/admin/v1/site/custom-code/pause

Pausing takes every Custom HTML element, section code and site code snippet, and the store-wide CSS, off the storefront until resumed. Owners and admins only.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
paused*boolean

Response Body

OK

application/json
  1. response
paused*boolean
blocked*boolean
blockedReason*string|null
canEdit*boolean
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/custom-code/pause' \  -H 'Content-Type: application/json' \  -d '{  "paused": true}'
Example Response
{  "paused": true,  "blocked": true,  "blockedReason": "string",  "canEdit": true}
GET
/admin/v1/site/ai

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
provider*string
Value in"models""local"
available*boolean
reason*|null
plans*array<string>
usedPercent*number|null
resetsAt*|null
lock*|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/ai'
Example Response
{  "provider": "models",  "available": true,  "reason": "plan_feature_required",  "plans": [    "string"  ],  "usedPercent": 0,  "resetsAt": "2019-08-24T14:15:22Z",  "lock": {    "message": "string",    "action": {      "label": "string",      "href": "string"    }  }}

Rewrite a piece of text

POST
/admin/v1/site/ai/rewrite

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
text*string
tone*string
Value in"shorter""longer""friendlier""formal""fix"
field?string

Response Body

OK

application/json
  1. response
text*string
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/ai/rewrite' \  -H 'Content-Type: application/json' \  -d '{  "text": "string",  "tone": "shorter"}'
Example Response
{  "text": "string"}
POST
/admin/v1/site/ai/suggest-sections

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
pageType*string
Value in"home""product""collection""collection-list""page""article""blog""search""cart""account""not-found"
sections*array<string>
brief?string

Response Body

OK

application/json
  1. response
suggestions*array<>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/ai/suggest-sections' \  -H 'Content-Type: application/json' \  -d '{  "pageType": "home",  "sections": [    "string"  ]}'
Example Response
{  "suggestions": [    {      "type": "string",      "preset": 0,      "reason": "string",      "text": [        {          "key": "string",          "value": "string"        }      ]    }  ]}
POST
/admin/v1/site/ai/ask

Turns a request in the merchant's words into steps the editor applies as a preview: sections from the library, text, the brand colour or fonts.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
prompt*string
pageType*string
Value in"home""product""collection""collection-list""page""article""blog""search""cart""account""not-found"
sections*array<>
selectedId?string|null
documentId?string

Response Body

OK

application/json
  1. response
summary*string
steps*array<|||||||||||>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/ai/ask' \  -H 'Content-Type: application/json' \  -d '{  "prompt": "string",  "pageType": "home",  "sections": [    {      "id": "string",      "type": "string",      "label": "string",      "text": [        {          "key": "string",          "value": "string"        }      ]    }  ]}'
Example Response
{  "summary": "string",  "steps": [    {      "kind": "add",      "section": {        "type": "string",        "preset": 0,        "reason": "string",        "text": [          {            "key": "string",            "value": "string"          }        ]      },      "after": "string",      "list": "sections",      "ref": ""    }  ]}
POST
/admin/v1/site/ai/palette

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
palette*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/ai/palette'
Example Response
{  "palette": {    "accent": "string",    "swatches": [      "string"    ],    "soft": "string",    "ink": "string",    "colourful": true  }}

The conversation so far

GET
/admin/v1/site/ai/messages

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

conversationId?string

Response Body

OK

application/json
  1. response
conversationId*string|null
messages*array<>
conversations*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/site/ai/messages'
Example Response
{  "conversationId": "string",  "messages": [    {      "id": "string",      "conversationId": "string",      "role": "merchant",      "text": "string",      "scope": {        "documentId": "string",        "nodeId": "string",        "label": "string"      },      "steps": [        {          "kind": "add",          "section": {            "type": "string",            "preset": 0,            "reason": "string",            "text": [              {                "key": "string",                "value": "string"              }            ]          },          "after": "string",          "list": "sections",          "ref": ""        }      ],      "attachments": [],      "sources": [],      "documentId": "string",      "baseVersion": 0,      "state": "open",      "rating": "up",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "conversations": [    {      "id": "string",      "title": "string",      "at": "2019-08-24T14:15:22Z"    }  ]}

Ask in the conversation

POST
/admin/v1/site/ai/messages

Like ask, scoped to an element when the merchant pointed at one; both the request and the answer are kept in the conversation.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
prompt*string
pageType*string
Value in"home""product""collection""collection-list""page""article""blog""search""cart""account""not-found"
sections*array<>
selectedId?string|null
documentId*string
conversationId*string|null
baseVersion*number
scope*|null
attachmentIds?array<string>
webSearch?boolean

Response Body

OK

application/json
  1. response
conversationId*string
merchant*
assistant*
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/ai/messages' \  -H 'Content-Type: application/json' \  -d '{  "prompt": "string",  "pageType": "home",  "sections": [    {      "id": "string",      "type": "string",      "label": "string",      "text": [        {          "key": "string",          "value": "string"        }      ]    }  ],  "documentId": "string",  "conversationId": "string",  "baseVersion": 0,  "scope": {    "documentId": "string",    "nodeId": "string",    "label": "string"  }}'
Example Response
{  "conversationId": "string",  "merchant": {    "id": "string",    "conversationId": "string",    "role": "merchant",    "text": "string",    "scope": {      "documentId": "string",      "nodeId": "string",      "label": "string"    },    "steps": [      {        "kind": "add",        "section": {          "type": "string",          "preset": 0,          "reason": "string",          "text": [            {              "key": "string",              "value": "string"            }          ]        },        "after": "string",        "list": "sections",        "ref": ""      }    ],    "attachments": [],    "sources": [],    "documentId": "string",    "baseVersion": 0,    "state": "open",    "rating": "up",    "createdAt": "2019-08-24T14:15:22Z"  },  "assistant": {    "id": "string",    "conversationId": "string",    "role": "merchant",    "text": "string",    "scope": {      "documentId": "string",      "nodeId": "string",      "label": "string"    },    "steps": [      {        "kind": "add",        "section": {          "type": "string",          "preset": 0,          "reason": "string",          "text": [            {              "key": "string",              "value": "string"            }          ]        },        "after": "string",        "list": "sections",        "ref": ""      }    ],    "attachments": [],    "sources": [],    "documentId": "string",    "baseVersion": 0,    "state": "open",    "rating": "up",    "createdAt": "2019-08-24T14:15:22Z"  }}
POST
/admin/v1/site/ai/messages/{id}

Kept, discarded or out of date, and the merchant's thumbs up or down. Changes nothing on the site.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
state?string
Value in"kept""discarded""stale"
rating?string
Value in"up""down"

Response Body

OK

application/json
  1. response
id*string
conversationId*string
role*string
Value in"merchant""assistant"
text*string
scope*|null
steps*array<|||||||||||>
attachments?array<>
Default[]
sources?array<>
Default[]
documentId*string|null
baseVersion*number|null
state*|null
rating*|null
createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/site/ai/messages/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "conversationId": "string",  "role": "merchant",  "text": "string",  "scope": {    "documentId": "string",    "nodeId": "string",    "label": "string"  },  "steps": [    {      "kind": "add",      "section": {        "type": "string",        "preset": 0,        "reason": "string",        "text": [          {            "key": "string",            "value": "string"          }        ]      },      "after": "string",      "list": "sections",      "ref": ""    }  ],  "attachments": [],  "sources": [],  "documentId": "string",  "baseVersion": 0,  "state": "open",  "rating": "up",  "createdAt": "2019-08-24T14:15:22Z"}

List store templates

GET
/admin/v1/templates

Gallery metadata only: no page bodies or sections.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
data*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/templates'
Example Response
{  "data": [    {      "id": "rangrez",      "version": 0,      "name": "string",      "vertical": "string",      "description": "string",      "tags": [        "string"      ],      "previews": {        "desktop": "string",        "mobile": "string"      },      "theme": {        "preset": "counter",        "accent": "string",        "radius": "sm",        "appearance": "system",        "fontPairing": "figtree",        "productCard": "standard",        "density": "comfortable",        "headingScale": "s",        "headingCase": "normal",        "buttonShape": "square",        "buttonStyle": "solid",        "cardImageRatio": "portrait"      },      "swatch": [        "string"      ]    }  ]}

On this page