design_custom_code_get — read advanced code and availability
Read the selected channel's CSS, head/body JavaScript, head HTML, revision, and editing availability before planning a change with design_custom_code_apply.
Input and prerequisites
The input is channelCode, a nonempty string identifying the selected channel. Obtain it through the directory guide or the bound hosted resource. Do not substitute a numeric channel ID, URL, credential or environment name.
{"channelCode":"selected-channel-code"}
Replace the placeholder with a current channel code. This is an input example, not an executed result.
The HTTP adapter requires a current connection, the selected channel's credential, a matching channel response, an OWNER/DELEGATEE account role, and a configured CHANNEL_ENV origin. Hosted calls must use the bound channel. Availability does not bypass these guards.
Inputs
This tool takes no input fields.
Result
A successful CUSTOM_CODE result contains environment, channel, the fields below, availability, and verification:{confirmed:true,method:custom_code_read}. It also describes the immediate effect of saved code and the need for separate rendering verification.
| Field | Meaning |
|---|---|
initialized |
Whether the shared custom-settings object exists. |
revision |
Lowercase SHA-256 value to pass unchanged to apply for this channel. |
css |
Stored CSS source. |
headJavaScript, bodyJavaScript |
JavaScript decoded from the editor's storage escaping. Pass raw source to apply. |
headHtml |
Stored head HTML source. |
availability.css |
Always true after the preceding context/read guards succeed; independent of the scripts/HTML plan and domain gate. |
availability.scriptsAndHtml |
allowed, reason, and the plan/domain name/domain status when known. |
Only a 404 from the custom-settings GET is treated as absent settings: initialized:false, four empty code strings, and a revision for absence. Missing or null individual code fields in a valid object normalize to empty strings. An invalid envelope, a wrong channel ID or a wrong field type fails with DESIGN_RESPONSE_UNVERIFIED. Absence differs from an initialized object whose four fields are empty.
The revision hashes the ordered array of all four normalized stored fields, including storage-escaped JavaScript, or null for absence. It excludes theme tone/palette, plan and domain availability. Do not recalculate it from the displayed decoded source or treat it as proof of current access.
JavaScript and HTML availability
CSS is independent of this gate. JavaScript and HTML require one of these exact plan values:
NORMAL_BUSINESSNORMAL_PRONORMAL_FROM_ENTERPRISEENTERPRISE_TRIALENTERPRISE_ENTERPRISEPARTNER_TRIALPARTNER_PARTNERINTERNAL_INTERNAL
An eligible plan also requires the configured DNS origin and a connected-domain response with status:ACTIVATED and a nonempty domainName.
| Reason | Interpretation |
|---|---|
AVAILABLE |
The plan and returned domain metadata satisfy the bridge's gate. |
PLAN_UNVERIFIED |
No usable current plan was returned. |
PLAN_UNAVAILABLE |
The plan is outside the allowed set. |
DNS_ORIGIN_REQUIRED |
The operator has not configured the domain-service origin. |
DOMAIN_NOT_CONNECTED |
The domain lookup returned HTTP 404. |
DOMAIN_NOT_ACTIVATED |
The domain response does not satisfy both activation and nonempty-name conditions. |
DOMAIN_UNVERIFIED |
The domain response is malformed or the lookup produced another handled service error. |
Requests and boundaries
After resolving channel context through the general API, the adapter reads GET /seller/api/v1/channel-management/custom at CHANNEL_ENV. For eligible plans with a configured DNS origin, it also reads GET /seller/api/v2/managed-domains/channel-connected-domain there. These selected-channel requests use the channel bearer and channel-ID header; the caller does not supply either as a tool argument.
Get creates no job, initializes no settings, writes no code and refreshes no credentials. Non-demo get results can include the centrally configured /channels/{encodedChannelCode}/design/custom/css console link. That link does not prove navigation or code rendering works.
Missing authentication can require a human login. Missing channel credentials, target mismatch, role denial and missing CHANNEL_ENV fail before a valid code result. Unlike the custom-settings GET's 404, context/authentication/other read failures must not be interpreted as empty code. See common results for wrapper and error conventions.