POST/v2/agents/templates

Create a team template

Creates a team-owned template by rebasing a customer OCI reference onto a base template, then kicks off a build. Supply name, base_template, and source_oci_ref; base_template must identify one of the supported base templates. The team ID is taken from the authenticated user.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 body fields

Template creation details for a team-owned template.

namestringrequired
The name of the template.
base_templatestringrequired
Base template key. One of: coding-base, coding-claude-code, coding-codex, coding-hermes, coding-opencode, langgraph.
source_oci_refstringrequired
The customer OCI reference to use as the template source.

7 status codes
201Returns the created template, including its ID, name, status, and creation and update timestamps. The template build is kicked off.
templateobjectoptional
400Returned when the request is invalid.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
401Returned when authentication fails because the credentials are invalid.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
402Returned when the team is blocked by the prepayment gate.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429Returned when the API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Returned when a server error occurs.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 400 is returned when the request is invalid; include name, base_template, and source_oci_ref, and use a supported base_template: coding-base, coding-claude-code, coding-codex, coding-hermes, coding-opencode, or langgraph. A 401 indicates invalid authentication credentials, and a 402 indicates that the team is blocked by the prepayment gate. A 429 indicates that the API rate limit has been exceeded, and a 500 indicates a server error.