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

# Cancel a contract

> Cancel a contract. Required permission: crm:contract:cancel



## OpenAPI

````yaml /api/core-api/crmiapi.json post /api/v1/crm/contracts/{id}/cancel
openapi: 3.1.1
info:
  title: chargecloud - Core API
  summary: chargecloud Core API. All around CRM, Asset Management and more.
  version: 1.113.1
  description: chargecloud Core API. All around CRM, Asset Management and more.
servers:
  - url: https://api.chargecloud.dev
    description: Production - chargecloud Core API
  - url: https://demo.chargecloud.de
    description: Sandbox/Dev - chargecloud Core API
security: []
paths:
  /api/v1/crm/contracts/{id}/cancel:
    post:
      tags:
        - Contracts
      summary: Cancel a contract
      description: 'Cancel a contract. Required permission: crm:contract:cancel'
      operationId: /api/v1/crm/contracts/{id}/cancel_POST
      parameters:
        - name: id
          in: path
          description: Contract ID
          required: true
          schema:
            type: integer
            format: int32
            description: Contract ID
      requestBody:
        description: 'Cancel a contract. Required permission: crm:contract:cancel'
        content:
          application/json:
            schema:
              type: object
              required:
                - filing_cancel_date
                - cancel_type
                - cancellation_tech_key
              properties:
                filing_cancel_date:
                  type: string
                  format: date
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: Filing date of the cancellation (YYYY-MM-DD)
                  example: '2026-03-15'
                cancel_type:
                  type: string
                  enum:
                    - deadlineDate
                    - extraOrdinaryDate
                    - cancelDate
                    - moveAtDate
                  description: Cancellation type
                  example: deadlineDate
                cancellation_tech_key:
                  type: string
                  description: Technical key for cancellation reason
                extra_ordinary_date:
                  type: string
                  format: date
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: >-
                    Extraordinary cancellation date (YYYY-MM-DD). Required when
                    cancel_type = extraOrdinaryDate
                cancel_date:
                  type: string
                  format: date
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: >-
                    Cancellation date (YYYY-MM-DD). Required when cancel_type =
                    cancelDate
                move_at_date:
                  type: string
                  format: date
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: >-
                    Move-out date (YYYY-MM-DD). Required when cancel_type =
                    moveAtDate
        required: true
      responses:
        '200':
          description: Cancelled contract
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - cancelled_at_date
                properties:
                  message:
                    type: string
                    description: Cancellation result message
                  cancelled_at_date:
                    type: string
                    format: date
                    pattern: ^\d{4}-\d{2}-\d{2}$
                    description: Contract end date after cancellation (YYYY-MM-DD)
        '401':
          description: Unauthorized
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '403':
          description: Forbidden
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '404':
          description: Not found
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '405':
          description: Method not allowed
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
        '422':
          description: Request validation failed
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        errorKey:
                          type: string
                          description: A key identifying the error
                        message:
                          type: string
                          description: The error message
                        parameter:
                          type: string
                          description: The parameter that caused the error, if any
                      required:
                        - errorKey
                        - message
                        - parameter
                      description: Error
                    description: List of errors
        '429':
          description: Too many requests
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Error message
      security:
        - bearer:
            - crm:contract
components:
  headers:
    Content-Language:
      description: The locale of the response content (BCP 47 language tag).
      schema:
        type: string
        example: en
  securitySchemes:
    bearer:
      type: http
      description: OAuth2 Bearer Authorization
      scheme: bearer
      bearerFormat: JWT

````

## Related topics

- [Contract management](/contract-management.md)
- [Retrieves contracts](/api-reference/contracts/retrieves-contracts.md)
- [Creates a contract](/api-reference/contracts/creates-a-contract.md)
