Docs
API 1.39
Status
Sessions

Rename a session or replace its storage state

PATCH /v1/sessions/{id}: Rename a session or replace its storage state

PATCH /v1/sessions/{id}
Operation idupdateSession
Key scoperun: keys that run jobs (and admin keys)
SectionSessions

#Parameters

NameInTypeRequiredDescription
idpathstringyesmin length 1

#Request body

FieldTypeRequiredDescription
namestringpattern ^[a-z0-9][a-z0-9-]{1,62}$
concurrency"exclusive", "shared"
refreshobject or null
refresh.programstringyesmin length 1
refresh.inputsmap of string or number or boolean
storage_stateobject
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

#Example request

curl -X PATCH "https://api.kaab.ist/v1/sessions/{id}" \
  -H "Authorization: Bearer $KAAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"concurrency":"shared","refresh":null}'

#Responses

#200

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
404Resource not found
409Conflicting state (see error.code)
422Semantically invalid request (see error.code)
429Rate limited; see Retry-After
500internal: unexpected server error

Was this page helpful?