AI instructions
The versioned instruction an agent renders: a prompt template whose text lives in immutable versions. Writing the next version and pointing active_version at it is how the text changes.
List AI instructions
A prompt template of an account, kept apart from the agents that use it so that its text has a history. The text itself lives in versions: writing a version is the only way to change it, and active_version says which one runs.
path Parameters
account_idId of the parent account.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: create_time, display_name.
filterAIP-160 subset (§8). Filterable: create_time, display_name. A field outside the list is INVALID_ARGUMENT.
List AI instructions › Responses
One page of ai_instructions.
This page of ai_instructions, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create AI instruction
Creates an instruction with its name and the variables its text may use, and no text yet: write the text as its first version (POST …/versions), which becomes the active one.
path Parameters
account_idId of the parent account.
Create AI instruction › Request Body
display_nameThe label that tells this instruction apart in a list. Free text.
descriptionWhat the instruction is for, for the people who maintain it.
variablesThe variable names the text may reference as {{name}}: lower-case letters, digits and _. A version that references a name not listed here is refused, and so is a run that supplies one — or leaves a referenced one out.
active_versionThe version a run uses unless its agent pins another. The first version becomes active by itself; after that, set this field to switch. Absent until a version exists.
Create AI instruction › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe label that tells this instruction apart in a list. Free text.
descriptionWhat the instruction is for, for the people who maintain it.
variablesThe variable names the text may reference as {{name}}: lower-case letters, digits and _. A version that references a name not listed here is refused, and so is a run that supplies one — or leaves a referenced one out.
active_versionThe version a run uses unless its agent pins another. The first version becomes active by itself; after that, set this field to switch. Absent until a version exists.
Get AI instruction
A prompt template of an account, kept apart from the agents that use it so that its text has a history. The text itself lives in versions: writing a version is the only way to change it, and active_version says which one runs.
path Parameters
account_idId of the parent account.
ai_instruction_idId of the parent ai_instruction.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get AI instruction › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe label that tells this instruction apart in a list. Free text.
descriptionWhat the instruction is for, for the people who maintain it.
variablesThe variable names the text may reference as {{name}}: lower-case letters, digits and _. A version that references a name not listed here is refused, and so is a run that supplies one — or leaves a referenced one out.
active_versionThe version a run uses unless its agent pins another. The first version becomes active by itself; after that, set this field to switch. Absent until a version exists.
Delete AI instruction
Deletes an instruction that no agent uses; while one does, the call fails with FAILED_PRECONDITION (INSTRUCTION_IN_USE). Past runs keep the text they used.
path Parameters
account_idId of the parent account.
ai_instruction_idId of the parent ai_instruction.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete AI instruction › Responses
Deleted. No body (§7).
Update AI instruction
Renames an instruction, changes its variables, or switches the version that runs by setting active_version. The text itself does not change here — create a version for that. A change that would leave the active version referencing an undeclared variable is refused.
path Parameters
account_idId of the parent account.
ai_instruction_idId of the parent ai_instruction.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update AI instruction › Request Body
display_nameThe label that tells this instruction apart in a list. Free text.
descriptionWhat the instruction is for, for the people who maintain it.
variablesThe variable names the text may reference as {{name}}: lower-case letters, digits and _. A version that references a name not listed here is refused, and so is a run that supplies one — or leaves a referenced one out.
active_versionThe version a run uses unless its agent pins another. The first version becomes active by itself; after that, set this field to switch. Absent until a version exists.
Update AI instruction › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe label that tells this instruction apart in a list. Free text.
descriptionWhat the instruction is for, for the people who maintain it.
variablesThe variable names the text may reference as {{name}}: lower-case letters, digits and _. A version that references a name not listed here is refused, and so is a run that supplies one — or leaves a referenced one out.
active_versionThe version a run uses unless its agent pins another. The first version becomes active by itself; after that, set this field to switch. Absent until a version exists.
List AI instruction versions
An immutable text of an instruction. Versions are numbered from 1 and never edited or deleted: to change the text, create the next version, then point the instruction's active_version at it if it is not the first.
path Parameters
account_idId of the parent account.
ai_instruction_idThe instruction this is a version of. Fixed by the URL.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: version desc. Sortable: version.
filterAIP-160 subset (§8). Filterable: created_by. A field outside the list is INVALID_ARGUMENT.
List AI instruction versions › Responses
One page of versions.
This page of versions, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create AI instruction version
Writes the next text of an instruction — the only way its text changes. The number is assigned by the server. The text may reference only the instruction's variables. The first version of an instruction becomes its active_version; a later one runs once the instruction is updated to point at it.
path Parameters
account_idId of the parent account.
ai_instruction_idThe instruction this is a version of. Fixed by the URL.
Create AI instruction version › Request Body
contentThe template text. {{name}} is replaced by the run's value for name, which must be one of the instruction's variables; any other text, other braces included, is sent as written.
notesWhy this version exists — the one thing a comparison of two texts cannot tell you.
Create AI instruction version › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
ai_instruction_idThe instruction this is a version of. Fixed by the URL.
versionThe version number — also this resource's id. Assigned by the server: one more than the instruction's latest.
contentThe template text. {{name}} is replaced by the run's value for name, which must be one of the instruction's variables; any other text, other braces included, is sent as written.
notesWhy this version exists — the one thing a comparison of two texts cannot tell you.
created_byThe user who wrote this version, as users/{user}.
Get AI instruction version
An immutable text of an instruction. Versions are numbered from 1 and never edited or deleted: to change the text, create the next version, then point the instruction's active_version at it if it is not the first.
path Parameters
account_idId of the parent account.
ai_instruction_idThe instruction this is a version of. Fixed by the URL.
versionThe version number — also this resource's id. Assigned by the server: one more than the instruction's latest.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get AI instruction version › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
ai_instruction_idThe instruction this is a version of. Fixed by the URL.
versionThe version number — also this resource's id. Assigned by the server: one more than the instruction's latest.
contentThe template text. {{name}} is replaced by the run's value for name, which must be one of the instruction's variables; any other text, other braces included, is sent as written.
notesWhy this version exists — the one thing a comparison of two texts cannot tell you.
created_byThe user who wrote this version, as users/{user}.