Skip to content

Submit the session's plan, which becomes its current plan (own session token only)

POST
/v1/sessions/{session_id}/plans
curl --request POST \
--url http://127.0.0.1:8080/v1/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "summary": "example", "steps": [ "example" ], "files": [ "example" ], "symbols": [ { "kind": "func", "name": "example" } ] }'

The summary and steps pass the secret scan before storage, and a hit sets redacted. The plan is matched against the other active sessions’ live claims and current plan files (a directory entry ends in / and covers every path under it), their symbols, and their current plan summaries. The submitter learns from overlaps, and each other session it overlaps gets one overlap_plan notice. A plan never claims files. A session submits at most 30 plans a minute.

session_id
required
string format: uuid
Media typeapplication/json
object
summary
required

1 to 2048 bytes of UTF-8. It must not be blank.

string
>= 1 characters
steps
Array<string>
<= 30 items
files
Array<string>
<= 200 items
symbols
Array<object>
<= 100 items
object
kind
required
string
Allowed values: func type component route table migration
name
required
string
>= 1 characters <= 200 characters

Stored.

Media typeapplication/json
object
plan_id
required
string format: uuid
created_at
required
string format: date-time
redacted
required
boolean
summary_check
required

skipped when the embedder failed or timed out. The plan then has no summary overlaps.

string
Allowed values: done skipped
overlaps
required
Array<object>
<= 100 items
object
reason
required

file is a planned path that another session claims or plans (source claim or plan). symbol is an exact symbol match and similar_symbol a trigram one (source plan or snapshot). summary is a summary cosine at or above the project’s partial_cosine (source plan).

string
Allowed values: file symbol similar_symbol summary
session_id
required
string format: uuid
user_handle
required
string
source
required
string
Allowed values: claim plan snapshot
path

For file, the other session’s path or directory.

string
symbol
object
kind
required
string
Allowed values: func type component route table migration
name
required
string
path
required

Empty for a symbol from a plan.

string
other
object
kind
required
string
Allowed values: func type component route table migration
name
required
string
path
required

Empty for a symbol from a plan.

string
similarity

For similar_symbol and summary.

number
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

Example

{
"summary_check": "done",
"overlaps": [
{
"reason": "file",
"source": "claim",
"symbol": {
"kind": "func"
},
"other": {
"kind": "func"
}
}
]
}

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"
}
}

The request is well formed but breaks a rule or a limit.

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