---
title: How to create WordPress Application password via Studio CLI and test REST API endpoint
date: "2026-05-07"
author: "Birgit Pauli-Haack"
url: "https://icodeforapurpose.com/how-to-create-wordpress-application-password-via-studio-cli-and-test-rest-api-endpoint/"
tags: ["automattic", "radical-speed-month"]
categories: ["AI Exercises", "Themes"]
---

For a project for the Create Block Theme plugin, I created a [new REST API endpoint](https://github.com/WordPress/create-block-theme/pull/843) that needs to be tested before it can be used with the a future UI feature.

The task was to “Smoke test from a REST client (Postman / cURL) against the endpoint with a small payload”

I used three increasingly thorough payloads, plus the cURL commands. But before doing that I needed an application password.

## Application password via Studio CLI

Whatever Studio shows in the site sidebar (e.g., `http://localhost:8897`).

Studio app > site > **“Open in terminal”** (or the menu’s “Open site shell”). Inside that shell, `studio wp `is on `$PATH` and already targets the site.

### Generate an Application Password

```
studio wp user application-password create admin \"cbt-smoke-test\" --porcelain 2>&1 | tail -10"
```

```
studio wp user application-password create admin \"cbt-smoke-test\" --porcelain 2>&1 | tail -10"
```

Copy the password it prints. Use it as `APP_PASS` below.

```
WP_URL="http://localhost:8888"
APP_USER="admin"
APP_PASS="paste-from-above"
```

```
WP_URL="http://localhost:8888"
APP_USER="admin"
APP_PASS="paste-from-above"
```

![](https://icodeforapurpose.com/wp-content/uploads/2026/05/Screenshot-2026-05-07-at-12.41.07.png)

## Testing REST API calls from the PR

Payload A — Trivial (single palette color)  

	
		
			

```
curl -sS -u "$APP_USER:$APP_PASS" \  -X POST "$WP_URL/wp-json/create-block-theme/v1/theme-settings" \  -H "Content-Type: application/json" \  -d '{    "settings": {      "color": {        "palette": [          { "slug": "brand", "name": "Brand", "color": "#0066ff" }        ]      }    }  }' | jq .status
```

		
	

- Expected: “SUCCESS”.
- Then check ~/create-block-theme/…
- active-theme…/theme.json —
- settings.color.palette should now contain brand.

![](https://icodeforapurpose.com/wp-content/uploads/2026/05/Screenshot-2026-05-07-at-10.09.44.png)

![](https://icodeforapurpose.com/wp-content/uploads/2026/05/Screenshot-2026-05-07-at-10.11.01-1.png)

Payload B — Toggle a default + add a custom template

```
curl -sS -u "$APP_USER:$APP_PASS" \
  -X POST "$WP_URL/wp-json/create-block-theme/v1/theme-settings" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "color": { "defaultPalette": false }
    },
    "customTemplates": [
      { "name": "page-wide", "title": "Wide Page", "postTypes": ["page"] }
    ]
  }' | jq .theme_json.customTemplates
```

```
curl -sS -u "$APP_USER:$APP_PASS" \
  -X POST "$WP_URL/wp-json/create-block-theme/v1/theme-settings" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "color": { "defaultPalette": false }
    },
    "customTemplates": [
      { "name": "page-wide", "title": "Wide Page", "postTypes": ["page"] }
    ]
  }' | jq .theme_json.customTemplates
```

- Expected:
- response echoes the new `customTemplates` list.
- Reload Site Editor ? templates picker should offer “Wide Page” for pages.
- Default palette is removed from the **Styles > Colors** pane

![](https://icodeforapurpose.com/wp-content/uploads/2026/05/Screenshot-2026-05-07-at-10.22.06.png)

![](https://icodeforapurpose.com/wp-content/uploads/2026/05/Screenshot-2026-05-07-at-10.18.37.png)

Payload C — Shadow reification (the operational key)

```
curl -sS -u "$APP_USER:$APP_PASS" \
  -X POST "$WP_URL/wp-json/create-block-theme/v1/theme-settings" \
  -H "Content-Type: application/json" \
  -d '{
    "removedShadowDefaults": ["natural", "sharp"]
  }' | jq '.theme_json.settings.shadow'
```

```
curl -sS -u "$APP_USER:$APP_PASS" \
  -X POST "$WP_URL/wp-json/create-block-theme/v1/theme-settings" \
  -H "Content-Type: application/json" \
  -d '{
    "removedShadowDefaults": ["natural", "sharp"]
  }' | jq '.theme_json.settings.shadow'
```

- Expected:
- response shows `defaultPresets: false` and `presets` with the 3 kept core defaults (Deep, Outlined, Crisp) materialized.
- Run the same command twice — the result should be identical (idempotency check).
- Then in the editor, the shadow picker should expose only those 3.

![](https://icodeforapurpose.com/wp-content/uploads/2026/05/Screenshot-2026-05-07-at-10.34.43.png)

![](https://icodeforapurpose.com/wp-content/uploads/2026/05/Screenshot-2026-05-07-at-10.41.28.png)

Quick error case

```
curl -sS -u "$APP_USER:$APP_PASS" \
  -X POST "$WP_URL/wp-json/create-block-theme/v1/theme-settings" \
  -H "Content-Type: application/json" \
  -d '{ "totallyMadeUp": true }' | jq .
```

```
curl -sS -u "$APP_USER:$APP_PASS" \
  -X POST "$WP_URL/wp-json/create-block-theme/v1/theme-settings" \
  -H "Content-Type: application/json" \
  -d '{ "totallyMadeUp": true }' | jq .
```

This is part of my  project for **Automattic’s Radcial Speed Month:** *Make create-block-theme plugin the theme builders companion. *

The major pieces:

- [Theme Settings page](https://github.com/WordPress/create-block-theme/issues/836)
- [wp cli commands](https://github.com/WordPress/create-block-theme/issues/828)
- Fix i18n issues 

[i18n: Localise fileName and downloadButtonText of the File block](https://github.com/WordPress/create-block-theme/pull/827)
- [i18n: Localize label attribute of additional blocks](https://github.com/WordPress/create-block-theme/pull/826)

[Expand typography controls in the block inspector](https://github.com/WordPress/create-block-theme/pull/824)

### Like this:
Like Loading…