Skip to content

Claim paths for writing (the session's own token)

POST
/v1/sessions/{session_id}/claims
curl --request POST \
--url http://127.0.0.1:8080/v1/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/claims \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "paths": [ "example" ], "already_edited": false }'

Each path is granted or denied on its own. A denied path names the session that holds it, and both sessions get a claim_conflict notice, or an unclaimed_edit notice when already_edited is true. Repeats of the same denial fold into one notice. Claims expire after 30 minutes unless a heartbeat extends them. A session holds at most 500 claims and makes at most 60 claim requests a minute. A request whose paths the session all holds already only renews them and does not count.

session_id
required
string format: uuid
Media typeapplication/json
object
paths
required
Array<string>
>= 1 items <= 500 items
already_edited

The caller edited the paths before it asked, as an edit hook reports after the fact.

boolean

Granted and denied paths.

Media typeapplication/json
object
digest

Up to three of the session’s most urgent undelivered notices, one line each, after a “Zentri notices:” header. A last line says how many more wait. Showing a notice here marks it delivered but not acked. Absent when nothing is undelivered or the caller is not the session’s own token.

string
granted
required
Array<object>
object
id
required
string format: uuid
project_id
required
string format: uuid
session_id
required
string format: uuid
path
required
string
mode
required
string
Allowed values: write
acquired_at
required
string format: date-time
expires_at
required
string format: date-time
user_handle
string
denied
required
Array<object>
object
path
required
string
holder
required
object
session_id
required
string format: uuid
user_id
required
string format: uuid
user_handle
required
string
intent_id
string format: uuid
intent_summary

What the holder works on, at most 160 characters on one line. Absent when it has no intent.

string
<= 480 characters
acquired_at
required
string format: date-time
expires_at
required
string format: date-time

Example

{
"granted": [
{
"mode": "write"
}
]
}

The request is malformed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

No valid bearer token.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The token may not do this.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

No such resource in the caller’s org.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The request clashes with current state.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

A rate limit or quota stopped the request. Retry-After gives seconds to wait.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}
Retry-After
integer