> ## Documentation Index
> Fetch the complete documentation index at: https://api-documentation.kare-app.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a contract



## OpenAPI

````yaml /api/rs/openapi.json get /rs/contracts/v1/{id}
openapi: 3.0.3
info:
  title: KARE API
  description: Backend API for the KARE platform
  version: dev
servers:
  - url: http://localhost:3000
    description: Local dev
security: []
tags:
  - name: better-auth
    description: >-
      Better Auth's own endpoints (sign-in, session, MFA, password) - generated
      from the audience's live config via `generateOpenAPISchema()`, not
      hand-written.
paths:
  /rs/contracts/v1/{id}:
    get:
      tags:
        - contracts
      summary: Get a contract
      operationId: getContractRSV1
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - active-document
                - counts
                - actions-info
              description: >-
                Extend options (JSON-encoded array, e.g.
                `?extend=["category"]`):

                - "active-document": Adds `activeDocument` (the current
                contractual period, or null).

                - "counts": Adds `routineCount`/`complianceCount` (read-only -
                linkage is written from routine/rule).

                - "actions-info": Projects `{ canBeUpdated, canBeArchived,
                canBeUnarchived, canBeDeleted, canBeTerminated, canBeClosed,
                canBeRenewed }`.
          in: query
          name: extend
          required: false
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  ref:
                    type: string
                    maxLength: 40
                    pattern: ^[A-Z]+-[1-9]\d*(?:-[A-Z]+-[1-9]\d*)*$
                  name:
                    type: string
                    minLength: 1
                    maxLength: 150
                  description:
                    nullable: true
                    type: string
                    maxLength: 2000
                  type:
                    type: string
                    enum:
                      - preventive
                      - training
                  status:
                    type: string
                    enum:
                      - pending
                      - active
                      - expired
                      - terminated
                      - closed
                  providerId:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  archivedAt:
                    nullable: true
                    type: string
                    format: date-time
                  deletedAt:
                    nullable: true
                    type: string
                    format: date-time
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                  activeDocument:
                    nullable: true
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      externalReference:
                        type: string
                        minLength: 1
                        maxLength: 100
                      amount:
                        nullable: true
                        type: number
                        minimum: 0
                        exclusiveMinimum: true
                        maximum: 999999999.99
                      startAt:
                        type: string
                        format: date-time
                      dueAt:
                        nullable: true
                        type: string
                        format: date-time
                      terminatedAt:
                        nullable: true
                        type: string
                        format: date-time
                    required:
                      - id
                      - externalReference
                      - amount
                      - startAt
                      - dueAt
                      - terminatedAt
                    additionalProperties: false
                  routineCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  complianceCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  actions:
                    type: object
                    properties:
                      canBeUpdated:
                        type: boolean
                      canBeArchived:
                        type: boolean
                      canBeUnarchived:
                        type: boolean
                      canBeDeleted:
                        type: boolean
                      canBeTerminated:
                        type: boolean
                      canBeClosed:
                        type: boolean
                      canBeRenewed:
                        type: boolean
                    required:
                      - canBeUpdated
                      - canBeArchived
                      - canBeUnarchived
                      - canBeDeleted
                      - canBeTerminated
                      - canBeClosed
                      - canBeRenewed
                    additionalProperties: false
                required:
                  - id
                  - ref
                  - name
                  - description
                  - type
                  - status
                  - providerId
                  - archivedAt
                  - deletedAt
                  - createdAt
                  - updatedAt
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false

````