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

# Trestle Phone Validation: Inputs, Cost & CLI Example

> Validate a phone number for line type, carrier, activity score (0-100), and prepaid status before outbound calling. Includes inputs, outputs, and CLI examples.

## 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=trestle_phone_validation:{"phone":"{{phone}}"}' --json
```

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

## Input Schema

| Name                   | Type     | Required | Default | Description                                                         |
| ---------------------- | -------- | -------- | ------- | ------------------------------------------------------------------- |
| `payload.phone`        | `string` | Yes      |         | Phone number to validate (E.164 or digits).                         |
| `payload.country_hint` | `string` | No       |         | ISO 3166-1 alpha-2 country code hint for parsing ambiguous numbers. |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Validate a phone number via Trestle Phone Intel API. Returns is_valid, line_type, carrier, activity_score (0-100), and is_prepaid. Use this for cheap validation before outbound. Does NOT verify identity - use trestle_real_contact for name matching.",
    "properties": {
      "phone": {
        "type": "string",
        "description": "Phone number to validate (E.164 or digits).",
        "minLength": 1
      },
      "country_hint": {
        "type": "string",
        "description": "ISO 3166-1 alpha-2 country code hint for parsing ambiguous numbers.",
        "minLength": 2,
        "maxLength": 2
      }
    },
    "required": [
      "phone"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name          | Type     | Required | Default | Description |
| ------------- | -------- | -------- | ------- | ----------- |
| `result.data` | `object` | Yes      |         |             |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "is_valid": {
            "type": "boolean"
          },
          "activity_score": {
            "type": "integer"
          },
          "line_type": {
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "is_prepaid": {
            "type": "boolean"
          },
          "country_code": {
            "type": "string"
          },
          "warnings": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "id",
          "phone_number",
          "is_valid",
          "activity_score",
          "line_type",
          "carrier",
          "is_prepaid",
          "country_code",
          "warnings"
        ],
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": true
  }
  ```
</details>

## Advanced: Direct CLI

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

```bash theme={null}
deepline tools execute trestle_phone_validation --payload '{
  "phone": "string"
}' --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.                      |

## Cost

* Pricing model: `per_result` (per result).
* Estimated Deepline credits: `0.21` per pricing unit.
* Billing mode: `post_deduct`.
