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

# Delete Allocation

> Removes an existing resource allocation.

**Request Body Requirements:**
All values in the object are required.

**Known Errors:**
- `AllocationNotFoundError` — The specified allocation cannot be found
- `ProjectNotFoundError` — The specified project cannot be found

Please ensure that your request is valid and all specified resources exist to avoid these errors.



## OpenAPI

````yaml /api-reference/resource-allocation-openapi.json delete /allocation/removeAllocation
openapi: 3.1.0
info:
  title: COR Resource Allocation API
  description: >-
    The Resource Allocation API is a dedicated service for managing the capacity
    of users on the COR platform. This API uses the same authentication as the
    main COR API.
  version: 1.0.0
servers:
  - url: https://planner.svc.v2.projectcor.com
    description: Resource Allocation Service
security:
  - bearerAuth: []
paths:
  /allocation/removeAllocation:
    delete:
      tags:
        - Resource Allocation
      summary: Delete Allocation
      description: >-
        Removes an existing resource allocation.


        **Request Body Requirements:**

        All values in the object are required.


        **Known Errors:**

        - `AllocationNotFoundError` — The specified allocation cannot be found

        - `ProjectNotFoundError` — The specified project cannot be found


        Please ensure that your request is valid and all specified resources
        exist to avoid these errors.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AllocationInput'
            example:
              userId: 1111
              companyId: 111
              resource:
                typeId: Project
                entityId: 1111
              from: '2024-01-01'
              to: '2024-03-31'
              assignedByUserId: 11111
              allocatedHours: 20
      responses:
        '200':
          description: Allocation deleted successfully
        '400':
          description: Allocation not found error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllocationError'
              example:
                error: AllocationNotFoundError
                message: The specified allocation cannot be found
components:
  schemas:
    AllocationInput:
      type: object
      required:
        - userId
        - companyId
        - resource
        - from
        - to
        - assignedByUserId
        - allocatedHours
      properties:
        userId:
          type: integer
          description: ID of the user being allocated
        companyId:
          type: integer
          description: Company ID
        email:
          type: string
          format: email
          description: User email (optional)
        resource:
          $ref: '#/components/schemas/AllocationResource'
        from:
          type: string
          format: date
          description: Start date (YYYY-MM-DD)
        to:
          type: string
          format: date
          description: >-
            End date (YYYY-MM-DD). Must be after 'from' date and within 12
            months.
        assignedByUserId:
          type: integer
          description: ID of the user who assigned the allocation
        allocatedHours:
          type: number
          description: Number of hours allocated
    AllocationError:
      type: object
      properties:
        error:
          type: string
          description: Error type
          enum:
            - InvalidAllocationError
            - AllocationAlreadyExistInDatesRangeError
            - UserNotFoundError
            - UserNotHaveWorkDaysError
            - ProjectNotFoundError
            - AllocationNotFoundError
        message:
          type: string
          description: Error description
    AllocationResource:
      type: object
      required:
        - typeId
        - entityId
      properties:
        typeId:
          type: string
          enum:
            - Project
          description: Type of resource (currently only Project is supported)
        entityId:
          type: integer
          description: Project ID
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Uses the same authentication as the main COR API. Obtain a token from
        https://api.projectcor.com/v1/oauth/token

````