Skip to content
Start here

Update transformer

PUT/accounts/{account_id}/logpush/transformers/{transformer_id}

Updates an existing custom log transformer. When code is provided, the SQL query is validated and a new version is created. When code is omitted, only the name and description are updated. Omitting description clears the existing description.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Logs Write
Path ParametersExpand Collapse
account_id: string

Identifier.

maxLength32
transformer_id: number

The transformer ID.

minimum1
Body ParametersJSONExpand Collapse
name: string

Customer-provided name for identification.

maxLength255
code: optional string

The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.

maxLength32768
description: optional string

Optional customer-provided description.

maxLength4096
ReturnsExpand Collapse
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
success: true

Whether the API call was successful.

result: optional object { id, associated_jobs, created_at, 4 more }
id: optional number

The transformer ID.

minimum1
associated_jobs: optional array of object { id, name, object_tag, object_type }

Logpush jobs that reference this transformer.

id: optional number

The logpush job ID.

name: optional string

The logpush job destination name.

object_tag: optional string

The zone or account tag.

object_type: optional "zone" or "account"

Whether the job is zone-scoped or account-scoped.

One of the following:
"zone"
"account"
created_at: optional string

When the transformer was created (RFC 3339).

formatdate-time
dataset: optional string

The dataset this transformer operates on, derived from the SQL query’s FROM clause. Informational only. May be absent if the dataset cannot be determined from the query.

description: optional string

Optional customer-provided description.

maxLength4096
name: optional string

Customer-provided name for identification.

maxLength255
updated_at: optional string

When the transformer was last modified (RFC 3339).

formatdate-time

Update transformer

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/logpush/transformers/$TRANSFORMER_ID \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -d '{
          "name": "redact-pii",
          "code": "SELECT ClientIP, RayID FROM http_requests",
          "description": "Redacts PII fields from HTTP request logs."
        }'
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": 42,
    "associated_jobs": [
      {
        "id": 123,
        "name": "s3-export",
        "object_tag": "023e105f4ecef8ad9ca31a8372d0c353",
        "object_type": "zone"
      }
    ],
    "created_at": "2026-08-01T12:00:00Z",
    "dataset": "http_requests",
    "description": "Redacts PII fields from HTTP request logs.",
    "name": "redact-pii",
    "updated_at": "2026-08-10T15:30:00Z"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": 42,
    "associated_jobs": [
      {
        "id": 123,
        "name": "s3-export",
        "object_tag": "023e105f4ecef8ad9ca31a8372d0c353",
        "object_type": "zone"
      }
    ],
    "created_at": "2026-08-01T12:00:00Z",
    "dataset": "http_requests",
    "description": "Redacts PII fields from HTTP request logs.",
    "name": "redact-pii",
    "updated_at": "2026-08-10T15:30:00Z"
  }
}