---
title: "Point a channel at versions with weights"
url: https://hexelstudio.com/docs/api/harness/agents/point-a-channel-at-versions-with-weights
---

# Point a channel at versions with weights

**PUT** `/harness/agents/{name}/channels/{channel}`

1 to 10 targets whose weights add up to 100. Refused by the environment's promotion gates when they apply.

## Headers

- `Authorization: string`

  `Bearer <token>`. A Hexel Studio access token for your organization.

- `X-Workspace-Id: string`

  The workspace the request acts in (`ws_...`). It never grants access by itself.

- `X-Environment-Id: string`

  The environment the request acts in (`env_...`). It never grants access by itself.

## Body parameters

- `targets: array of Target`

  - `version: integer`

  - `weight: integer`

## Returns

`200` The agent with the channel changed. (`Agent`)

- `channels: map[array of Target]`

- `created_at: string`

- `created_by: string`

- `id: string`

- `latest_version: integer`

- `name: string`

- `registry_agent_id: optional string`

## Errors

- `default` 

## Example

```bash
curl --request PUT \
  --url 'https://api.hexelstudio.com/v1/harness/agents/{name}/channels/{channel}' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'X-Workspace-Id: X_WORKSPACE_ID' \
  --header 'X-Environment-Id: X_ENVIRONMENT_ID' \
  --header 'Content-Type: application/json' \
  --data '{
  "targets": [
    {
      "version": 0,
      "weight": 0
    }
  ]
}'
```

### Response (200)

```json
{
  "channels": {
    "key": [
      {
        "version": 0,
        "weight": 0
      }
    ]
  },
  "created_at": "2026-01-01T00:00:00Z",
  "created_by": "string",
  "id": "string",
  "latest_version": 0,
  "name": "string",
  "registry_agent_id": "string"
}
```
