The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the GraphQL Admin API. For details and migration steps, visit our migration guide.

Requires themes access scope.

A theme controls the look and feel of a Shopify online store.

A store can have a maximum of 20 themes, one of which is the published theme that customers see when they visit the online store. Customers can't see unpublished themes. When you publish a theme, the previously published theme becomes unpublished.

To modify theme files after they're uploaded, use the Asset resource. To learn how to create your own theme, refer to Building themes

Was this section helpful?

Properties

created_at
read-only
The date and time when the theme was created. (format: 2014-04-25T16:15:47-04:00)

id
read-only
->id
The unique numeric identifier for the theme.

name
The name of the theme.

previewable
read-only
deprecated
Whether the theme can currently be previewed.

processing
read-only
Whether files are still being copied into place for this theme.

role
Specifies how the theme is being used within the shop. Valid values:

src
Specifies a public URL where Shopify can access the theme code.

theme_store_id
read-only
A unique identifier applied to Shopify-made themes that are installed from the Shopify Theme Store Theme Store. Not all themes available in the Theme Store are developed by Shopify. Returns null if the store's theme isn't made by Shopify, or if it wasn't installed from the Theme Store.

updated_at
read-only
The date and time of when the theme was last updated. (format: 2014-04-25T16:15:47-04:00)

Was this section helpful?
{}The Theme resource
{
  "created_at": "2012-08-24T14:01:47-04:00",
  "id": 828155753,
  "name": "Comfort",
  "previewable": true,
  "processing": true,
  "role": "main",
  "src": "http://themes.shopify.com/theme.zip",
  "theme_store_id": 775,
  "updated_at": "2012-08-24T14:01:47-04:00"
}

Creates a theme by providing the public URL of a ZIP file that contains the theme.

A new theme is always unpublished by default. To publish a theme when you create it, include "role": "main" in the POST request. The theme will be published only after all of its files have been extracted and stored by Shopify, which might take a couple of minutes.


api_version
string
required

Was this section helpful?
Request body
theme
Theme resource
Was this section helpful?
post
/admin/api/2024-07/themes.json
Copy
curl -d '{"theme":{"name":"Lemongrass","src":"http://themes.shopify.com/theme.zip","role":"main"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2024-07/themes.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
{}Response
JSON
HTTP/1.1 201 Created
{
  "theme": {
    "id": 1049083727,
    "name": "Lemongrass",
    "created_at": "2024-09-26T14:27:31-04:00",
    "updated_at": "2024-09-26T14:27:31-04:00",
    "role": "unpublished",
    "theme_store_id": null,
    "previewable": false,
    "processing": true,
    "admin_graphql_api_id": "gid://shopify/Theme/1049083727"
  }
}

Retrieves a list of themes.

api_version
string
required

fields
Show only certain fields, specified by a comma-separated list of field names.

Was this section helpful?
Was this section helpful?
get
/admin/api/2024-07/themes.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-07/themes.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "themes": [
    {
      "id": 828155753,
      "name": "Comfort",
      "created_at": "2024-09-26T12:50:40-04:00",
      "updated_at": "2024-09-26T12:50:40-04:00",
      "role": "main",
      "theme_store_id": null,
      "previewable": true,
      "processing": false,
      "admin_graphql_api_id": "gid://shopify/Theme/828155753"
    },
    {
      "id": 976877075,
      "name": "Preview of Parallax",
      "created_at": "2024-09-26T12:50:40-04:00",
      "updated_at": "2024-09-26T12:50:40-04:00",
      "role": "demo",
      "theme_store_id": 688,
      "previewable": true,
      "processing": false,
      "admin_graphql_api_id": "gid://shopify/Theme/976877075"
    },
    {
      "id": 752253240,
      "name": "Sandbox",
      "created_at": "2024-09-26T12:50:40-04:00",
      "updated_at": "2024-09-26T12:50:40-04:00",
      "role": "unpublished",
      "theme_store_id": null,
      "previewable": true,
      "processing": false,
      "admin_graphql_api_id": "gid://shopify/Theme/752253240"
    }
  ]
}

Retrieves a single theme by its ID.

api_version
string
required

theme_id
string
required

fields
Show only certain fields, specified by a comma-separated list of field names.

Was this section helpful?
Path parameters
themeid=828155753
string
required
Was this section helpful?
get
/admin/api/2024-07/themes/828155753.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-07/themes/828155753.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "theme": {
    "id": 828155753,
    "name": "Comfort",
    "created_at": "2024-09-26T12:50:40-04:00",
    "updated_at": "2024-09-26T12:50:40-04:00",
    "role": "main",
    "theme_store_id": null,
    "previewable": true,
    "processing": false,
    "admin_graphql_api_id": "gid://shopify/Theme/828155753"
  }
}

Updates an existing theme.

api_version
string
required

theme_id
string
required

Was this section helpful?
Path parameters
themeid=752253240
string
required
Request body
theme
Theme resource
Was this section helpful?
put
/admin/api/2024-07/themes/752253240.json
Copy
curl -d '{"theme":{"id":752253240,"role":"main"}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2024-07/themes/752253240.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
{}Response
JSON
HTTP/1.1 200 OK
{
  "theme": {
    "role": "main",
    "id": 752253240,
    "name": "Sandbox",
    "created_at": "2024-09-26T12:50:40-04:00",
    "updated_at": "2024-09-26T14:27:32-04:00",
    "theme_store_id": null,
    "previewable": true,
    "processing": false,
    "admin_graphql_api_id": "gid://shopify/Theme/752253240"
  }
}

Deletes a theme. A theme can't be deleted while it's uploading, updating, or if the theme is the last published theme.

api_version
string
required

theme_id
string
required

Was this section helpful?
Path parameters
themeid=752253240
string
required
Was this section helpful?
del
/admin/api/2024-07/themes/752253240.json
Copy
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2024-07/themes/752253240.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "id": 752253240,
  "name": "Sandbox",
  "created_at": "2024-09-26T12:50:40-04:00",
  "updated_at": "2024-09-26T12:50:40-04:00",
  "role": "unpublished",
  "theme_store_id": null,
  "previewable": true,
  "processing": false,
  "admin_graphql_api_id": "gid://shopify/Theme/752253240"
}