POST
https://api.craftkit.dev/v1/embed/sessions/refreshrenewToken is single-use: each call mints a
fresh session_token, extends expires_at by 4 hours, and returns a new renew_token — the old
one stops working. The response shape is identical to
Create a session.
Authorization
Bearer ck_live_… — must be an API key from the same project that minted the session.Body
The
renew_token from the last mint or refresh (min 8 chars).Response
200 with the rotated session (same fields as the mint response).
Unchanged — the original session UUID.
A freshly signed EdDSA JWT.
Builder URL carrying the new token.
New ISO-8601 expiry, 4 hours out.
New single-use renew token; the previous one is invalidated.
Errors
| Status | code | Meaning |
|---|---|---|
| 401 | missing_authorization | No Authorization: Bearer header. |
| 401 | invalid_credentials | Key not found, revoked, or embed not enabled. |
| 400 | invalid_json | Body is not valid JSON. |
| 422 | invalid_request | renewToken missing or shorter than 8 chars. |
| 401 | refresh_failed | Renew token invalid/already rotated, session inactive, or wrong project’s key. |
cURL
200