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

# Create an unavailability



## OpenAPI

````yaml https://api.trlyr.com/physical-assets/docs/doc.json post /physical-assets/{physicalAssetID}/unavailability
openapi: 3.1.0
info:
  description: >
    This API manages physical assets on the terralayr platform: asset
    parameters, schedules, ancillary bids and results, metadata, logbook
    entries, unavailabilities, and EEX notifications. 
     
    Endpoints documented here require a valid Bearer token and the appropriate
    organisation permissions for the physical asset. 
     
    ### Authorization 
     
    All documented endpoints require a Bearer-type `Authorization` header: 
     
    ``` 

    Authorization: Bearer <YOUR_TOKEN> 

    ``` 
     
    Obtain a token via the Auth API: 
     
    ``` 

    POST https://api.trlyr.com/auth/public/authenticate 

    ``` 
     
    Example POST body: 
     
    ``` 

    { 
        "username": "YOUR_USERNAME", 
        "password": "YOUR_PASSWORD" 
    } 

    ``` 
     
     
    If you have any questions, contact support@trlyr.com. 
  title: terralayr Physical Assets API
  version: 1.0.0
servers:
  - description: Production API
    url: https://api.trlyr.com
  - description: Sandbox API
    url: https://api.sandbox.trlyr.com
security: []
tags:
  - name: health
  - name: physical-assets
  - name: schedule
  - name: ancillary
  - name: metadata
  - name: logbook
  - name: eex
externalDocs:
  description: ''
  url: ''
paths:
  /physical-assets/{physicalAssetID}/unavailability:
    post:
      tags:
        - physical-assets
      summary: Create an unavailability
      parameters:
        - description: Access token
          in: header
          name: Authorization
          required: true
          schema:
            default: Bearer <access token value>
            type: string
        - description: Physical asset ID
          in: path
          name: physicalAssetID
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_models_http_v0_requests.PostUnavailabilityRequestBody
              description: Unavailability parameters
              summary: unavailability
        description: Unavailability parameters
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_models_http_v0_responses.UnavailabilityResponseBody
          description: Created
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
components:
  schemas:
    pkg_models_http_v0_requests.PostUnavailabilityRequestBody:
      properties:
        description:
          example: Annual maintenance
          type: string
        eexNotificationIds:
          example:
            - 550e8400-e29b-41d4-a716-446655440000
          items:
            type: string
          type: array
          uniqueItems: false
        end:
          example: '2023-11-12T00:00:00Z'
          format: dateTime
          type: string
        start:
          example: '2023-11-11T00:00:00Z'
          format: dateTime
          type: string
        type:
          example: MAINTENANCE
          type: string
        volume:
          $ref: >-
            #/components/schemas/pkg_models_http_v0_requests.UnavailabilityVolumeBody
      required:
        - description
        - end
        - start
        - type
        - volume
      type: object
    pkg_models_http_v0_responses.UnavailabilityResponseBody:
      properties:
        description:
          type: string
        eexNotificationIds:
          items:
            type: string
          type: array
          uniqueItems: false
        end:
          format: dateTime
          type: string
        id:
          format: uuid
          type: string
        physicalAssetID:
          format: uuid
          type: string
        start:
          format: dateTime
          type: string
        type:
          type: string
        volume:
          $ref: >-
            #/components/schemas/pkg_models_http_v0_responses.unavailabilityVolumeBody
      type: object
    pkg_models_http_v0_requests.UnavailabilityVolumeBody:
      properties:
        energyCapacity:
          example: 1000
          type: number
        powerCapacity:
          $ref: >-
            #/components/schemas/pkg_models_http_v0_requests.UnavailablePowerCapacityBody
      required:
        - energyCapacity
        - powerCapacity
      type: object
    pkg_models_http_v0_responses.unavailabilityVolumeBody:
      properties:
        energyCapacity:
          type: number
        powerCapacity:
          $ref: '#/components/schemas/pkg_models_http_v0_responses.powerCapacityBody'
      type: object
    pkg_models_http_v0_requests.UnavailablePowerCapacityBody:
      properties:
        charge:
          example: 1000
          type: number
        discharge:
          example: 1000
          type: number
      required:
        - charge
        - discharge
      type: object
    pkg_models_http_v0_responses.powerCapacityBody:
      properties:
        charge:
          type: number
        discharge:
          type: number
      type: object

````