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

# Rotate a key: revoke the old, mint a new one (shown once)



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/admin/partners/{partner_id}/keys/{key_id}/rotate
openapi: 3.1.0
info:
  title: crewpass-api-v2
  description: >-
    CrewPass V2 Partner API — a scope-gated, consent-intersected, multi-tenant
    front door onto existing CrewPass crew/vessel/compliance data.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v2/admin/partners/{partner_id}/keys/{key_id}/rotate:
    post:
      tags:
        - admin
      summary: 'Rotate a key: revoke the old, mint a new one (shown once)'
      operationId: rotate_key_api_v2_admin_partners__partner_id__keys__key_id__rotate_post
      parameters:
        - name: partner_id
          in: path
          required: true
          schema:
            type: string
            title: Partner Id
        - name: key_id
          in: path
          required: true
          schema:
            type: string
            title: Key Id
        - name: X-Internal-Auth
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Internal-Auth
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyMintResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    KeyMintResponse:
      properties:
        key_id:
          type: string
          title: Key Id
        partner_id:
          type: string
          title: Partner Id
        mode:
          type: string
          enum:
            - live
            - test
          title: Mode
        api_key:
          type: string
          title: Api Key
        signing_secret:
          type: string
          title: Signing Secret
        key_prefix:
          type: string
          title: Key Prefix
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - key_id
        - partner_id
        - mode
        - api_key
        - signing_secret
        - key_prefix
        - created_at
      title: KeyMintResponse
      description: >-
        Returned ONCE at mint/rotate — the key + signing secret are never
        re-readable.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````