> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turrisfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Request a Termination

> Request the termination of one appointment, and get the request or the reason it was refused

Requests the termination of an agent's or agency's appointment with the carrier of `productId`, in `stateCode`. The answer is the one the Turris dashboard would give: `201` with the new request, or the reason it was refused. Needs the Appointment product feature.

## Request Body

Send exactly one of `agentId` and `downstreamEntityAssociationId`. Neither or both returns `400`. An agency you have archived in Turris, and an agent you have removed from your agencies, can still be terminated.

For an agent:

```json theme={null}
{
  "agentId": "6650a1b2c3d4e5f6a7b8c9d0",
  "stateCode": "TX",
  "productId": "6600a1b2c3d4e5f6a7b8c9d0",
  "terminationReasonCode": "1"
}
```

For an agency, name it by its association with you:

```json theme={null}
{
  "downstreamEntityAssociationId": "6651a1b2c3d4e5f6a7b8c9d0",
  "stateCode": "TX",
  "productId": "6600a1b2c3d4e5f6a7b8c9d0",
  "terminationReasonCode": "1"
}
```

`terminationReasonCode` is the NIPR termination reason code, as a string. Whether it is required, and which codes are accepted, depends on the state. See [Termination Reason Codes](#termination-reason-codes).

## What You Get Back

Every request starts as `pending` with `processingMethod` `manual`: Turris operations files it with the state, and its `status` moves from there. Follow it with [Get a Termination Request](https://docs.turrisfi.com/api-reference/v2/appointments/get-termination-request.md), which returns the same fields. While it is `pending` you can withdraw it with [Cancel a Termination Request](https://docs.turrisfi.com/api-reference/v2/appointments/cancel-termination-request.md).

```json theme={null}
{
  "data": {
    "terminationRequestId": "6672b1c2d3e4f5a6b7c8d9e1",
    "agentId": "6650a1b2c3d4e5f6a7b8c9d0",
    "stateCode": "TX",
    "productId": "6600a1b2c3d4e5f6a7b8c9d0",
    "carrier": { "name": "Example Mutual Insurance", "companyCode": "12345" },
    "linesOfAuthority": [{ "code": "16", "name": "Property" }],
    "status": "pending",
    "processingMethod": "manual",
    "requestedAt": "2026-11-18T15:04:05.000Z",
    "terminationReasonCode": "1"
  },
  "requestId": "abcd1234",
  "timestamp": "2026-11-18T15:04:05.000Z"
}
```

## What Gets Terminated

The request covers the lines of authority the agent or agency holds with the carrier in the state that the product uses. Lines that another of your products with the same carrier still needs, for an agent or agency authorized for that product in the state, are kept.

The state stays authorized for the product. A termination does not change authorization; unauthorize the state in the Turris dashboard if that is also what you want.

NIPR appoints per NPN, carrier and state, not per product or per organization. A termination ends the appointment with that carrier for every organization that relies on it.

## Shared Lines of Authority

Two of your products with the same carrier can need the same lines in a state. Say both Commercial Auto and General Liability need Property and Casualty in Texas, and the agency is authorized for both there. A termination through either product is refused with `LINES_OF_AUTHORITY_PRESERVED`, because the other product still needs every line. The refusal names the products in `details.preservingProducts`.

To end the appointment anyway, unauthorize the state for one of those products in the Turris dashboard, then request the termination again through the other.

## Termination Reason Codes

| Code | Meaning |
| - | - |
| `1` | Voluntary Termination |
| `2` | Inadequate Production |
| `3` | Cancelled by General Agent |
| `4` | Death |
| `5` | Company Defunct or Liquidation |
| `6` | Company Indebtedness |
| `7` | Poor Policyholder Service |
| `8` | Agent Moved |
| `20` | Request Regulatory Review |

A state that requires a code refuses a request without one with `TERMINATION_REASON_CODE_REQUIRED`. A code the state does not accept is refused with `TERMINATION_REASON_CODE_NOT_ACCEPTED`. Both refusals list the codes the state accepts in `details.acceptedCodes`. Where a state has no list of its own, the code is optional and any code above is accepted.

## One Request per Call

A request for an agent does not also terminate the agency's appointment. If the carrier needs both, make a second call with the agency's `downstreamEntityAssociationId`.

## Calling It Again

Only one request can be open for the same NPN, state and carrier, so a termination is refused with `409` while another request for them is open. A request counts as open while it is `pending`, `submitting` or `submitted`.

* **`TERMINATION_REQUEST_EXISTS`**: a termination is already open, made for this agent or agency, for another of your agencies with the same NPN, under another of your products with the same carrier, or in the Turris dashboard. `details.existingTerminationRequestId` is its id and `details.status` its status.
* **`OPEN_CHANGE_REQUEST_EXISTS`**: another kind of request is open, such as an appointment request. `details.existingRequestId`, `details.category` and `details.status` say which. A `pending` appointment request can be withdrawn with [Cancel an Appointment Request](https://docs.turrisfi.com/api-reference/v2/appointments/cancel-appointment-request.md); once a request is `submitting` or `submitted`, Turris operations is filing it, so wait for it to finish. Other kinds of requests are cancelled in the Turris dashboard.

Send an `idempotency-key` header to make a network retry safe. A successful create is replayed with `201` and the same body for one hour. A refusal or a `503` is not stored, so a retry with the same key runs again. See [Idempotency](https://docs.turrisfi.com/guides/idempotency.md).

## Refusals

Every `409` and `422` carries `details.refusalCode`. Branch on the code; show `errorMessage` to a person.

| Status | `details.refusalCode` | When |
| - | - | - |
| `409` | `TERMINATION_REQUEST_EXISTS` | A termination for the same NPN, state and carrier is open. Carries `details.existingTerminationRequestId` and `details.status`. |
| `409` | `OPEN_CHANGE_REQUEST_EXISTS` | Another request for the same NPN, state and carrier is open. Carries `details.existingRequestId`, `details.category` and `details.status`. |
| `422` | `PRODUCT_NOT_IN_ORGANIZATION` | The product does not exist or is not one of your products. This is a `422`, not a `404`. |
| `422` | `PRODUCT_HAS_NO_CARRIER` | The product has no carrier. |
| `422` | `STATE_NOT_SOLD` | The product is not sold in the state. |
| `422` | `NO_ACTIVE_APPOINTMENT` | The agent or agency holds no active appointment with the carrier in the state on the lines the product uses. An agency Turris has no NIPR data subscription for gets this code too. |
| `422` | `LINES_OF_AUTHORITY_PRESERVED` | Every line the product would end is still needed by another of your products with the carrier. Carries `details.preservingProducts`. See [Shared Lines of Authority](#shared-lines-of-authority). |
| `422` | `NO_NIPR_DATA_SUBSCRIPTION` | Turris has no NIPR data subscription for the agent through this relationship, typically because it has no NPN. |
| `422` | `AGENT_NOT_ACTIVE_ON_AGENCY` | The agent is not on the agency the request would go through. |
| `422` | `TERMINATION_REASON_CODE_REQUIRED` | The state requires a reason code and none was sent. Carries `details.acceptedCodes`. |
| `422` | `TERMINATION_REASON_CODE_NOT_ACCEPTED` | The state does not accept the code sent. Carries `details.acceptedCodes`. |
| `400` | | Not exactly one of `agentId` and `downstreamEntityAssociationId`, an invalid `stateCode` or id, an empty `terminationReasonCode`, or an `idempotency-key` that is not a UUID. |
| `404` | | The association is not one of yours, or the agent is on none of your agencies. Archived associations and agents removed from your agencies count as yours. |
| `503` | | A concurrent change kept the request from settling, or the request was created but could not be read back. Retry after the number of seconds in the `Retry-After` header. If a request was made, the retry answers `409` `TERMINATION_REQUEST_EXISTS` with its id. |

When several refusals apply, which one you get follows the order Turris checks them in. That order is not part of the contract: branch on the code, not on the order.

A `409` over an open appointment request:

```json theme={null}
{
  "statusCode": 409,
  "requestId": "abcd1234",
  "errorType": "conflict",
  "errorMessage": [
    "Another request for this NPN, state and carrier is still open. Cancel it while it is pending, or wait until Turris operations completes it."
  ],
  "timestamp": "2026-11-18T15:04:05.000Z",
  "details": {
    "refusalCode": "OPEN_CHANGE_REQUEST_EXISTS",
    "existingRequestId": "6672b1c2d3e4f5a6b7c8d9e0",
    "category": "appointment",
    "status": "pending"
  }
}
```

A `422` for shared lines:

```json theme={null}
{
  "statusCode": 422,
  "requestId": "abcd1234",
  "errorType": "unprocessable_entity",
  "errorMessage": [
    "Every line of authority this product would end is still needed by another of your products with this carrier in this state."
  ],
  "timestamp": "2026-11-18T15:04:05.000Z",
  "details": {
    "refusalCode": "LINES_OF_AUTHORITY_PRESERVED",
    "preservingProducts": [{ "productId": "6600a1b2c3d4e5f6a7b8c9d1", "productName": "General Liability" }]
  }
}
```


## OpenAPI

````yaml openapi/v2.json POST /v2/upstream/termination-requests
openapi: 3.0.0
info:
  title: Turris Public API
  description: API for managing insurance compliance data
  version: 2.0.0
  contact: {}
servers:
  - url: https://public.api.live.turrisfi.com
    description: Production
  - url: https://public.api.sandbox.turrisfi.com
    description: Sandbox
security:
  - bearer: []
  - restricted-access-token: []
tags:
  - name: auth
    description: Shared. Serves either organization category, so no persona applies.
    x-organization-category: null
  - name: downstream/actions-required
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/appointments
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/carriers
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/compliance-configs
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/contacts
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/corporate-registrations
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/documents
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/entities
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/license-overview
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/license-requests
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/licenses
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/markets
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/producers
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/surplus-lines-filings
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: downstream/surplus-lines-states
    description: >-
      Agency surface. Requires a credential whose organization category is
      downstreamEntity.
    x-organization-category: downstreamEntity
  - name: heartbeat
    description: Shared. Serves either organization category, so no persona applies.
    x-organization-category: null
  - name: upstream/agents
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/agents-license-compliance
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/appointment-requests
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/carriers
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/compliance-data-subscriptions
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/contacts
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/contract-container-templates
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/diligent-effort-requests
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/downstream-entity-associations
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/file-documents
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/market-contacts
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/npn-lookup
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/policies
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/products
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/surplus-lines-filings
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/surplus-lines-states
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/termination-requests
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
  - name: upstream/webhooks
    description: >-
      Carrier and MGA surface. Requires a credential whose organization category
      is upstreamEntity.
    x-organization-category: upstreamEntity
paths:
  /v2/upstream/termination-requests:
    post:
      tags:
        - upstream/termination-requests
      summary: Request a termination
      description: >-
        Requests the termination of an agent or agency appointment with the
        carrier of a product, in one state, and answers with the request or the
        reason it was refused. Lines of authority another of your products with
        the same carrier still needs are kept. The state stays authorized. Every
        request starts as pending and is filed with the state by Turris. The
        appointment ends for every organization that relies on it with that
        carrier.
      operationId: TerminationRequestsV2Controller_createTerminationRequest_v2
      parameters:
        - name: idempotency-key
          in: header
          description: UUID to ensure idempotent request processing
          required: false
          schema:
            type: string
            example: 550e8400-e29b-41d4-a716-446655440000
        - name: x-idempotency-key
          in: header
          description: Alternative UUID header for idempotent request processing
          required: false
          schema:
            type: string
            example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTerminationRequestDto'
      responses:
        '201':
          description: The termination request
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TerminationRequestResponse'
                  requestId:
                    type: string
                    description: Unique request identifier
                    example: dev-2c5e7cf2-9acf-4c8c-ab2f-b81f39d775a8
                  timestamp:
                    type: string
                    description: Response timestamp
                    example: '2025-11-12T20:49:03.293Z'
                required:
                  - data
                  - requestId
                  - timestamp
        '400':
          description: >-
            Invalid body, or not exactly one of agentId and
            downstreamEntityAssociationId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Invalid or missing auth token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: >-
            Returned with `errorType` `invalid_organization_category` when your
            credential's organization category does not match the one this
            endpoint serves; `details` names the expected and actual category.
            This endpoint can return 403 for other reasons too, so branch on
            `errorType`; the Error Handling guide lists them.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: >-
            The association is not one of yours, or the agent is on none of your
            agencies. Archived associations and agents removed from your
            agencies count.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '409':
          description: >-
            TERMINATION_REQUEST_EXISTS: a termination for this NPN, state and
            carrier is already open; details.existingTerminationRequestId and
            details.status. OPEN_CHANGE_REQUEST_EXISTS: another request for this
            NPN, state and carrier is open; details.existingRequestId,
            details.category and details.status. A pending appointment request
            can be cancelled through this API; anything else waits for Turris
            operations or is cancelled in the Turris dashboard.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminationRequestConflictResponse'
        '422':
          description: >-
            The request is not eligible. details.refusalCode says which rule
            refused it. LINES_OF_AUTHORITY_PRESERVED carries
            details.preservingProducts; the two reason-code refusals carry
            details.acceptedCodes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminationRequestRefusalResponse'
        '429':
          description: >-
            Too many requests: this credential passed the API-wide limit of 1000
            requests per 10 seconds, counted across every endpoint. The request
            was not processed. Wait the number of seconds in the Retry-After
            header, then retry.
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying. Sent when a rate limit refused
                the request.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '503':
          description: >-
            A concurrent change kept the request from settling, or the request
            was created but could not be read back. Retry after Retry-After; if
            a request exists, the retry answers 409 with its id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
components:
  schemas:
    CreateTerminationRequestDto:
      type: object
      properties:
        agentId:
          type: string
          description: >-
            The producer whose appointment to terminate. Send this or
            downstreamEntityAssociationId, not both. An agent removed from your
            agencies is accepted.
          example: 6650a1b2c3d4e5f6a7b8c9d0
        downstreamEntityAssociationId:
          type: string
          description: >-
            The agency whose appointment to terminate, as one of your
            associations, archived ones included. Send this or agentId, not
            both.
          example: 6651a1b2c3d4e5f6a7b8c9d0
        stateCode:
          type: string
          description: The state or territory of the appointment
          enum:
            - AL
            - AK
            - AZ
            - AR
            - CA
            - CO
            - CT
            - DE
            - FL
            - GA
            - HI
            - ID
            - IL
            - IN
            - IA
            - KS
            - KY
            - LA
            - ME
            - MD
            - MA
            - MI
            - MN
            - MS
            - MO
            - MT
            - NE
            - NV
            - NH
            - NJ
            - NM
            - NY
            - NC
            - ND
            - OH
            - OK
            - OR
            - PA
            - RI
            - SC
            - SD
            - TN
            - TX
            - UT
            - VT
            - VA
            - WA
            - WV
            - WI
            - WY
            - GU
            - PR
            - VI
            - DC
          example: TX
        productId:
          type: string
          description: >-
            One of your products. The appointment with its carrier is
            terminated, on the lines of authority this product uses.
          example: 6600a1b2c3d4e5f6a7b8c9d0
        terminationReasonCode:
          type: string
          description: >-
            The NIPR termination reason code, as a string ("1" is Voluntary
            Termination). Required in states that require one; the Request a
            Termination page lists the codes each state accepts.
          example: '1'
      required:
        - stateCode
        - productId
    TerminationRequestResponse:
      type: object
      properties:
        agentId:
          type: string
          description: >-
            Set when the request is for a producer. At most one of agentId and
            downstreamEntityAssociationId is set.
          example: 6650a1b2c3d4e5f6a7b8c9d0
        downstreamEntityAssociationId:
          type: string
          description: >-
            Set when the request is for an agency. At most one of agentId and
            downstreamEntityAssociationId is set. If the agency is no longer
            associated with you, this is the most recent association you had
            with it; when no association with the agency is left at all, neither
            field is set.
          example: 6651a1b2c3d4e5f6a7b8c9d0
        stateCode:
          type: string
          description: State or territory of the request
          enum:
            - AL
            - AK
            - AZ
            - AR
            - CA
            - CO
            - CT
            - DE
            - FL
            - GA
            - HI
            - ID
            - IL
            - IN
            - IA
            - KS
            - KY
            - LA
            - ME
            - MD
            - MA
            - MI
            - MN
            - MS
            - MO
            - MT
            - NE
            - NV
            - NH
            - NJ
            - NM
            - NY
            - NC
            - ND
            - OH
            - OK
            - OR
            - PA
            - RI
            - SC
            - SD
            - TN
            - TX
            - UT
            - VT
            - VA
            - WA
            - WV
            - WI
            - WY
            - GU
            - PR
            - VI
            - DC
          example: TX
        productId:
          type: string
          description: The product the request was made under
          example: 6600a1b2c3d4e5f6a7b8c9d0
        carrier:
          description: The carrier, as it was when the request was made
          allOf:
            - $ref: '#/components/schemas/AppointmentChangeRequestCarrierResponse'
        linesOfAuthority:
          description: Lines of authority the request covers. Filled by Turris.
          type: array
          items:
            $ref: >-
              #/components/schemas/AppointmentChangeRequestLineOfAuthorityResponse
        status:
          type: string
          description: >-
            Where the request is. Today Turris operations move requests between
            statuses by hand; with filing automation they move on their own.
            Every value is listed so that change adds no new one.
          enum:
            - pending
            - submitting
            - submitted
            - completed
            - failed
            - submission failed
            - rejected
            - canceled
            - archived
          example: pending
        processingMethod:
          type: string
          description: >-
            Whether the request is filed by hand or automatically. Every request
            is filed by hand today.
          enum:
            - automated
            - manual
          example: manual
        requestedAt:
          type: string
          description: When the request was made (ISO 8601)
          example: '2026-11-10T15:04:05.000Z'
        submittedAt:
          type: string
          description: >-
            When the request was filed with the state (ISO 8601): the time of
            its most recent move to submitted. Kept when the request moves on,
            removed if it goes back to pending or submitting, and absent on a
            request that never reached submitted and on requests submitted
            before Turris started recording it.
          example: '2026-11-11T09:30:00.000Z'
        completedAt:
          type: string
          description: >-
            When the request completed (ISO 8601). Absent until then, and on
            some requests completed before Turris recorded the date, so use
            status as the completion signal.
          example: '2026-11-14T16:00:00.000Z'
        canceledAt:
          type: string
          description: >-
            When the request was canceled (ISO 8601). Set only on a canceled
            request, and absent on requests canceled before Turris started
            recording it, so use status as the signal that a request is
            canceled.
          example: '2026-11-16T10:00:00.000Z'
        canceledBy:
          description: >-
            Who canceled the request, as the kind of actor only. Set only on a
            canceled request, together with canceledAt.
          allOf:
            - $ref: '#/components/schemas/AppointmentChangeRequestCanceledByResponse'
        terminationRequestId:
          type: string
          description: Termination request ID
          example: 6672b1c2d3e4f5a6b7c8d9e1
        terminationReasonCode:
          type: string
          description: >-
            NIPR termination reason code, as sent when the request was made
            through this API ("1" is Voluntary Termination). Absent on requests
            made without one, including every request made in the Turris
            dashboard.
          example: '1'
      required:
        - stateCode
        - productId
        - carrier
        - linesOfAuthority
        - status
        - processingMethod
        - requestedAt
        - terminationRequestId
    ErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
        requestId:
          type: string
          description: Unique request identifier for debugging
        errorType:
          type: string
          description: >-
            Machine-readable error classification. Branch on this rather than on
            `errorMessage`, which is prose and may change. Authentication
            failures returned by our identity provider are forwarded verbatim,
            so a 401 can carry a code outside this list; treat an unrecognised
            value as a generic failure of its HTTP status.
          enum:
            - conflict
            - contact_not_authorized
            - contract_already_signed
            - document_exceeds_page_limit
            - downstream_entity_member_exists
            - duplicate_external_id_error
            - duplicate_member_email
            - duplicate_producer_code_error
            - forbidden
            - gateway_timeout
            - inactive_email
            - internal_server_error
            - invalid_email
            - invalid_email_for_invites
            - invalid_organization_category
            - invalid_organization_slug
            - invalid_phone_number
            - invalid_token
            - invite_limit_reached
            - jwt_invalid
            - m2m_client_not_found
            - not_found
            - online_signing_in_progress
            - organization_already_exists
            - organization_slug_already_used
            - payment_required
            - producer_agreement_required
            - product_feature_subscription_required
            - service_unavailable
            - session_authorization_error
            - some_custom_error_string
            - throttled
            - too_many_requests
            - unauthorized
            - unauthorized_client
            - unexpected_400_stytch_error
            - unexpected_403_stytch_error
            - unexpected_404_stytch_error
            - unexpected_error
            - unexpected_stytch_error
            - unprocessable_entity
            - validation_error
          example: validation_error
        errorMessage:
          description: Array of error messages
          type: array
          items:
            type: string
        timestamp:
          type: string
          description: ISO timestamp when the error occurred
        details:
          type: object
          description: Additional error context
      required:
        - statusCode
        - requestId
        - errorType
        - errorMessage
        - timestamp
    TerminationRequestConflictResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
        requestId:
          type: string
          description: Unique request identifier for debugging
        errorType:
          type: string
          description: >-
            Machine-readable error classification. Branch on this rather than on
            `errorMessage`, which is prose and may change. Authentication
            failures returned by our identity provider are forwarded verbatim,
            so a 401 can carry a code outside this list; treat an unrecognised
            value as a generic failure of its HTTP status.
          enum:
            - conflict
            - contact_not_authorized
            - contract_already_signed
            - document_exceeds_page_limit
            - downstream_entity_member_exists
            - duplicate_external_id_error
            - duplicate_member_email
            - duplicate_producer_code_error
            - forbidden
            - gateway_timeout
            - inactive_email
            - internal_server_error
            - invalid_email
            - invalid_email_for_invites
            - invalid_organization_category
            - invalid_organization_slug
            - invalid_phone_number
            - invalid_token
            - invite_limit_reached
            - jwt_invalid
            - m2m_client_not_found
            - not_found
            - online_signing_in_progress
            - organization_already_exists
            - organization_slug_already_used
            - payment_required
            - producer_agreement_required
            - product_feature_subscription_required
            - service_unavailable
            - session_authorization_error
            - some_custom_error_string
            - throttled
            - too_many_requests
            - unauthorized
            - unauthorized_client
            - unexpected_400_stytch_error
            - unexpected_403_stytch_error
            - unexpected_404_stytch_error
            - unexpected_error
            - unexpected_stytch_error
            - unprocessable_entity
            - validation_error
          example: validation_error
        errorMessage:
          description: Array of error messages
          type: array
          items:
            type: string
        timestamp:
          type: string
          description: ISO timestamp when the error occurred
        details:
          description: Which rule refused the request, and the open request that blocks it.
          allOf:
            - $ref: '#/components/schemas/TerminationRequestConflictDetailsResponse'
      required:
        - statusCode
        - requestId
        - errorType
        - errorMessage
        - timestamp
        - details
    TerminationRequestRefusalResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
        requestId:
          type: string
          description: Unique request identifier for debugging
        errorType:
          type: string
          description: >-
            Machine-readable error classification. Branch on this rather than on
            `errorMessage`, which is prose and may change. Authentication
            failures returned by our identity provider are forwarded verbatim,
            so a 401 can carry a code outside this list; treat an unrecognised
            value as a generic failure of its HTTP status.
          enum:
            - conflict
            - contact_not_authorized
            - contract_already_signed
            - document_exceeds_page_limit
            - downstream_entity_member_exists
            - duplicate_external_id_error
            - duplicate_member_email
            - duplicate_producer_code_error
            - forbidden
            - gateway_timeout
            - inactive_email
            - internal_server_error
            - invalid_email
            - invalid_email_for_invites
            - invalid_organization_category
            - invalid_organization_slug
            - invalid_phone_number
            - invalid_token
            - invite_limit_reached
            - jwt_invalid
            - m2m_client_not_found
            - not_found
            - online_signing_in_progress
            - organization_already_exists
            - organization_slug_already_used
            - payment_required
            - producer_agreement_required
            - product_feature_subscription_required
            - service_unavailable
            - session_authorization_error
            - some_custom_error_string
            - throttled
            - too_many_requests
            - unauthorized
            - unauthorized_client
            - unexpected_400_stytch_error
            - unexpected_403_stytch_error
            - unexpected_404_stytch_error
            - unexpected_error
            - unexpected_stytch_error
            - unprocessable_entity
            - validation_error
          example: validation_error
        errorMessage:
          description: Array of error messages
          type: array
          items:
            type: string
        timestamp:
          type: string
          description: ISO timestamp when the error occurred
        details:
          description: >-
            Which rule refused the request, with the products that keep the
            lines or the state's accepted reason codes when they apply.
          allOf:
            - $ref: '#/components/schemas/TerminationRequestRefusalDetailsResponse'
      required:
        - statusCode
        - requestId
        - errorType
        - errorMessage
        - timestamp
        - details
    AppointmentChangeRequestCarrierResponse:
      type: object
      properties:
        name:
          type: string
          description: Carrier name, as it was when the request was made
          example: Example Mutual Insurance
        companyCode:
          type: string
          description: NAIC company code. Absent on older requests that never stored one.
          example: '12345'
      required:
        - name
    AppointmentChangeRequestLineOfAuthorityResponse:
      type: object
      properties:
        code:
          type: string
          description: Line-of-authority code
          example: '16'
        name:
          type: string
          description: Line-of-authority name
          example: Property
      required:
        - code
        - name
    AppointmentChangeRequestCanceledByResponse:
      type: object
      properties:
        type:
          type: string
          description: >-
            Who canceled the request: api_client for a call to the cancel
            endpoint with your API credentials, member for a person signed in to
            the Turris dashboard, admin for Turris operations, and system for
            Turris acting on its own with no person or API call behind it.
            Member ids and emails are not exposed.
          enum:
            - member
            - api_client
            - admin
            - agent
            - system
          example: api_client
      required:
        - type
    TerminationRequestConflictDetailsResponse:
      type: object
      properties:
        refusalCode:
          type: string
          description: >-
            Why the request was refused. Branch on this; show errorMessage to a
            person.
          enum:
            - TERMINATION_REQUEST_EXISTS
            - OPEN_CHANGE_REQUEST_EXISTS
            - PRODUCT_NOT_IN_ORGANIZATION
            - PRODUCT_HAS_NO_CARRIER
            - STATE_NOT_SOLD
            - NO_ACTIVE_APPOINTMENT
            - LINES_OF_AUTHORITY_PRESERVED
            - NO_NIPR_DATA_SUBSCRIPTION
            - AGENT_NOT_ACTIVE_ON_AGENCY
            - TERMINATION_REASON_CODE_REQUIRED
            - TERMINATION_REASON_CODE_NOT_ACCEPTED
          example: NO_ACTIVE_APPOINTMENT
        existingTerminationRequestId:
          type: string
          description: >-
            Set with TERMINATION_REQUEST_EXISTS: the open termination request
            for this NPN, state and carrier. It can have been made for another
            of your agencies with the same NPN, under another of your products
            with the same carrier, or in the Turris dashboard.
          example: 6672b1c2d3e4f5a6b7c8d9e1
        existingRequestId:
          type: string
          description: >-
            Set with OPEN_CHANGE_REQUEST_EXISTS: the open request that blocks
            the termination. Only an appointment request can be cancelled
            through this API; a renewal or line-of-authority change is cancelled
            in the Turris dashboard.
          example: 6672b1c2d3e4f5a6b7c8d9e0
        category:
          type: string
          description: >-
            Set with OPEN_CHANGE_REQUEST_EXISTS: what kind of request blocks the
            termination.
          enum:
            - appointment
            - termination
            - renewal
            - loa change
          example: appointment
        status:
          type: string
          description: >-
            Set with both codes: the status of the blocking request. A pending
            request can be cancelled; submitting and submitted are with Turris
            operations, so wait for them to finish.
          enum:
            - pending
            - submitting
            - submitted
            - completed
            - failed
            - submission failed
            - rejected
            - canceled
            - archived
          example: pending
      required:
        - refusalCode
    TerminationRequestRefusalDetailsResponse:
      type: object
      properties:
        refusalCode:
          type: string
          description: >-
            Why the request was refused. Branch on this; show errorMessage to a
            person.
          enum:
            - TERMINATION_REQUEST_EXISTS
            - OPEN_CHANGE_REQUEST_EXISTS
            - PRODUCT_NOT_IN_ORGANIZATION
            - PRODUCT_HAS_NO_CARRIER
            - STATE_NOT_SOLD
            - NO_ACTIVE_APPOINTMENT
            - LINES_OF_AUTHORITY_PRESERVED
            - NO_NIPR_DATA_SUBSCRIPTION
            - AGENT_NOT_ACTIVE_ON_AGENCY
            - TERMINATION_REASON_CODE_REQUIRED
            - TERMINATION_REASON_CODE_NOT_ACCEPTED
          example: NO_ACTIVE_APPOINTMENT
        preservingProducts:
          description: >-
            Set with LINES_OF_AUTHORITY_PRESERVED: your other products with this
            carrier that the agent or agency is authorized for in this state and
            that need these lines. To end the appointment anyway, unauthorize
            the state for those products in the Turris dashboard, then request
            the termination again.
          type: array
          items:
            $ref: '#/components/schemas/TerminationRequestPreservingProductResponse'
        acceptedCodes:
          description: >-
            Set with TERMINATION_REASON_CODE_REQUIRED and
            TERMINATION_REASON_CODE_NOT_ACCEPTED: the reason codes this state
            accepts.
          example:
            - '1'
            - '4'
            - '20'
          type: array
          items:
            type: string
      required:
        - refusalCode
    TerminationRequestPreservingProductResponse:
      type: object
      properties:
        productId:
          type: string
          description: One of your products with the same carrier
          example: 6600a1b2c3d4e5f6a7b8c9d1
        productName:
          type: string
          description: The product's name
          example: General Liability
      required:
        - productId
        - productName
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
    restricted-access-token:
      type: apiKey
      in: header
      name: x-restricted-access-token
      description: >-
        Alternative authentication: Restricted access token (if not using Bearer
        token)

````

## Related topics

- [List Termination Requests](https://docs.turrisfi.com/api-reference/v2/appointments/list-termination-requests.md)
- [Changelog](https://docs.turrisfi.com/changelog.md)
- [Cancel a Termination Request](https://docs.turrisfi.com/api-reference/v2/appointments/cancel-termination-request.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.