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

# Revoke an existing contract

> Revocation of a contract is only possible if the contract has reg_status "in_revocation_period" in “open_join” within 14 days after registration, or in “closed_join” 8 days before delivery start. Otherwise, a 400 is returned.



## OpenAPI

````yaml /lumx_openapi.yaml post /v3/consumers/{userID}/contracts/{contractID}/revoke/
openapi: 3.0.3
info:
  title: Lumenaza external API
  version: 3.8.0 (v3)
  description: Specification of the Lumenaza external API.
servers:
  - url: https://api.lumenaza.de/
    description: Produktivserver
  - url: https://api.test.lumenaza.de/
    description: Testserver
security: []
tags:
  - name: Community Data API
    description: >-
      The API is used to retrieve master data and measurement data for a
      community. A community is defined by all customers that belong to your
      company.
paths:
  /v3/consumers/{userID}/contracts/{contractID}/revoke/:
    post:
      tags:
        - consumers
      summary: Revoke an existing contract
      description: >-
        Revocation of a contract is only possible if the contract has reg_status
        "in_revocation_period" in “open_join” within 14 days after registration,
        or in “closed_join” 8 days before delivery start. Otherwise, a 400 is
        returned.
      operationId: revoke_contract
      parameters:
        - in: path
          name: contractID
          schema:
            type: string
            pattern: ^[\w-]+$
          required: true
        - in: path
          name: userID
          schema:
            type: string
            pattern: ^[\w-]+$
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailResponse'
              examples:
                SuccessfulRevocation:
                  value:
                    detail: contract successfully revoked
                  summary: Example of a successful revocation response
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailResponse'
              examples:
                RevocationDeadlinePassed:
                  value:
                    detail: revocation deadline passed
                  summary: Example of a revocation deadline passed response
                UnexpectedRegistrationState:
                  value:
                    detail: unexpected registration state
                  summary: Example of an unexpected registration state response
          description: >-
            The runtime revocation policy rejected the requested state
            transition.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
              examples:
                ContractIDNotFound:
                  value:
                    detail: Contract ID not found in database
                  summary: Example of a contract ID not found response
          description: The requested consumer contract could not be found.
components:
  schemas:
    DetailResponse:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    NotFoundResponse:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail

````

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