# setOrgDefaultRingPolicy

Replace the org's default call routing (every line without its own): humanStage (targetKind, ringSeconds 5 to 60, its target, an optional schedule) then aiStage (AI employees whose calls are on, SINGLE or ROUND_ROBIN). It saves the WHOLE policy, so read it first with getPhoneRouting and send it back changed; an omitted schedule or area-code map keeps what is saved. policy null deletes the default. Say the new path in plain words; it changes who picks up the org's calls from the next call on.

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

## Variables

- `policy`: `RingPolicyInput`
  - `humanStage`: `RingPolicyHumanStageInput`
    - `targetKind`: `CallRoundRobinTargetKind!` (required, one of `EXTERNAL`, `ORG_USER_ROTATION`, `TEAM`, `AREA_CODE_MAP`, `LINE_OWNER`, `NONE`, `SPECIFIC_USER`)
    - `ringSeconds`: `Int!` (required)
    - `externalE164`: `String`
    - `specificUserId`: `ID`
    - `phoneLineIds`: `[ID!]`
    - `userGroupId`: `ID`
    - `ringAllTeamMembers`: `Boolean`
    - `areaCodeForwardingMap`: `JSON`
    - `schedule`: `ContactAgentCallScheduleInput`
      - `timezone`: `String!` (required)
      - `days`: `[ContactAgentCallScheduleDayInput!]!` (required)
        - `day`: `ContactAgentDayOfWeek!` (required, one of `MON`, `TUE`, `WED`, `THU`, `FRI`, `SAT`, `SUN`)
        - `open`: `String!` (required)
        - `close`: `String!` (required)
        - `enabled`: `Boolean!` (required)
    - `ownerlessStep`: `RingPolicyOwnerlessStepInput`
      - `targetKind`: `CallRoundRobinTargetKind!` (required, one of `EXTERNAL`, `ORG_USER_ROTATION`, `TEAM`, `AREA_CODE_MAP`, `LINE_OWNER`, `NONE`, `SPECIFIC_USER`)
      - `externalE164`: `String`
      - `specificUserId`: `ID`
      - `phoneLineIds`: `[ID!]`
      - `userGroupId`: `ID`
  - `aiStage`: `RingPolicyAiStageInput`
    - `agentIds`: `[ID!]!` (required)
    - `rotation`: `RingPolicyAiRotation!` (required, one of `SINGLE`, `ROUND_ROBIN`)

## Response (data, an example)

```json
{
  "ringPolicyMutation": {
    "setOrgDefaultRingPolicy": {
      "id": "<ID>"
    }
  }
}
```

## 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": "setOrgDefaultRingPolicy",
    "variables": {}
  }'
```
