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

# Updates a contract

> Updates a contract. Required permission: crm:contract:update



## OpenAPI

````yaml /api/core-api/crmiapi.json put /api/v1/crm/contracts/{uuid}
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/{uuid}:
    put:
      tags:
        - Contracts
      summary: Updates a contract
      description: 'Updates a contract. Required permission: crm:contract:update'
      operationId: /api/v1/crm/contracts/{uuid}_PUT
      parameters:
        - name: uuid
          in: path
          description: Contract UUID
          required: true
          schema:
            type: string
            maxLength: 36
            description: Contract UUID
      requestBody:
        description: 'Updates a contract. Required permission: crm:contract:update'
        content:
          application/json:
            schema:
              type: object
              properties:
                ext_contract_id:
                  type: string
                  maxLength: 50
                  description: External contract id
                external_id:
                  type: string
                  maxLength: 15
                  description: External customer id
                customer_group_id:
                  type: integer
                  format: int32
                  description: Customer group id
                account_id:
                  type: integer
                  format: int32
                  description: Account id
                campaign_id:
                  type: integer
                  format: int32
                  description: Campaign id
                energy:
                  type: string
                  enum:
                    - electricity
                    - gas
                  description: Energy type
                business:
                  type: boolean
                  default: false
                  description: Is business customer
                company_name:
                  type: string
                  maxLength: 255
                  description: Company name
                salutation:
                  type: integer
                  format: int32
                  description: Salutation
                firstname:
                  type: string
                  maxLength: 70
                  description: Firstname
                surname:
                  type: string
                  maxLength: 70
                  description: Surname
                street:
                  type: string
                  maxLength: 255
                  description: Street
                house_number:
                  type: string
                  maxLength: 16
                  description: House number
                zip:
                  type: string
                  maxLength: 16
                  description: ZIP
                city:
                  type: string
                  maxLength: 128
                  description: City
                country_id:
                  type: integer
                  format: int32
                  description: Country id
                phone:
                  type: string
                  maxLength: 255
                  description: Phone
                fax:
                  type: string
                  maxLength: 255
                  description: Fax
                email:
                  type: string
                  maxLength: 255
                  description: Email
                reference_field_1:
                  type: string
                  maxLength: 255
                  description: Reference field 1
                reference_field_2:
                  type: string
                  maxLength: 255
                  description: Reference field 2
                billing_company:
                  type: string
                  maxLength: 255
                  description: Billing company
                billing_salutation:
                  type: integer
                  format: int32
                  description: Billing salutation
                billing_title:
                  type: string
                  maxLength: 70
                  description: Billing title
                billing_firstname:
                  type: string
                  maxLength: 70
                  description: Billing firstname
                billing_surname:
                  type: string
                  maxLength: 70
                  description: Billing surname
                billing_street:
                  type: string
                  maxLength: 255
                  description: Billing street
                billing_house_number:
                  type: string
                  maxLength: 16
                  description: Billing house number
                billing_zip:
                  type: string
                  maxLength: 16
                  description: Billing ZIP
                billing_city:
                  type: string
                  maxLength: 128
                  description: Billing city
                billing_country_id:
                  type: integer
                  format: int32
                  description: Billing country id
                billing_email:
                  type: string
                  maxLength: 128
                  description: Billing email
                billing_phone:
                  type: string
                  maxLength: 128
                  description: Billing phone
                billing_fax:
                  type: string
                  maxLength: 128
                  description: Billing fax
                disabled:
                  type: boolean
                  default: false
                  description: Disabled
                auth_enabled:
                  type: boolean
                  default: false
                  description: App login enabled
                auth_username:
                  type: string
                  maxLength: 255
                  description: App login username
                is_employer:
                  type: boolean
                  default: false
                  description: Is employer contract
                payment_method_id:
                  type: integer
                  format: int32
                  description: Payment method ID
                attributes:
                  type: string
                  description: >-
                    JSON-encoded key-value pairs of attribute identifiers and
                    values
        required: true
      responses:
        '200':
          description: Edited contract
          headers:
            Content-Language:
              $ref: '#/components/headers/Content-Language'
          content:
            application/json:
              schema:
                type: object
                required:
                  - contract
                properties:
                  contract:
                    type: object
                    properties:
                      id:
                        type: integer
                        format: int32
                        description: Contract ID
                      uuid:
                        type: string
                        maxLength: 36
                        description: Contract UUID
                      type:
                        type: string
                        enum:
                          - energy
                          - energy_external
                          - energy_external_lima
                          - emobility
                          - emobility_adhoc
                          - non_commodity
                        description: Contract type
                      energy:
                        type: string
                        enum:
                          - electricity
                          - gas
                        description: Energy type
                      customer_number:
                        type: string
                        maxLength: 50
                        description: Customer number
                      business:
                        type: boolean
                        default: false
                        description: Is business customer
                      company_name:
                        type: string
                        maxLength: 255
                        description: Company name
                      firstname:
                        type: string
                        maxLength: 70
                        description: Firstname
                      surname:
                        type: string
                        maxLength: 70
                        description: Surname
                      created_at:
                        type: string
                        format: date-time
                        pattern: >-
                          ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$
                        description: Contract creation date
                      start_date:
                        type: string
                        format: date
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        description: Start date
                      end_date:
                        type: string
                        format: date
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        description: End date
                      cancelled_at:
                        type: string
                        format: date-time
                        pattern: >-
                          ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$
                        description: Cancelled at
                      status:
                        type: string
                        enum:
                          - open
                          - cancellation_previous
                          - delivery_net
                          - waiting
                          - active
                          - blocked
                          - terminated
                          - expired
                          - done
                          - cancelled
                        description: Contract status
                      is_locked:
                        type: boolean
                        default: false
                        description: Locked for editing
                      blocked:
                        type: boolean
                        default: false
                        description: Blocked
                      disabled:
                        type: boolean
                        default: false
                        description: Disabled
                      usage:
                        type: integer
                        format: int32
                        description: Usage
                      zip:
                        type: string
                        maxLength: 16
                        description: ZIP
                      city:
                        type: string
                        maxLength: 128
                        description: City
                    required:
                      - id
                      - uuid
                      - type
                      - energy
                      - business
                      - firstname
                      - surname
                      - is_locked
                      - blocked
                      - disabled
                      - usage
                      - zip
                      - city
                    description: Contract
        '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
        '500':
          description: Internal server error
          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)
- [Updates a location](/api-reference/locations/updates-a-location.md)
- [Retrieves contracts](/api-reference/contracts/retrieves-contracts.md)
