Skip to content

Patch an owned agent configuration

PATCH
/open/v1/role/{roleId}
curl --request PATCH \
--url https://api.harperharbor.com/open/v1/role/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "roleName": "example", "roleDesc": "example", "roleReadme": "example", "roleTag": [ "example" ], "userName": "example", "roleDetailDesc": "example", "idempotencyKey": "example" }'

Requires role.write and ownership. Updates only supplied fields of an owned configuration, including from another application tenant and while unlisted. Community review is not required. Validation, immutable hosted snapshot restrictions and ownership checks remain enforced. Use the document endpoint for structured content patches.

roleId
required
string

Role id. Only the path parameter is honoured.

Media typeapplication/json

All keys optional; at least one must be present.

object
roleName

New name (blank ignored).

string
roleDesc

Short intro; limit 500 chars (2500 for English cards). Blank ignored.

string
<= 2500 characters
roleReadme

Detail introduction in Markdown for the card’s public page; never sent to the model during chat. Limit 20000 chars (40000 for English cards); over the limit returns role_readme_too_long. Blank ignored (clear it with POST /role/{roleId}/document).

string
<= 40000 characters
roleTag

Replacement tag list (empty array ignored).

Array<string>
userName

Player name used by the card (blank ignored).

string
roleDetailDesc

Full replacement of the private definition; must be non-blank; limit 10000 chars (50000 for English cards).

string
<= 50000 characters
idempotencyKey

Accepted; not used for deduplication.

string
Examplegenerated
{
"roleName": "example",
"roleDesc": "example",
"roleReadme": "example",
"roleTag": [
"example"
],
"userName": "example",
"roleDetailDesc": "example",
"idempotencyKey": "example"
}

Updated role summary (result of the last applied block).

Media typeapplication/json

Summary returned by every role write.

object
roleId
required

Role id.

string
roleVisibility
required

Current visibility. HarperHarbor defaults to unlisted (usable by ID without community listing).

string
Allowed values: private public waitReview unlisted
reviewStatus
required

Moderation status.

string
Allowed values: not_submitted pending passed rejected
accountPermission
required

Always owner on these routes.

string
Allowed values: owner
patch

Present when a deep patch was applied to a single field.

object
patchedOperations
required

Number of operations applied.

integer
charsBefore
required

Rune count before.

integer
charsAfter
required

Rune count after.

integer
sha256Before
required

Hex SHA-256 of the text before.

string
sha256After
required

Hex SHA-256 of the text after.

string
textPatches

Per-field patch summaries keyed by field name; present when fieldPatches were used.

object
key
additional properties
object
patchedOperations
required

Number of operations applied.

integer
charsBefore
required

Rune count before.

integer
charsAfter
required

Rune count after.

integer
sha256Before
required

Hex SHA-256 of the text before.

string
sha256After
required

Hex SHA-256 of the text after.

string
fieldChars

Character counts before/after for the edited field (e.g. roleDetailDesc, roleWelcome).

object
key
additional properties
object
before
required

Character (rune) count before the write.

integer
after
required

Character (rune) count after the write.

integer
nextRecommendedTools
required

Suggested next MCP tool names; informational.

Array<string>
Example
{
"roleVisibility": "private",
"reviewStatus": "not_submitted",
"accountPermission": "owner"
}

invalid JSON body, nothing to update (body {"error": "..."}).

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}

unauthorized.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}

permission_denied — not the author.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}

record not found, public_role_requires_clone, role_desc_too_long, role_detail_too_long, empty_field_patch, or another unclassified error; {"error": "<code>", "retryable": true}.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}