{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-mission-test-config-schema.json",
  "title": "MissionTestConfig",
  "description": "Saved mission-test configuration (Phase 60.1). Lets a user store sector/mission/\nacceptance/profile/phoneNumber and re-launch with one click via\n`POST /testing/mission-test-configs/{id}/runs`.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-openapi.json#/components/schemas/MissionTestConfig",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "name",
    "phoneNumber",
    "sector",
    "mission",
    "acceptance",
    "profileId",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "description": {
      "type": "string",
      "maxLength": 500
    },
    "phoneNumber": {
      "type": "string",
      "pattern": "^\\+[1-9]\\d{1,14}$"
    },
    "sector": {
      "type": "string",
      "minLength": 1
    },
    "mission": {
      "type": "string",
      "minLength": 1
    },
    "acceptance": {
      "type": "string",
      "minLength": 1
    },
    "profileId": {
      "type": "string",
      "minLength": 1
    },
    "tags": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 32,
        "pattern": "^[a-z0-9][a-z0-9-]*$"
      },
      "description": "Optional, lowercase, dash-or-alphanumeric workspace-scoped tags.\nUp to 10. Use the listMissionTestConfigs ?tag= filter to find\nconfigs by tag (single-tag exact match).\n"
    },
    "maxDurationSecs": {
      "type": "integer",
      "minimum": 30,
      "maximum": 1800,
      "description": "Optional per-call duration cap in seconds. Omit to use the\nserver default for the mission kind (freeform 180s, compliance 90s).\nRaise it for flows that collect a lot of data — a booking that needs\nname, date of birth, location and eligibility will not finish in 180s.\nUp to 1800 (30 minutes).\n"
    },
    "backgroundNoise": {
      "allOf": [
        {
          "$ref": "#/$defs/BackgroundNoise"
        }
      ],
      "description": "Caller background noise played under the call. Omit for none.\n"
    },
    "voiceId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Telnyx voice id for the call, from the operator-enabled catalogue\n(`GET /testing/voices`). Omit to use the configured default voice.\n"
    },
    "advancedParams": {
      "allOf": [
        {
          "$ref": "#/$defs/MissionAdvancedParams"
        }
      ],
      "description": "Optional per-call turn-detection overrides. Absent means\nmission-tester keeps its env-var defaults.\n"
    },
    "language": {
      "allOf": [
        {
          "$ref": "#/$defs/CallLanguage"
        }
      ],
      "description": "The call language. Absent means English.\n"
    },
    "scheduleId": {
      "type": "string",
      "description": "The schedule that runs this mission test automatically. Absent means manual runs only.\nA scheduled run waits for a free mission test slot like any other mission run, and a\nfire is skipped while the previous scheduled run of the same config is still waiting.\n"
    },
    "carrierRouteId": {
      "type": "string",
      "maxLength": 128,
      "description": "Bring-your-own-carrier (invite-only). Dial this config's runs through one of the workspace's\ncarrier routes, over the workspace's own SIP trunk, instead of nopaque's network. Carrier\nroutes are set up with nopaque. A mission with a route dials through it or not at all:\nif the route cannot be dialled when the run starts, the run is refused and the number is\nnever called normally. It is checked when the config is saved and resolved again at every launch.\nCarrier calls are metered as `carrier_s2stest`, from\nanswer, and count toward the trunk's daily minutes.\n"
    },
    "createdBy": {
      "type": "string",
      "description": "Set only on a config created by a sheet import (`POST /imports/{id}/commit`): the id of\nthe person whose commit created it. Absent on configs created any other way.\n"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "BackgroundNoise": {
      "type": "string",
      "enum": [
        "cafe",
        "street",
        "home",
        "wind"
      ],
      "description": "Caller background noise: café chatter, city street traffic, home (children and a\nbaby crying) or wind buffeting. The level is fixed per sound.\n"
    },
    "CallLanguage": {
      "type": "string",
      "enum": [
        "en",
        "multi",
        "es",
        "fr",
        "de",
        "it",
        "pt",
        "nl",
        "hi",
        "ru",
        "ja"
      ],
      "description": "The language a mission test call is held in. These are the languages\nTelnyx `deepgram/flux` accepts on the AI Assistant: one language, or\n`multi` (Flux-multi), which code-switches across the other ten. Absent\nmeans English. Mirrors `api/packages/schemas/entities/callLanguage.ts`\n(Zod). Distinct from the transcription languages standard tests and\nmapping use (`en-GB` etc.).\n"
    },
    "MissionAdvancedParams": {
      "type": "object",
      "description": "Optional advanced turn-detection overrides for a single mission test.\nMirrors `api/packages/schemas/entities/missionAdvancedParams.ts` (Zod).\nAll-or-nothing: every field is required when this object is present —\nthis is what makes it safe for the values to be sent to Telnyx as a\nsingle per-call block regardless of whether Telnyx merges into or\nreplaces the stored assistant's turn-detection settings. Omit the\nobject entirely to keep the server's env-var defaults.\n",
      "required": [
        "eagerEotThreshold",
        "eotThreshold",
        "eotTimeoutMs"
      ],
      "additionalProperties": false,
      "properties": {
        "eagerEotThreshold": {
          "type": "number",
          "minimum": 0.3,
          "maximum": 0.9,
          "description": "Lets the assistant start preparing a reply before it is sure the\nother side has finished (0.3-0.9). It does not make the assistant\nwait longer; `eotThreshold` does. Equal to `eotThreshold` switches\nearly preparation off.\n"
        },
        "eotThreshold": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 0.9,
          "description": "The main control: how confident the assistant must be that the\nother side has finished speaking before it replies (0.5-0.9). 0.9\nwaits longest and interrupts least; 0.5 replies at almost any pause.\n"
        },
        "eotTimeoutMs": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 10000,
          "description": "The longest the assistant sits through silence, in milliseconds,\nbefore replying anyway. A ceiling, not a minimum wait: raising it\ndoes not stop interruptions.\n"
        }
      }
    }
  }
}