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

# Reconcile seats against the partner's authoritative active list

> Cancel seats the partner no longer lists (guarded, dry-run by default).

Partner-scoped: only this partner's live seats are considered. Safety rails:
an empty ``active_refs`` is a 400; a mass-cancel over the threshold is refused
unless ``override_threshold`` is set; nothing is cancelled unless ``apply`` is
true. See :func:`dss_api.sponsorship.roster.reconcile_roster`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/partners/sponsorships/reconcile
openapi: 3.1.0
info:
  title: DSS Public API
  description: >-
    Public OAuth 2.0 API for Digital Sea Service. See
    https://docs.digitalseaservice.com for the developer guide.
  version: 1.0.0
  contact:
    name: DSS Developer Support
    email: admin@digitalseaservice.com
    url: https://docs.digitalseaservice.com
  license:
    name: Proprietary
  termsOfService: https://digitalseaservice.com/terms
servers:
  - url: https://api.digitalseaservice.com
    description: Production
  - url: https://api.dev.digitalseaservice.com
    description: Sandbox (dev)
security: []
paths:
  /v1/partners/sponsorships/reconcile:
    post:
      tags:
        - partners
      summary: Reconcile seats against the partner's authoritative active list
      description: >-
        Cancel seats the partner no longer lists (guarded, dry-run by default).


        Partner-scoped: only this partner's live seats are considered. Safety
        rails:

        an empty ``active_refs`` is a 400; a mass-cancel over the threshold is
        refused

        unless ``override_threshold`` is set; nothing is cancelled unless
        ``apply`` is

        true. See :func:`dss_api.sponsorship.roster.reconcile_roster`.
      operationId: reconcile_sponsorships_v1_partners_sponsorships_reconcile_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReconcileRequest'
      responses:
        '200':
          description: The reconcile diff (dry run, or the result of an applied cancel).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReconcileResponse'
        '400':
          description: active_refs was empty — rejected to prevent a cancel-all.
        '401':
          description: >-
            `invalid_token` — bearer token missing, malformed, expired, or
            revoked.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: '`insufficient_scope` — the token lacks the required scope.'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: >-
            `invalid_request` — request validation failed; see the `errors`
            array.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '429':
          description: '`rate_limit_exceeded` — per-client request budget exhausted.'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: >-
            `internal_error` — an unexpected error occurred; reference
            `instance`.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oauth2:
            - profile:read
        - bearerAuth: []
components:
  schemas:
    ReconcileRequest:
      properties:
        active_refs:
          items:
            type: string
          type: array
          title: Active Refs
          description: >-
            Partner's authoritative list of active member emails / external
            refs.
        apply:
          type: boolean
          title: Apply
          description: False = dry run (default). True = actually cancel the diff.
          default: false
        max_cancel:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Max Cancel
          description: >-
            Hard ceiling on cancellations; exceeding it trips the threshold
            guard.
        override_threshold:
          type: boolean
          title: Override Threshold
          description: Apply even when the mass-cancel threshold guard trips.
          default: false
      type: object
      required:
        - active_refs
      title: ReconcileRequest
      description: >-
        Reconcile DSS seats against the partner's authoritative active-member
        list.


        ``active_refs`` is the partner's own list of currently-active member

        identifiers (each matched against a seat's ``email`` AND
        ``external_ref``).

        An **empty** list is rejected (400) so a bad/empty export can never be
        read

        as "cancel everyone". By default this is a DRY RUN (``apply=false``):
        the diff

        is returned and nothing is cancelled. A mass-cancel that exceeds
        ``max_cancel``

        (or the default safety fraction) is refused unless
        ``override_threshold`` is

        true.
      example:
        active_refs:
          - jane@example.com
          - ywc-beta-0042
        apply: false
        max_cancel: 25
        override_threshold: false
    ReconcileResponse:
      properties:
        active_seats:
          type: integer
          title: Active Seats
        to_cancel:
          items:
            $ref: '#/components/schemas/ReconcileToCancelItem'
          type: array
          title: To Cancel
        missing_refs:
          items:
            type: string
          type: array
          title: Missing Refs
        applied:
          type: boolean
          title: Applied
        cancelled_count:
          type: integer
          title: Cancelled Count
        threshold_exceeded:
          type: boolean
          title: Threshold Exceeded
      type: object
      required:
        - active_seats
        - to_cancel
        - missing_refs
        - applied
        - cancelled_count
        - threshold_exceeded
      title: ReconcileResponse
      description: The reconcile diff plus what (if anything) was applied.
      example:
        active_seats: 42
        applied: false
        cancelled_count: 0
        missing_refs:
          - newjoiner@example.com
        threshold_exceeded: false
        to_cancel:
          - email: gone@example.com
            sponsorship_id: 665f00000000000000000042
    ProblemDetails:
      type: object
      description: >-
        RFC 7807 Problem Details. Returned with the `application/problem+json`
        content type on every resource (`/v1/*`) error.
      properties:
        type:
          type: string
          format: uri
          description: Stable URL identifying the error type; resolves to its docs page.
        title:
          type: string
          description: Short, human-readable summary of the error type.
        status:
          type: integer
          description: HTTP status code.
        detail:
          type: string
          description: Explanation specific to this occurrence.
        instance:
          type: string
          description: Request correlation id; matches the `X-Request-Id` header.
      required:
        - type
        - title
        - status
        - detail
        - instance
    ValidationProblemDetails:
      description: Problem Details for a 422, carrying a per-field `errors` array.
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          properties:
            errors:
              type: array
              description: One entry per field that failed validation.
              items:
                type: object
                additionalProperties: true
    ReconcileToCancelItem:
      properties:
        sponsorship_id:
          type: string
          title: Sponsorship Id
        email:
          type: string
          title: Email
      type: object
      required:
        - sponsorship_id
        - email
      title: ReconcileToCancelItem
      description: One seat the partner no longer lists (a cancel candidate).
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.0 Authorization Code flow with PKCE. See the integration guide
        at docs.digitalseaservice.com for the full step-by-step.
      flows:
        authorizationCode:
          authorizationUrl: https://api.digitalseaservice.com/oauth/authorize
          tokenUrl: https://api.digitalseaservice.com/oauth/token
          refreshUrl: https://api.digitalseaservice.com/oauth/token
          scopes:
            profile:read: Read the crew member's name, role, country, and photo URL.
            seatime:read: Read aggregate sea-time totals and the 12-month trend.
            vessels:read: Read the crew member's vessel history.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque

````