Skip to content

This page is available as Markdown at https://developers.klaviyo.com/en/v2026-07-15/reference/update_agent_secret_beta.md. Its OpenAPI document is at https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15.pre/openapi/beta/apis/update_agent_secret_beta.json. An index of every page is at https://developers.klaviyo.com/llms.txt.

KlaviyoKlaviyoDevelopers
v2026-07-15

This endpoint is in beta. Call it with the revision header 2026-07-15.pre. Beta endpoints may change before they're generally available. See our versioning and deprecation policy for more information.

You're reading the reference for API revision 2026-07-15. The latest revision is 2026-10-15. See this page in the latest revision.

Update Agent Secret

PATCHhttps://a.klaviyo.com/api/agent-secrets/{id}

Renames the secret and/or rotates its value.

Rotating the value re-encrypts the secret at rest; every tool that references this secret picks up the new value automatically without per-tool reconfiguration.

Revision header
revision: 2026-07-15.prerequired
Scopes
agents:write
Rate limits
Burst: 10/sSteady: 150/m

Path parameters

  • id#stringrequired

Query parameters

  • fields[agent-secret]#string[]

    For more information please visit API overview

    Allowed values:
    • created_at
    • id
    • mask
    • name
    • updated_at

Headers

  • revision#stringrequired

    API endpoint revision (format: YYYY-MM-DD[.suffix])

    2026-07-15.pre

Request body

Content type: application/vnd.api+jsonrequired

  • data#objectrequired
    Show 3 fields
    • type#stringrequired
      Allowed values:
      • agent-secret
    • id#stringrequired

      Agent Secret identifier.

      Example: sec_abc123

    • attributes#objectrequired
      Show 2 fields
      • name#stringnullable

        Display name for the secret. Leading and trailing whitespace is stripped before validation; the resulting name must be non-empty.

        Example: Rotated order API key

      • value#stringnullable

        Plaintext secret value. Setting this field rotates the secret; all tools referencing it pick up the new value automatically.

        Example: sk_live_rotated

Responses

200Success

Content type: application/vnd.api+json

  • data#objectrequired
    Show 5 fields
    • type#stringrequired
      Allowed values:
      • agent-secret
    • id#stringrequired

      Agent Secret identifier.

      Example: sec_abc123

    • attributes#objectrequired
      Show 4 fields
      • name#stringrequired

        Display name for the secret.

        Example: Order API key

      • mask#stringrequired

        Last 3 characters of the plaintext value, for visual disambiguation. The plaintext itself is never returned.

        Example: **********ken

      • created_at#string<date-time>required

        Date and time when the secret was created.

        Example: 2026-05-13T12:00:00+00:00

      • updated_at#string<date-time>required

        Date and time when the secret was last updated.

        Example: 2026-05-13T12:00:00+00:00

    • relationships#objectrequired
      Show 1 field
      • agent-tools#objectrequired
        Show 2 fields
        • data#object[]
          Show 2 fields
          • type#stringrequired
            Allowed values:
            • agent-tool
          • id#stringrequired

            Agent tool IDs that reference this secret.

4XXClient Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string

5XXServer Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string