> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Zoho CRM: README

> Associate Territories to User. Includes SDK V2 and CLI requests, input constraints, response fields, and Deepline credit cost.

Associate Territories to User.

<Info>
  Tool ID: `zoho_crm_users_territories_associate_territories_to_user`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'zoho_crm_users_territories_associate_territories_to_user',
  {
    "user": "example",
    "territories": [
      {
        "id": "id_123"
      }
    ]
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute zoho_crm_users_territories_associate_territories_to_user --input '{
  "user": "example",
  "territories": [
    {
      "id": "id_123"
    }
  ]
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "territories": [
      {
        "code": "SUCCESS",
        "details": {
          "id": "id_123"
        },
        "message": "Example message",
        "status": "success"
      }
    ]
  }
}
```

Use `deepline tools get zoho_crm_users_territories_associate_territories_to_user --json` for the latest machine-readable contract.

## Input reference

Request body to associate territories to a user

| Name                  | Type     | Required | Default | Details                                                |
| --------------------- | -------- | -------- | ------- | ------------------------------------------------------ |
| `payload.user`        | `string` | Yes      | —       | The ID of the user Format: `int64`.                    |
| `payload.territories` | `array`  | Yes      | —       | List of territory IDs to associate Maximum items: 200. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Request body to associate territories to a user",
    "properties": {
      "user": {
        "type": "string",
        "description": "The ID of the user",
        "format": "int64"
      },
      "territories": {
        "type": "array",
        "description": "List of territory IDs to associate",
        "maxItems": 200,
        "items": {
          "type": "object",
          "description": "Territory ID",
          "properties": {
            "id": {
              "type": "string",
              "description": "ID of the territory",
              "format": "int64"
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "user",
      "territories"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                                   | Type        | Required | Default | Details                                                                                        |
| -------------------------------------- | ----------- | -------- | ------- | ---------------------------------------------------------------------------------------------- |
| `result.data`                          | `object`    | Yes      | —       | Response for successful association of territories to a user                                   |
| `result.data.territories`              | `array`     | Yes      | —       | List of per-territory result items Minimum items: 0. Maximum items: 200. Items must be unique. |
| `result.data.territories[].code`       | `"SUCCESS"` | Yes      | —       | Result code Allowed: `SUCCESS`.                                                                |
| `result.data.territories[].details`    | `object`    | Yes      | —       | Details for the result item                                                                    |
| `result.data.territories[].details.id` | `string`    | Yes      | —       | ID of the territory Format: `int64`.                                                           |
| `result.data.territories[].message`    | `string`    | Yes      | —       | Human-readable message Maximum length: 1000.                                                   |
| `result.data.territories[].status`     | `"success"` | Yes      | —       | Status of the result Allowed: `success`.                                                       |
| `result.meta`                          | `object`    | No       | —       | Additional response metadata (status, paging).                                                 |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Response for successful association of territories to a user",
        "properties": {
          "territories": {
            "type": "array",
            "description": "List of per-territory result items",
            "minItems": 0,
            "maxItems": 200,
            "uniqueItems": true,
            "items": {
              "type": "object",
              "description": "Per-territory result item",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Result code",
                  "enum": [
                    "SUCCESS"
                  ]
                },
                "details": {
                  "type": "object",
                  "description": "Details for the result item",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the territory",
                      "format": "int64"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable message",
                  "maxLength": 1000
                },
                "status": {
                  "type": "string",
                  "description": "Status of the result",
                  "enum": [
                    "success"
                  ]
                }
              },
              "required": [
                "code",
                "details",
                "message",
                "status"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "territories"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
