# Delete a profile by time range

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /import/profiles/{customerId}/{importId}/{suit}:
    delete:
      summary: Delete a profile by time range
      deprecated: false
      description: >+
        This endpoint enables clients to remove a profile selected by the
        combination of `importId`, `suit` and a time range. Each profile to
        delete is sent in a separate HTTP request. Sending profiles to delete
        from multiple servers might hit rate limiting limits.

        Removes a profile selected by the combination of `importId`, `suit` and
        time range.


        The time range is specified by the `from` and `to`. A profile is
        selected if the stored profile’s range exactly matches the requested
        time range.


        - the request is rejected with 409 if the requested time range has a
        non‑empty intersection with the range of **one profile** but does not
        match it exactly.


        - the request is rejected with 409 if the requested time range has a
        non‑empty intersection with the ranges of two or more profiles.


        Each request is validated against these rules:


        - `from`, `to` are required fields and must be non-empty


        - `from` and `to` must conform to time format defined in RFC3339, the
        time will be truncated to whole seconds


        - time range defined by `from` and `to` must select exactly one profile.


        In case of success, the response contains the deleted profile.




      operationId: Delete a profile by time range
      tags:
        - Profiles to Enectiva
        - Profiles to Enectiva
      parameters:
        - name: customerId
          in: path
          description: >-
            UUID of the customer, available in the token management section in
            Enectiva
          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 `importId`). *For new profiles, by default the `suit` field
            is set as `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
        - name: Content-Type
          in: header
          description: e.g. application/vnd.api+json
          required: true
          example: application/vnd.api+json
          schema:
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                    attributes:
                      type: object
                      properties:
                        from:
                          type: string
                        to:
                          type: string
                      required:
                        - from
                        - to
                      x-apidog-orders:
                        - from
                        - to
                  required:
                    - type
                    - attributes
                  x-apidog-orders:
                    - type
                    - attributes
              required:
                - data
              x-apidog-orders:
                - data
            example:
              data:
                type: profiles
                attributes:
                  from: '2015-11-18T09:54:23+01:00'
                  to: '2015-11-18T09:59:23+01:00'
      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
        '400':
          description: Bad Request
          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: Range is invalid
                        status: '400'
                        title: Bad Request
                required:
                  - errors
              example:
                errors:
                  - detail: Range is invalid
                    status: '400'
                    title: Bad Request
          headers: {}
          x-apidog-name: Bad Request
        '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:
                        - detail
                        - status
                        - title
                    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:
                        - detail
                        - status
                        - title
                    type: array
                type: object
                x-apidog-orders:
                  - errors
                examples:
                  - errors:
                      - detail: Profile not found
                        status: '404'
                        title: Not Found
                required:
                  - errors
              example:
                errors:
                  - detail: Profile not found
                    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:
                        - detail
                        - status
                        - title
                    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
        '409':
          description: Conflict
          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: Multiple profiles found with overlapping ranges
                        status: '409'
                        title: Conflict
                required:
                  - errors
              example:
                errors:
                  - detail: Multiple profiles found with overlapping ranges
                    status: '409'
                    title: Conflict
          headers: {}
          x-apidog-name: Conflict
        '415':
          description: Unsupported Media Type
          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: >-
                          Unsupported Content-Type header value in the request.
                          The endpoint expects the request to include header
                          `Content-Type: application/vnd.api+json`
                        status: '415'
                        title: Unsupported Media Type
                required:
                  - errors
              example:
                errors:
                  - detail: >-
                      Unsupported Content-Type header value in the request. The
                      endpoint expects the request to include header
                      `Content-Type: application/vnd.api+json`
                    status: '415'
                    title: Unsupported Media Type
          headers: {}
          x-apidog-name: Unsupported Media Type
        '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: qW6olxp8Wcr-eVZBgferq
                schemeIds:
                  - Access  or  Import token
            required: true
            use:
              id: qW6olxp8Wcr-eVZBgferq
            scopes:
              qW6olxp8Wcr-eVZBgferq: {}
      x-apidog-folder: Profiles to Enectiva
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1003855/apis/api-20094712-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: []

```
