Unify and manage your data

Update an agent's custom instructions

Learn more about how to replace or clear your custom instruction for an agent using the public API.

The Update an agent's custom instructions replaces the custom instruction associated with your user account for a specified agent. You can submit instruction text directly or use an encoded request. For large instructions, the Update an agent's custom instructions supports chunked uploads. A successful update returns the saved instruction, agent identifier, lock status, and last update time.

HTTP method and endpoint

Use the following HTTP method and endpoint path to replace or clear your custom instruction for an agent.

PUT https://{host}/ai/agentflow/api/v202605/{tenant_id}/agents/{agent_id}/custom-instructions

The following table describes the endpoint path parameters.

ParameterTypeRequiredDescription
tenant_idStringYesYour tenant identifier.
agent_idStringYesIdentifier of the agent whose instruction you want to update. Built-in agent IDs use uppercase letters, such as MRA. IDs for custom agents use lowercase UUIDs.

Request headers

The following request headers must be included.

HeaderValueRequired
AuthorizationBearer <access_token>Yes
Content-Typeapplication/jsonYes

Request body

The following table describes the request body parameters, including accepted values and defaults. Include either custom_instruction or encoded_request.

ParameterTypeRequiredDescriptionAccepted values / Default
custom_instructionStringConditionalInstruction text that replaces your saved custom instruction.Any text that is not flagged as inappropriate or potentially harmful. An empty string ("") clears the instruction. Required if encoded_request is absent. No default.
encoded_requestStringConditionalBase64-encoded JSON containing custom_instruction, or a portion of the encoded JSON for a chunked upload.Base64 string. Required if custom_instruction is absent. No default.
encodingStringNoIdentifies the compression applied before base64 encoding.gzip for a compressed payload. Default: none.
chunk_session_idStringConditionalIdentifies the upload session. Use the same value for every chunk in one update.Required for chunked uploads.
chunk_indexIntegerConditionalZero-based position of the current chunk.Required for chunked uploads. Accepted values: 0 through total_chunks - 1.
total_chunksIntegerConditionalTotal number of chunks in the upload session.Required for chunked uploads. Integer greater than or equal to 1.

The API accepts a single encoded_request without chunk parameters.

To prepare a large instruction for upload:

  1. Optionally, compress the JSON payload using gzip. If you compress the payload, set encoding to gzip.

  2. Base64-encode the payload.

  3. Divide the encoded payload into chunks of no more than 6,000 characters.

Example request

Use the following example to see how a complete request is structured with headers and a JSON body.

PUT https://{host}/ai/agentflow/api/v202605/{tenant_id}/agents/{agent_id}/custom-instructions
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "custom_instruction": "Always answer in French."
}

The following example shows how to clear a saved custom instruction.

PUT https://{host}/ai/agentflow/api/v202605/{tenant_id}/agents/{agent_id}/custom-instructions
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "custom_instruction": ""
}

The following example shows a single encoded request. The encoded_request value represents base64-encoded JSON containing the custom_instruction field.

PUT https://{host}/ai/agentflow/api/v202605/{tenant_id}/agents/{agent_id}/custom-instructions
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "encoded_request": "<base64_encoded_payload>"
}

The following example shows the first chunk of a three-chunk upload. Subsequent chunks use indexes 1 and 2 with the same session identifier.

PUT https://{host}/ai/agentflow/api/v202605/{tenant_id}/agents/{agent_id}/custom-instructions
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "encoded_request": "<base64_encoded_chunk_0>",
  "chunk_session_id": "instruction-upload-001",
  "chunk_index": 0,
  "total_chunks": 3
}

Response body

The following table describes the fields returned in the response body after a successful update.

ParameterTypeDescription
agent_idStringIdentifier of the agent specified in the request path.
custom_instructionStringSaved custom instruction. An empty string indicates that you cleared the instruction.
lockedBooleanIndicates whether an tenant administrator has disabled user-defined instructions for the agent. A successful update returns false.
updated_atDatetimeTime of the last update in ISO 8601 UTC format.

For a non-final chunk, the API returns HTTP 202 Accepted with a status field containing chunk_received. A completed update returns HTTP 200 OK with the fields listed in the table.

Example response

The following example shows a successful HTTP 200 OK response with the saved custom instruction.

{
  "agent_id": "MRA",
  "custom_instruction": "Always answer in French.",
  "locked": false,
  "updated_at": "2026-10-14T07:58:30.087566Z"
}

The following example shows the HTTP 202 Accepted response for a non-final chunk.

{
  "status": "chunk_received"
}

The following table lists the possible error responses returned by this API.

HTTP statusDescriptionRecommended action
400 Bad RequestThe instruction fails content guardrail validation.Review the instruction, revise the content, and resend the request.
400 Bad RequestThe decoded payload does not contain custom_instruction, or the base64, gzip, or JSON payload is invalid.Verify the encoded payload and resend the request.
400 Bad RequestA chunk index is invalid, or required chunks are missing. Missing chunks can return MISSING_CHUNKS with a missing_indices array.Verify the chunk indexes and submit all required chunks.
401 UnauthorizedThe access token is missing or invalid.Provide a valid OAuth bearer token and resend the request.
403 ForbiddenThe token lacks the required permission, AI is not enabled for the tenant, or the agent is unavailable to the tenant or environment.Verify that the token has agentflow:*, agentflow:agents.*, or agentflow:agents.EXECUTE permission for the tenant. Check tenant AI availability and agent access.
403 ForbiddenA tenant administrator has locked user-defined custom instructions for the agent.Contact your tenant administrator to allow user-defined custom instructions for the agent.
422 Unprocessable EntityThe request includes neither custom_instruction nor encoded_request, or a field has an invalid type.Provide custom_instruction or encoded_request, and verify the field types.
500 Internal Server ErrorAn unexpected server error prevents the update.Retry the request. If the error persists, contact Reltio Support.