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

# Update an existing contract



## OpenAPI

````yaml /api-reference/crm.yaml patch /v2/contracts/{id}
openapi: 3.0.0
info:
  title: Tarefy API
  description: >-
    Tarefy REST API — task management, culture and performance platform.


    Endpoints are versioned at `/v2/...`. Authentication via Bearer JWT in the
    `Authorization` header.


    To get started, see the [authentication guide](/authentication) and the
    [quickstart](/quickstart).
  version: 2.0.0
  contact:
    name: Tarefy Support
    email: suporte@tarefy.com
    url: https://tarefy.com
  license:
    name: Proprietary
    url: https://tarefy.com
servers:
  - url: https://app.tarefy.com/nodeapi
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Clients
    description: CRUD for customers (business entity)
  - name: Client Contacts
    description: Individual contacts by customer
  - name: Contracts
    description: Contracts with customers
  - name: Services
    description: Services offered to customers
paths:
  /v2/contracts/{id}:
    patch:
      tags:
        - Contracts
      summary: Update an existing contract
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  type: integer
                nome:
                  type: string
                descricao:
                  type: string
                status:
                  type: string
                  enum:
                    - ativo
                    - pausado
                    - concluido
                    - cancelado
                    - rascunho
                status_change_reason:
                  type: string
                  description: >-
                    Justificativa registrada no log ao alterar o status do
                    contrato. Obrigatória ao concluir ou reabrir contrato.
                tipo_venda:
                  type: string
                  enum:
                    - avulsa
                    - recorrente
                tipo_cobranca:
                  type: string
                  enum:
                    - horas
                    - valor_fixo
                responsavel_id:
                  type: integer
                data_inicio:
                  type: string
                data_fim:
                  type: string
                data_venda:
                  type: string
                numero_contrato:
                  type: string
                valor_total:
                  type: number
                servicos:
                  type: array
                  items:
                    type: object
                    properties:
                      servico_id:
                        type: integer
                      quantidade:
                        type: number
                      valor_unitario:
                        type: number
                      detalhes:
                        type: string
      responses:
        '200':
          description: Contrato atualizado com sucesso
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````