Skip to main content
kasadaheadersreferencecookies11 min readBy Catmouse Engineering

x-kpsdk Headers Reference: ct, cd, v, h, dt, fc, im, r and KP_UIDz

Last reviewed
Short answer

The x-kpsdk headers are ct (session token), cd (single-use proof sent on protected requests), v (SDK version), dt and im (sent on /tl), h, fc and dv (native SDK flows) and the response header r, alongside the KP_UIDz cookie. Every header name carries the x-kpsdk- prefix. Below: direction, endpoint, lifetime and failure signs for each, limited to documented behavior.

Who this is for

Engineers with authorization to test who work with Kasada-protected sites, open a HAR file, see a wall of x-kpsdk-* headers and a KP_UIDz cookie, and need a lookup page that says which side sets each one, on which request, and what breaks when it is wrong.

Which x-kpsdk headers and cookies appear on the wire?

Ten names recur: eight headers (ct, cd, v, h, dt, im, fc, dv), the response header r and the KP_UIDz cookie. Table 1 lists direction, setter, endpoint and lifetime, and says "not documented" where no public source exists.

HTTP field names are case-insensitive (RFC 9110), so a HAR viewer may show X-Kpsdk-Ct where this page writes x-kpsdk-ct. The endpoint names /fp, /ips.js, /tl and /mfc are path suffixes, and the full path and the status codes can differ by target.

Table 1. Kasada x-kpsdk headers and KP_UIDz cookies by direction, setter, endpoint and lifetime
NameDirectionSet bySeen onLifetime and reuseWrong or missing value
x-kpsdk-ctResponse, then requestTarget's Kasada edge. The client echoes it back./fp (the Catmouse reference sequence shows a 429 response), /tl (request and refreshed response), protected callsSession token. Refreshed by /tl and carried across protected calls in the active session.When you ask POST /Solver/cd to bind a proof to a session, a ct under 16 characters returns 400 invalid_ct. The target's own reaction to a wrong ct is not documented.
x-kpsdk-cdRequestClient script, or POST /Solver/cd in the Catmouse flowProtected API callsSingle-use. Generate one immediately before each protected call.A reused or early-generated value is rejected as used or expired.
x-kpsdk-vRequest (also a query parameter)Declared by the served ips.jsips.js URL, /tlChanges when the target rolls a new SDK build. Read it from the latest ips.js URL on every session.The API reference lists a stale served version as a cause of EMPTY_R: a /tl that returns 200 with an empty body and no x-kpsdk-r.
x-kpsdk-dtRequestReturned by POST /Solver/solve as dtHeader/tlSent with the /tl submission it was returned for.No failure signature is documented for this header alone.
x-kpsdk-imQuery parameter, then requestTarget page: it sits in the ips.js URL found in the /fp HTML/fp HTML, /tlTaken from the ips.js URL of the current session.Recommended on the solve call. The solver reads it from ipsUrl when imHeader is absent.
x-kpsdk-hResponse from /mfcNative SDK flows that call /mfc/mfc, passed to the solver as hHeaderNative SDK flows only.No failure signature is documented for this header alone.
x-kpsdk-fcResponse from /mfcNative SDK configuration route/mfc, passed to the solver as fcHeaderNative SDK flows only.No failure signature is documented for this header alone.
x-kpsdk-dvRequestThe native client (iOS value built from app version and app id, Android value from the client)/tl on native SDKsNative SDK flows only.No failure signature is documented for this header alone.
x-kpsdk-rResponseTarget's Kasada edge/tl and protected responsesYou receive it and never send it. Per the published rotation post it carries the st and rst timing anchors.The API reference describes a passing /tl as 200 with an x-kpsdk-r token and a declined one as 200 with an empty body and no x-kpsdk-r.
KP_UIDzCookie: Set-Cookie response, then Cookie requestTarget site. Published Catmouse posts describe it as an observation in the client's cookie jar, not an API output.Not documented per endpointExpiry and attributes are not documented here, so read them from your own Set-Cookie lines.Not documented.
Diagram of x-kpsdk header flow in four steps. 1. GET /fp returns the x-kpsdk-ct response header, a 429 in the reference sequence. 2. The ips.js URL in the HTML carries x-kpsdk-v and x-kpsdk-im. 3. POST /tl sends x-kpsdk-ct, x-kpsdk-dt, x-kpsdk-im and x-kpsdk-v and receives x-kpsdk-r and a refreshed x-kpsdk-ct. 4. Each protected request sends the newest x-kpsdk-ct and a fresh single-use x-kpsdk-cd.
Figure 1. Where each x-kpsdk header and KP_UIDz cookie first appears in a Kasada session. Diagram by Catmouse Engineering.

Which header is single-use?

Only cd is documented as single-use. Generate it right before each protected call and never reuse it, because a reused or early value is rejected.

The session token behaves differently from cd. You carry the newest ct across protected calls, whereas you replace cd every time. Do not trust a cd value that you generated earlier in the session, and read the MDN list of HTTP headers if you need the general meaning of request and response header fields.

Each name has one job in the handshake: ct identifies the session, cd proves fresh work, v names the script build, and KP_UIDz carries the session cookie. The glossary below gives the plain definition and one practical consequence per name.

x-kpsdk-ct
The client token. In the Catmouse reference sequence the target returns it on the /fp 429 response and refreshes it on /tl. Send the newest value on protected calls. When you ask POST /Solver/cd to bind a proof to the session, the ct you pass must be at least 16 characters or the API answers 400 invalid_ct.
x-kpsdk-cd
The challenge data proof. It embeds timing anchors, so it is generated right before the protected request and used once. See the single-use cd and clock skew post.
x-kpsdk-v
The SDK version string the served ips.js declares, such as j-1.2.661. The prefix identifies the family: j- or v- for web, i- for native iOS and a- for native Android. See the version rotation post.
x-kpsdk-dt
A header the solver returns as dtHeader and the client sends on /tl next to ct and im.
x-kpsdk-im
A value found in the query string of the ips.js URL on the /fp page. The solver returns it as imHeader, and the client sends it on /tl.
x-kpsdk-h and x-kpsdk-fc
Headers from the /mfc route that native SDK flows call. Pass them to POST /Solver/solve as hHeader and fcHeader. See the mobile SDK post.
x-kpsdk-dv
A device value used by native SDK flows. On Android the client supplies it as dvHeader. On iOS the solver accepts a client-computed kpsdkDv or builds the value from app fields.
x-kpsdk-r
A response header on /tl. You read it and never send it. A /tl reply without it is the EMPTY_R case in the API reference.
KP_UIDz
A cookie that Kasada-protected sites commonly show in the client's cookie jar. Published Catmouse posts treat that as an observation, and the API does not return it. Handle it like any session cookie under the rules of RFC 6265.

In what order do the headers appear in a Kasada session?

In the Catmouse reference sequence a session starts with a 429 on /fp that issues x-kpsdk-ct (the status can differ by target), continues with the ips.js fetch and a /tl submission, and then repeats a cd plus ct pair for every protected request. The numbered list shows the order.

  1. GET /mfc on native SDK flows. The response carries x-kpsdk-h and x-kpsdk-fc, which go to the solver as hHeader and fcHeader.
  2. GET /fp. The target answers with an HTML challenge page and an x-kpsdk-ct response header, a 429 in the reference sequence. Keep whatever cookies the response sets.
  3. Parse the HTML. Read the ips.js URL. Its query string carries x-kpsdk-v and x-kpsdk-im.
  4. GET the ips.js URL. Keep the response as UTF-8 text.
  5. POST /Solver/solve. Send the script text, ipsUrl, the ct from step 2 as ctToken, kpsdkV, tz and tzOffset. The response gives a base64 payload and the headers for /tl.
  6. POST /tl. Send the decoded payload with the ct, dt, im and v headers. The reply carries r and a refreshed ct.
  7. Each protected request. Call POST /Solver/cd, then send the newest x-kpsdk-ct and the verbatim x-kpsdk-cd, with the session cookies your client holds.

What changes between /fp and a protected call?

The session token is refreshed on /tl, and each protected call needs a new single-use proof. Send the newest ct together with a fresh cd.

You can confirm this in your own HAR file by comparing the ct value on the /fp response with the one on the /tl response. Source: the Catmouse OpenAPI file and the published single-use cd article describe the same split between the session token and the per-call proof.

How do you list the Kasada headers in a HAR file?

Parse the HAR JSON, keep every entry that has an x-kpsdk- request or response header or a KP_UID cookie, and print only the names, never the values. The Python script below does that with the standard library.

import json
import sys
from urllib.parse import urlsplit


def kp_names(items, prefix, fold=True):
    names = {i["name"].lower() if fold else i["name"] for i in items if i["name"].lower().startswith(prefix)}
    return sorted(names)


def main(path):
    with open(path, encoding="utf-8") as f:
        har = json.load(f)
    for e in har["log"]["entries"]:
        req, res = e["request"], e["response"]
        sent = kp_names(req["headers"], "x-kpsdk-")
        got = kp_names(res["headers"], "x-kpsdk-")
        jar_out = kp_names(req.get("cookies", []), "kp_uid", fold=False)
        jar_in = kp_names(res.get("cookies", []), "kp_uid", fold=False)
        if sent or got or jar_out or jar_in:
            tail = "/".join(urlsplit(req["url"]).path.split("/")[-2:])
            print(req["method"], res["status"], tail)
            print("  request headers :", ", ".join(sent) or "-")
            print("  response headers:", ", ".join(got) or "-")
            print("  cookies sent    :", ", ".join(jar_out) or "-")
            print("  cookies set     :", ", ".join(jar_in) or "-")


main(sys.argv[1])

Run it as python kp_headers.py session.har. A healthy session shows x-kpsdk-ct on the /fp response, a /tl entry with a request x-kpsdk-dt and a response x-kpsdk-r, and a cd on each protected request. The curl call below fetches the cd for one protected request from the documented endpoint:

curl -sS https://kasadaapi.catmouse.ai/Solver/cd \
  -H "x-api-key: $CATMOUSE_KEY" \
  -H "content-type: application/json" \
  -d '{"host":"www.example.com","platform":"web","ct":"<x-kpsdk-ct of the session>"}'

A successful reply is HTTP 200 OK with success, host, platform and cd. Copy cd verbatim into the x-kpsdk-cd header of one outbound request.

What does a wrong or missing value look like?

The documented symptoms are a 400 from the solver and a 200 from /tl with an empty body and no x-kpsdk-r. Match the symptom to the list below. Anything else about target behavior is not documented here.

  • 429 from the target: status 429 is defined in RFC 6585 as Too Many Requests. The Catmouse reference sequence shows it on /fp before the /tl step. This page does not document which missing header causes it on other requests.
  • 200 with an empty body and no x-kpsdk-r on /tl: the API reference calls this EMPTY_R. It names a stale x-kpsdk-v and a mismatched timezone or exit IP as causes. Re-fetch /fp and ips.js and read the version from the new URL.
  • Protected call rejected after a good /tl: check that the cd is single-use, generated immediately before sending, and paired with the newest ct.
  • 400 from the solver: a field problem such as missing tz and tzOffset, an ipsBody that is not a Kasada script or is truncated, or a ct shorter than 16 characters on /Solver/cd. Fix the request before retrying.

Results depend on the target's configuration and on your network path. This page lists symptoms and their documented causes and does not predict outcomes.

Is an empty /tl response a solver bug?

Not necessarily. The API reference lists a stale x-kpsdk-v and a mismatched timezone or exit IP as causes, so check those before you retry.

Compare your failing session with one that works. Your tz and tzOffset should describe the exit IP that sent /fp, and your ips.js URL should be the latest one. However, if both match and the response is still empty, the site is declining the payload, so change one variable at a time instead of retrying in a loop.

Key takeaways

Three rules follow from the documented rows of Table 1: refresh ct after every /tl, generate cd per request, and read v from the latest ips.js URL. Each rule has a public source in the Evidence section below, and nothing else is claimed.

  • ct changes during a session: always send the newest value returned by the target.
  • cd is single-use: one proof per protected request, generated just before sending.
  • v comes from the served script: never store it in configuration.

Conclusion and Architecture Recommendations

Treat the Kasada headers as three groups: session state (ct and the cookie jar), per-script values (v, im, dt) and per-request proof (cd). Keep each group in its own part of the client so a rotation or a refresh touches one place.

  • Session object: hold the cookie jar and the latest ct together, and replace both after each /tl response.
  • Script cache keyed by version: store ips.js and im against the x-kpsdk-v string, and evict on any change.
  • Just-in-time proof: call POST /Solver/cd inside the request function, never from a queue.
  • Header logging by name only: log which x-kpsdk-* names were present, as the script above does, and keep values out of logs.

Scope and limitations. This reference reflects Catmouse documentation and published posts as of 2026-11-13. The vendor does not publish a header specification that Catmouse can cite, so names without a documented failure signature are marked as such and unverified behavior is left out. Protections change, and no success rate or latency figure is stated. Use it only on systems you own or are authorized to test. Pricing is on the pricing page and the endpoints are in the API reference.

Evidence and sources

Every statement on this page traces to the Catmouse OpenAPI contract, the Catmouse API reference, an earlier published Catmouse post or an IETF RFC. The sources below name what each one supports and the date it was reviewed.

Methodology and limits. The page states only what the public Catmouse documents and the cited RFCs support. Target-side reactions to wrong header values are not documented publicly, so they are omitted. Reviewed 2026-11-13.

Frequently asked questions

The five answers below cover the session token, the single-use proof, the version string, the cookie and the part of the API surface that returns these headers. Each answer repeats the structured data on this page word for word.

What does the x-kpsdk-ct header do?

x-kpsdk-ct is the session token. In the Catmouse reference sequence the target returns it on the /fp 429 response and refreshes it on /tl, and the client sends the newest value on /tl and on protected requests.

Can an x-kpsdk-cd value be reused?

No. x-kpsdk-cd is a single-use proof with embedded timing anchors. Generate one immediately before each protected request, because a reused or early-generated value is rejected as used or expired.

Why must x-kpsdk-v match the ips.js you fetched?

x-kpsdk-v names the script build that produced the submission. If a client caches an older script or hardcodes an old version after the target rolls a new build, the header and payload diverge from what the edge expects.

Which cookie shows up in a Kasada session?

Published Catmouse posts describe KP_UIDz as the cookie that Kasada-protected sites commonly show in the client's cookie jar. That is an observation and the Catmouse API does not return it. Handle it like any session cookie under RFC 6265.

Which of these headers does the Catmouse API return?

POST /Solver/solve returns x-kpsdk-ct, x-kpsdk-dt, x-kpsdk-im and x-kpsdk-v for /tl, and native SDK solves add fc, h and dv. POST /Solver/cd returns the x-kpsdk-cd value. The x-kpsdk-r header and the cookies come from the target.