api set header
Set a default HTTP header on the Platform api session
Set a header that applies to subsequent API requests in the session (for example auth).
Syntax
When I api set header "<name>" to "<value>"Qualifiers
| Qualifier | Role | Example |
|---|---|---|
to | Header value | api set header "Authorization" to "Bearer $API_TOKEN" |
Requirements
| Item | Contract |
|---|---|
| Element / control shape | None — HTTP session (Platform: api) |
| How the label binds | Path / body / headers are payloads ($ENV, slots expand) |
| Qualifiers that change resolve | See this command’s Qualifiers table |
| Platform | Platform: api only — requires $API_BASE_URL (and auth env as needed) |
| Wrong shape → use instead | UI XHR wait → wait for response. Browser UI → web commands |
See also UI contracts and Platform: api.
Examples
When I api set header "Authorization" to "Bearer $API_TOKEN"
When I api set header "Content-Type" to "application/json"Notes
- Values expand via shared resolve (
$ENV, slots,{{faker}}). - Reports redact
Authorizationand common secret header values.