# createDealCustomField

Create a custom-field DEFINITION on a deal pipeline you OWN (pipelineId from listPipelines): name + type (TEXT | NUMBER | DOLLAR | DATE | LINK | DROPDOWN; `options` required and non-empty for DROPDOWN; `allowMultiple`/`defaultValue` optional). Applied synchronously. Deal custom fields are per-pipeline, and a shared pipeline cannot be modified. Returns the pipeline's field set; read the new id back by matching the name (or use listDealCustomFields), then write values via the deal's customFieldValues input on createDeal / updateDeal.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "createDealCustomField", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `input`: `CreatePipelineItemCustomFieldInput!` (required)
  - `name`: `String!` (required)
  - `type`: `PipelineItemCustomFieldType!` (required, one of `DROPDOWN`, `TEXT`, `NUMBER`, `DOLLAR`, `DATE`, `LINK`)
  - `options`: `[String!]`
  - `defaultValue`: `String`
  - `allowMultiple`: `Boolean`
  - `description`: `String`
- `pipelineId`: `ID!` (required)

## Response (data, an example)

```json
{
  "dealCustomFieldMutation": {
    "createCustomField": {
      "getPipelineCustomFields": [
        {
          "id": "<ID>",
          "name": "…",
          "type": "DROPDOWN"
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "createDealCustomField",
    "variables": {
      "input": {
        "name": "<String>",
        "type": "DROPDOWN"
      },
      "pipelineId": "<pipelineId>"
    }
  }'
```
