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

# Expire contract

> Expire a contract by its ID. The contract will be marked as expired and adjusted to the specified expiry date (or today if not provided). The expiry time is automatically set to end of day (23:59:59.999999).



## OpenAPI

````yaml /openAPI/openapi-20240301.json patch /contract_v2/{contract_id}/expire
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /contract_v2/{contract_id}/expire:
    patch:
      tags:
        - Contracts
      summary: Expire contract
      description: >-
        Expire a contract by its ID. The contract will be marked as expired and
        adjusted to the specified expiry date (or today if not provided). The
        expiry time is automatically set to end of day (23:59:59.999999).
      operationId: Expire-contract
      parameters:
        - name: contract_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Contract Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/ExpireContractRequestSchema'
                - type: 'null'
              title: Expire Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExpireContractRequestSchema:
      properties:
        expiry_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Expiry Date
          description: >-
            Date to expire the contract (date only, not datetime). Defaults to
            today if not provided. Contract will be expired at end of day
            (23:59:59.999999).
          examples:
            - '2025-12-31'
      type: object
      title: ExpireContractRequestSchema
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````