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

# Get contract

> Retrieve a single contract by ID.

Required scope: `contracts:read`



## OpenAPI

````yaml get /v1/contracts/{contract_id}
openapi: 3.0.0
info:
  title: Otark BRP API
  description: >-
    API for Balancing Responsible Parties (BRPs) to manage contracts,
    transactions, nominations, and customers on the Otark platform.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.otark.energy
    description: Production
security: []
tags:
  - name: Contracts
    description: Manage energy contracts (PPA, day-ahead, etc.)
  - name: Transactions
    description: Contractual energy volumes between buyer and seller
  - name: Nominations
    description: Net saldo aggregated by balance group
  - name: Customers
    description: Manage customers assigned to the BRP
paths:
  /v1/contracts/{contract_id}:
    get:
      tags:
        - Contracts
      summary: Get contract
      description: |-
        Retrieve a single contract by ID.

        Required scope: `contracts:read`
      operationId: getContract
      parameters:
        - name: contract_id
          in: path
          required: true
          description: Contract identifier
          schema:
            type: string
            example: con_a1b2c3d4
      responses:
        '200':
          description: Contract details
          headers:
            x-ratelimit-limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            x-ratelimit-remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            x-ratelimit-reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contract'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKeyAuth: []
components:
  headers:
    X-RateLimit-Limit:
      description: Maximum number of requests allowed per window
      schema:
        type: integer
        example: 300
    X-RateLimit-Remaining:
      description: Remaining requests in the current window
      schema:
        type: integer
        example: 299
    X-RateLimit-Reset:
      description: Seconds until the rate limit window resets
      schema:
        type: integer
        example: 60
  schemas:
    Contract:
      type: object
      description: >-
        An energy contract. Contracts are polymorphic — the schema varies by
        `type`.
      properties:
        id:
          type: string
          description: Internal unique contract identifier
          example: con_a1b2c3d4
        external_id:
          type: string
          description: External reference identifier
          example: PPA-2025-0042
        type:
          type: string
          description: Contract type
          enum:
            - ppa
            - day_ahead
            - intraday
          example: ppa
        status:
          type: string
          description: Contract status
          enum:
            - pending
            - in_progress
            - completed
          example: in_progress
        delivery_start:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 delivery start (UTC)
          example: '2026-01-01T00:00:00Z'
        delivery_end:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 delivery end (UTC)
          example: '2026-03-31T23:45:00Z'
        seller:
          $ref: '#/components/schemas/Counterparty'
        buyer:
          $ref: '#/components/schemas/Counterparty'
        ppa_type:
          type: string
          nullable: true
          description: PPA pricing/delivery type (only present when `type` is `ppa`)
          enum:
            - forecasted
            - produced
            - consumed
            - baseload
            - shaped
            - peakload
            - indexed
          example: indexed
        period:
          type: string
          nullable: true
          description: Contract period display name (only present when `type` is `ppa`)
          example: Q1-2026
        delivery_profile:
          type: string
          nullable: true
          description: Delivery profile name (only present when `type` is `ppa`)
          example: ENWEX Solar 2026
        asset:
          description: >-
            The generating asset (only present when `type` is `ppa` and an asset
            is assigned)
          allOf:
            - $ref: '#/components/schemas/Asset'
        created_at:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 creation timestamp
          example: '2024-11-20T10:00:00Z'
      required:
        - id
        - external_id
        - type
        - status
        - delivery_start
        - delivery_end
        - seller
        - buyer
        - created_at
    Counterparty:
      type: object
      description: A counterparty identified by EIC code
      properties:
        name:
          type: string
          description: Company or entity name
          example: GreenCo Energy BV
        eic:
          type: string
          description: EIC code (balance group)
          example: 11YGREENENERGY-Z
        tso:
          type: string
          description: TSO responsible for the balance group
          enum:
            - DE_AMPRION
            - DE_TENNET
            - DE_TRANSNET_BW
            - DE_50HERTZ
          example: DE_TENNET
      required:
        - name
        - eic
        - tso
    Asset:
      type: object
      description: A generating asset
      properties:
        id:
          type: string
          description: Unique asset identifier
          example: ast_w1x2y3z4
        name:
          type: string
          description: Display name of the generating asset
          example: Zonnepark De Wilgen
        nominal_power:
          type: number
          description: Nominal power capacity in MW
          example: 25
        technology:
          type: string
          description: Generation technology
          enum:
            - solar
            - wind_onshore
            - wind_offshore
          example: solar
        tso:
          type: string
          description: TSO responsible for the asset's grid connection
          enum:
            - DE_AMPRION
            - DE_TENNET
            - DE_TRANSNET_BW
            - DE_50HERTZ
          example: DE_TENNET
      required:
        - id
        - name
        - nominal_power
        - technology
        - tso
    Problem:
      type: object
      description: >-
        Error response following [RFC 9457 — Problem Details for HTTP
        APIs](https://www.rfc-editor.org/rfc/rfc9457).
      properties:
        type:
          type: string
          format: uri
          description: Absolute URI identifying the problem class
          example: https://brp.otark.team/errors/balance_group_tso_not_enabled
        title:
          type: string
          description: >-
            Short human-readable label (stable across occurrences of the same
            type)
          example: Balance Group TSO Not Enabled
        status:
          type: integer
          description: HTTP status code
          example: 400
        detail:
          type: string
          description: Human-readable explanation for this specific occurrence
          example: >-
            The requested TSO is not enabled for this balance group. Enable it
            via the balance group settings first.
        instance:
          type: string
          description: URI identifying the specific request
          example: /v1/customers/cust_r8s9t0u1
        errors:
          type: array
          description: Field-level validation errors (present on validation failures)
          items:
            $ref: '#/components/schemas/ProblemFieldError'
      required:
        - type
        - title
        - status
    ProblemFieldError:
      type: object
      description: A single field-level validation error
      properties:
        field:
          type: string
          description: JSON path of the field that caused the error
          example: balance_group.tso
        code:
          type: string
          description: >-
            Machine-readable error code: `unknown_field`, `read_only_field`,
            `required`, `invalid_type`, `invalid_enum_value`, `invalid_format`,
            `invalid_literal`, `value_too_small`, `value_too_large`, or
            `validation_failed`
          example: invalid_enum_value
        message:
          type: string
          description: Human-readable description of the issue
          example: >-
            Invalid enum value. Expected 'DE_AMPRION' | 'DE_TENNET' |
            'DE_TRANSNET_BW' | 'DE_50HERTZ', received 'INVALID'
      required:
        - code
        - message
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://brp.otark.team/errors/invalid_api_key
            title: Invalid API Key
            status: 401
    Forbidden:
      description: API key lacks required scopes
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://brp.otark.team/errors/insufficient_scopes
            title: Insufficient API Key Scopes
            status: 403
            detail: >-
              Missing scope: customers:write. Please create a new API key with
              the required scopes.
    NotFound:
      description: Resource does not exist or caller has no access
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://brp.otark.team/errors/customer_not_found
            title: Customer Not Found
            status: 404
            instance: /v1/customers/cust_r8s9t0u1
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````