---
title: Update transformer
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/python)

[Logpush](https://developers.cloudflare.com/api/python/resources/logpush)

[Transformers](https://developers.cloudflare.com/api/python/resources/logpush/subresources/transformers)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Update transformer

logpush.transformers.update(inttransformer\_id, TransformerUpdateParams\*\*kwargs)  \-> [TransformerUpdateResponse](https://developers.cloudflare.com/api/python/resources/logpush#%28resource%29%20logpush.transformers%20%3E%20%28model%29%20transformer%5Fupdate%5Fresponse%20%3E%20%28schema%29)

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](https://developers.cloudflare.com/fundamentals/api/get-started/create-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`

##### ParametersExpand Collapse 

account\_id: str

Identifier.

maxLength32

transformer\_id: int

The transformer ID.

minimum1

name: str

Customer-provided name for identification.

maxLength255

code: Optional\[str\]

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

maxLength32768

description: Optional\[str\]

Optional customer-provided description.

maxLength4096

##### ReturnsExpand Collapse 

class TransformerUpdateResponse: …

id: Optional\[int\]

The transformer ID.

minimum1

associated\_jobs: Optional\[List\[AssociatedJob\]\]

Logpush jobs that reference this transformer.

id: Optional\[int\]

The logpush job ID.

name: Optional\[str\]

The logpush job destination name.

object\_tag: Optional\[str\]

The zone or account tag.

object\_type: Optional\[Literal\["zone", "account"\]\]

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

One of the following:

"zone"

"account"

created\_at: Optional\[datetime\]

When the transformer was created (RFC 3339).

formatdate-time

dataset: Optional\[str\]

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\[str\]

Optional customer-provided description.

maxLength4096

name: Optional\[str\]

Customer-provided name for identification.

maxLength255

updated\_at: Optional\[datetime\]

When the transformer was last modified (RFC 3339).

formatdate-time

### Update transformer

Python

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
transformer = client.logpush.transformers.update(
    transformer_id=42,
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    name="redact-pii",
)
print(transformer.id)
```

200 example

```
{
  "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

200 example

```
{
  "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"
  }
}
```