Docs
API 1.39
Status
Sessions

Store a browser storage state as a reusable session

POST /v1/sessions: Store a browser storage state as a reusable session

POST /v1/sessions
Operation idcreateSession
Key scoperun: keys that run jobs (and admin keys)
SectionSessions

#Request body

FieldTypeRequiredDescription
namestringyespattern ^[a-z0-9][a-z0-9-]{1,62}$
storage_stateobjectyes
storage_state.cookiesobjectyes
storage_state.cookies[].namestringyes
storage_state.cookies[].valuestringyes
storage_state.cookies[].domainstringyes
storage_state.cookies[].pathstringyes
storage_state.cookies[].expiresnumberyes
storage_state.cookies[].httpOnlybooleanyes
storage_state.cookies[].securebooleanyes
storage_state.cookies[].sameSite"Strict", "Lax", "None"yes
storage_state.originsobjectyes
storage_state.origins[].originstringyes
storage_state.origins[].localStorageobjectyes
storage_state.origins[].localStorage[].namestringyes
storage_state.origins[].localStorage[].valuestringyes
originsstring
concurrency"exclusive", "shared"default "exclusive"
refreshobject
refresh.programstringyesmin length 1
refresh.inputsmap of string or number or boolean

#Example request

curl -X POST "https://api.kaab.ist/v1/sessions" \
  -H "Authorization: Bearer $KAAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"acme","storage_state":{"cookies":[{"name":"sid","value":"abc","domain":"portal.acme.test","path":"/","expires":1790000000,"httpOnly":true,"secure":true,"sameSite":"Lax"}],"origins":[{"origin":"https://portal.acme.test","localStorage":[{"name":"theme","value":"dark"}]}]},"origins":["https://portal.acme.test"],"concurrency":"exclusive","refresh":{"program":"acme-login","inputs":{"email":"[email protected]"}}}'

#Responses

#201

Session

Session

{
  "id": "ses_01j9zqk3q7m4n5p6r7s8t9v0wx",
  "object": "session",
  "name": "acme",
  "origins": [
    "https://portal.acme.test"
  ],
  "status": "valid",
  "concurrency": "exclusive",
  "refresh": {
    "program": "acme-login",
    "has_inputs": true
  },
  "last_verified_at": "2026-09-18T10:00:00Z",
  "last_used_at": "2026-09-18T10:00:00Z",
  "locked_by": null,
  "created_at": "2026-09-18T10:00:00Z",
  "updated_at": "2026-09-18T10:00:00Z"
}

#Errors

Every error answers with the error envelope; its code is one of the error codes.

StatusWhen
400request_invalid: request validation failed
401Missing or invalid API key
402insufficient_credits: top up to continue
403The key's scope does not cover this operation
409Conflicting state (see error.code)
422Semantically invalid request (see error.code)
429Rate limited; see Retry-After
500internal: unexpected server error

Was this page helpful?