# Latest profile

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /import/profiles/{customerId}/{importId}/{suit}/latest:
    get:
      summary: Latest profile
      deprecated: false
      description: >
        Latest profile endpoint enables clients to get the latest imported
        profile for the given meter. It either returns the latest profile (even
        if marked as suspicious) with 200 or a 404 error when the given meter
        has no profiles stored.


        Any token allowed to add profiles is able to read the latest profile as
        well. The purpose is to minimize the number of requests to Librarian.
        Clients should keep track of profiles sent to Librarian on their own.
        However, if they, for some reason, lose track, the preferred course of
        action is to use this endpoint rather than to send a series of profiles
        that have been sent earlier. Duplicate requests result in 409 responses.
      operationId: Latest profile
      tags:
        - Profiles to Enectiva
        - Profiles to Enectiva
      parameters:
        - name: customerId
          in: path
          description: ''
          required: true
          example: '{{customerId}}'
          schema:
            type: string
        - name: importId
          in: path
          description: meter ID in question
          required: true
          example: '{{importId}}'
          schema:
            type: string
        - name: suit
          in: path
          description: >-
            identifier to distinguish multiple series of a single sensor (using
            the same `meterId`), `default` by default
          required: true
          example: '{{suit}}'
          schema:
            type: string
        - name: Accept
          in: header
          description: e.g. application/vnd.api+json
          required: true
          example: application/vnd.api+json
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      attributes:
                        type: object
                        properties:
                          customer_uuid:
                            type: string
                          from:
                            type: string
                          import_id:
                            type: string
                          suit:
                            type: string
                          to:
                            type: string
                          unit:
                            type: string
                          value:
                            type: number
                        required:
                          - customer_uuid
                          - from
                          - import_id
                          - suit
                          - to
                          - unit
                          - value
                        x-apidog-orders:
                          - customer_uuid
                          - from
                          - import_id
                          - suit
                          - to
                          - unit
                          - value
                      id:
                        type: string
                      type:
                        type: string
                    required:
                      - attributes
                      - id
                      - type
                    x-apidog-orders:
                      - attributes
                      - id
                      - type
                required:
                  - data
                x-apidog-orders:
                  - data
              example:
                data:
                  attributes:
                    customer_uuid: 11e7e767-6f74-4994-b607-158ff7f7445e
                    from: '2015-11-18T09:54:23+01:00'
                    import_id: 40AABB_007
                    suit: default
                    to: '2015-11-18T09:59:23+01:00'
                    unit: kW
                    value: 123456.78
                  id: '1'
                  type: profiles
          headers: {}
          x-apidog-name: OK
        '401':
          description: Unauthorized
          content:
            application/vnd.api+json:
              schema:
                properties:
                  errors:
                    items:
                      properties:
                        detail:
                          type: string
                        status:
                          type: string
                        title:
                          type: string
                      type: object
                      x-apidog-orders:
                        - detail
                        - status
                        - title
                      required:
                        - title
                        - detail
                        - status
                    type: array
                type: object
                x-apidog-orders:
                  - errors
                examples:
                  - errors:
                      - detail: >-
                          No access token provided, please use `Authorization:
                          Bearer access_token`
                        status: '401'
                        title: Unauthorized
                required:
                  - errors
              example:
                errors:
                  - detail: >-
                      No access token provided, please use `Authorization:
                      Bearer access_token`
                    status: '401'
                    title: Unauthorized
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: Forbidden
          content:
            application/vnd.api+json:
              schema:
                properties:
                  errors:
                    items:
                      properties:
                        detail:
                          type: string
                        status:
                          type: string
                        title:
                          type: string
                      type: object
                      x-apidog-orders:
                        - detail
                        - status
                        - title
                      required:
                        - title
                        - status
                        - detail
                    type: array
                type: object
                x-apidog-orders:
                  - errors
                examples:
                  - errors:
                      - detail: The access token does not have `la` scope
                        status: '403'
                        title: Forbidden
                required:
                  - errors
              example:
                errors:
                  - detail: The access token does not have `la` scope
                    status: '403'
                    title: Forbidden
          headers: {}
          x-apidog-name: Forbidden
        '404':
          description: Not Found
          content:
            application/vnd.api+json:
              schema:
                properties:
                  errors:
                    items:
                      properties:
                        detail:
                          type: string
                        status:
                          type: string
                        title:
                          type: string
                      type: object
                      x-apidog-orders:
                        - detail
                        - status
                        - title
                      required:
                        - title
                        - status
                        - detail
                    type: array
                type: object
                x-apidog-orders:
                  - errors
                examples:
                  - errors:
                      - detail: Meter does not have any profiles yet
                        status: '404'
                        title: Not Found
                required:
                  - errors
              example:
                errors:
                  - detail: Meter does not have any profiles yet
                    status: '404'
                    title: Not Found
          headers: {}
          x-apidog-name: Record Not Found
        '406':
          description: Not Acceptable
          content:
            application/vnd.api+json:
              schema:
                properties:
                  errors:
                    items:
                      properties:
                        detail:
                          type: string
                        status:
                          type: string
                        title:
                          type: string
                      type: object
                      x-apidog-orders:
                        - detail
                        - status
                        - title
                      required:
                        - status
                        - title
                        - detail
                    type: array
                type: object
                x-apidog-orders:
                  - errors
                examples:
                  - errors:
                      - detail: >-
                          Unsupported Accept header value in the request. The
                          endpoint expects the request to include header
                          `Accept: application/vnd.api+json`
                        status: '406'
                        title: Not Acceptable
                required:
                  - errors
              example:
                errors:
                  - detail: >-
                      Unsupported Accept header value in the request. The
                      endpoint expects the request to include header `Accept:
                      application/vnd.api+json`
                    status: '406'
                    title: Not Acceptable
          headers: {}
          x-apidog-name: Not Acceptable
        '429':
          description: Too Many Requests
          content:
            application/vnd.api+json:
              schema:
                properties:
                  errors:
                    items:
                      properties:
                        detail:
                          type: string
                        status:
                          type: string
                        title:
                          type: string
                      type: object
                      x-apidog-orders:
                        - detail
                        - status
                        - title
                      required:
                        - detail
                        - status
                        - title
                    type: array
                type: object
                x-apidog-orders:
                  - errors
                examples:
                  - errors:
                      - detail: You have exceeded the number of allowed requests.
                        status: '429'
                        title: Too Many Requests
                required:
                  - errors
              example:
                errors:
                  - detail: You have exceeded the number of allowed requests.
                    status: '429'
                    title: Too Many Requests
          headers: {}
          x-apidog-name: Too Many Requests
        '500':
          description: Internal Server Error
          content:
            application/vnd.api+json:
              schema:
                properties:
                  errors:
                    items:
                      properties:
                        status:
                          type: string
                        title:
                          type: string
                      type: object
                      x-apidog-orders:
                        - status
                        - title
                      required:
                        - status
                        - title
                    type: array
                type: object
                x-apidog-orders:
                  - errors
                examples:
                  - errors:
                      - status: '500'
                        title: Internal Server Error
                required:
                  - errors
              example:
                errors:
                  - status: '500'
                    title: Internal Server Error
          headers: {}
          x-apidog-name: Server Error
      security:
        - Access  or  Import token: []
          x-apidog:
            schemeGroups:
              - id: JRjLUxmjoxjkBob1kA6Lp
                schemeIds:
                  - Access  or  Import token
            required: true
            use:
              id: JRjLUxmjoxjkBob1kA6Lp
            scopes:
              JRjLUxmjoxjkBob1kA6Lp: {}
      x-apidog-folder: Profiles to Enectiva
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1003855/apis/api-19188100-run
components:
  schemas: {}
  securitySchemes:
    Access token:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      x-apidog:
        addTokenTo: header
        headerPrefix: Bearer
    Import token:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      x-apidog:
        addTokenTo: header
        headerPrefix: Bearer
    Login token:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      x-apidog:
        addTokenTo: header
        headerPrefix: Bearer
    Access  or  Import token:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      x-apidog:
        addTokenTo: header
        headerPrefix: Bearer
servers:
  - url: https://api.enectiva.cz
    description: https://api.enectiva.cz
security: []

```
