# Replace pipeline

URL: https://docs.hanzo.ai/docs/openapi/world/put-world-pipeline

> Replaces the caller project's news pipeline and returns what was stored.

`PUT /v1/world/pipeline`

> [World →](https://docs.hanzo.ai/docs/openapi/world) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                          |
| ------------- | ---------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/world/pipeline` |
| **Method**    | `PUT`                                    |
| **Operation** | `put_world_pipeline`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`   |

Replaces the caller project's news pipeline and returns what was
stored. It is a WHOLE replacement, not a patch: a field the request leaves out is
stored empty, so sending only feeds clears the filters.

Every feed URL is validated HERE, at the write boundary — http(s) only, and the
host must be on the server's allowlist — so a stored pipeline can never name a
host the fetcher would later refuse, and the allowlist is one decision in one
place rather than a check at each fetch.

## Request

5 fields, body `application/json` (required).

| Field              | In   | Type          | Required | Description                                                                                            |
| ------------------ | ---- | ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `feeds`            | body | string\[]     | —        | Feeds is the RSS/Atom feed URLs to read, at most 64.                                                   |
| `filters`          | body | world.Filters | —        |                                                                                                        |
| `filters.keywords` | body | string\[]     | —        | Keywords keeps only items whose TITLE contains one of these, case-insensitively.                       |
| `filters.regions`  | body | string\[]     | —        | Regions keeps only items whose TITLE contains one of these, matched case-insensitively as a substring. |
| `filters.sources`  | body | string\[]     | —        | Sources keeps only items whose outlet name contains one of these, case-insensitively.                  |

## Response

| Status    | Body               | Meaning |
| --------- | ------------------ | ------- |
| `200`     | world.pipelineView | ok      |
| `default` | problem-details    | refused |

`200` body — 10 fields.

| Field              | In   | Type          | Always | Description                                                                                            |
| ------------------ | ---- | ------------- | ------ | ------------------------------------------------------------------------------------------------------ |
| `createdAt`        | body | string        | —      | CreatedAt is when the pipeline was first stored, RFC3339 UTC.                                          |
| `default`          | body | boolean       | —      | Default is true when no pipeline is stored for this project and these are the built-in world feeds.    |
| `feeds`            | body | string\[]     | —      | Feeds is the RSS/Atom feed URLs the pipeline reads.                                                    |
| `filters`          | body | world.Filters | —      |                                                                                                        |
| `filters.keywords` | body | string\[]     | —      | Keywords keeps only items whose TITLE contains one of these, case-insensitively.                       |
| `filters.regions`  | body | string\[]     | —      | Regions keeps only items whose TITLE contains one of these, matched case-insensitively as a substring. |
| `filters.sources`  | body | string\[]     | —      | Sources keeps only items whose outlet name contains one of these, case-insensitively.                  |
| `org`              | body | string        | —      | Org is the tenant the pipeline belongs to, resolved server-side from the validated principal.          |
| `project`          | body | string        | —      | Project is the org sub-scope the pipeline belongs to.                                                  |
| `updatedAt`        | body | string        | —      | UpdatedAt is when it was last written, RFC3339 UTC.                                                    |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo world pipeline replace
```

**SDK**

**.ts**

```ts
import { Configuration, WorldApi } from 'hanzoai';

const api = new WorldApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putWorldPipeline({ feeds: ["<feeds>"], filters: {"keywords":["<keywords>"],"regions":["<regions>"],"sources":["<sources>"]} });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WorldApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WorldApi(client).put_world_pipeline(feeds=["<feeds>"], filters={"keywords":["<keywords>"],"regions":["<regions>"],"sources":["<sources>"]})
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.WorldAPI.PutWorldPipeline(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, world_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = world_api::put_world_pipeline(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WorldApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new WorldApi(client).putWorldPipeline();
```

**HTTP**

```bash
curl -X PUT https://api.hanzo.ai/v1/world/pipeline \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "feeds": [
         "<feeds>"
       ],
       "filters": {
         "keywords": [
           "<keywords>"
         ],
         "regions": [
           "<regions>"
         ],
         "sources": [
           "<sources>"
         ]
       }
     }'
```

**MCP**

MCP reaches **world** through the `world` tool, which names its 5 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_worlds"
         }
       }
     }'
```

---

[World API](https://docs.hanzo.ai/docs/openapi/world) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
