> ## 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.

# Instantly Custom Tag Operations: Inputs, Cost & CLI

> Assigning or removing Instantly custom tags for campaigns/accounts. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=instantly_assign_or_unassign_tags_to_resources:{"tag_ids":"{{tag_ids}}","resource_type":"{{resource_type}}","resource_ids":"{{resource_ids}}","assign":"{{assign}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                    | Type               | Required | Default | Description |
| ----------------------- | ------------------ | -------- | ------- | ----------- |
| `payload.tag_ids`       | `array`            | Yes      |         |             |
| `payload.resource_type` | `1 \| 2`           | Yes      |         |             |
| `payload.resource_ids`  | `array`            | Yes      |         |             |
| `payload.assign`        | `boolean`          | Yes      |         |             |
| `payload.selected_all`  | `boolean`          | No       |         |             |
| `payload.filter`        | `string \| object` | No       |         |             |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Assign or unassign Instantly custom tags to resources.",
    "properties": {
      "tag_ids": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "string",
          "minLength": 1
        }
      },
      "resource_type": {
        "anyOf": [
          {
            "type": "number",
            "const": 1
          },
          {
            "type": "number",
            "const": 2
          }
        ]
      },
      "resource_ids": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "string",
          "minLength": 1
        }
      },
      "assign": {
        "type": "boolean"
      },
      "selected_all": {
        "type": "boolean"
      },
      "filter": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1
          },
          {
            "type": "object",
            "minProperties": 1,
            "properties": {
              "tag_id": {
                "type": "string",
                "minLength": 1
              },
              "search": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        ]
      }
    },
    "required": [
      "tag_ids",
      "resource_type",
      "resource_ids",
      "assign"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

Output schema is not available yet.

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "description": "Raw Instantly tag assignment response."
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute instantly_assign_or_unassign_tags_to_resources --payload '{
  "tag_ids": "array",
  "resource_type": "1",
  "resource_ids": "array",
  "assign": false
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ```md theme={null}
  > This can be used for both accounts and campaigns. Please check the `resource_type` field for more information.

  ## 63. Create custom tag

  Source: https://developer.instantly.ai/api-reference/customtag/create-custom-tag.md
  ```
</details>

## Cost

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