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

# Allocate Proxies

> Allocates time to extend the expiration of one or more proxy servers.

Allocates time to a proxy server to extend its expiration date. Providing `period` and `interval` will extend the proxy's expiration date by the specified amount of time.

<Warning>
  When allocating time to a proxy, funds will be deducted from your Illusory Wallet. Ensure you have sufficient funds
  before allocating.
</Warning>


## OpenAPI

````yaml POST /v1/proxies/allocate
openapi: 3.0.1
info:
  title: Illusory API Reference
  description: Interact with Illusory proxies
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://cmd.illusory.io
security: []
paths:
  /v1/proxies/allocate:
    post:
      description: Allocates time to extend the expiration of one or more proxy servers.
      requestBody:
        description: Allocate proxy details
        content:
          application/json:
            schema:
              type: object
              properties:
                proxies:
                  type: object
                  description: Object containing a list of proxies to allocate.
                  properties:
                    time:
                      type: array
                      description: >-
                        List of proxies to allocate time to. Each item should
                        include `proxy_name`, `interval` and `period`.
                      items:
                        type: object
                        properties:
                          proxy_name:
                            type: string
                            description: Unique identifier of the proxy server
                          interval:
                            type: integer
                            description: Interval for allocation period. e.g., `2` weeks.
                          period:
                            type: string
                            enum:
                              - hourly
                              - daily
                              - weekly
                              - monthly
                              - yearly
                            description: Allocation period, e.g., 'weekly'
                        required:
                          - proxy_name
                          - interval
                          - period
                  required:
                    - time
                  example:
                    time:
                      - proxy_name: ILL-US-AU1-9999
                        interval: 1
                        period: weekly
                      - proxy_name: ILL-US-AU1-9998
                        interval: 2
                        period: monthly
              required:
                - proxies
      responses:
        '202':
          description: Server response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    description: Indicates whether the request was successful e.g., `true`
                  message:
                    type: string
                    description: Success message
                    example: Sent proxy expiration update successfully.
                  data:
                    $ref: '#/components/schemas/proxy-allocate'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error--402-user-low-funds'
      security:
        - bearerAuth: []
components:
  schemas:
    proxy-allocate:
      type: object
      properties:
        proxies:
          type: object
          description: Object containing a list of proxies to allocate.
          properties:
            time:
              type: array
              description: >-
                List of proxies to allocate time to. Each item should include
                `proxy_name`, `interval` and `period`.
              items:
                type: object
                properties:
                  proxy_name:
                    type: string
                    description: Unique identifier of the proxy server
                  interval:
                    type: integer
                    description: Interval for allocation period. e.g., `2` weeks.
                  period:
                    type: string
                    enum:
                      - hourly
                      - daily
                      - weekly
                      - monthly
                      - yearly
                    description: Allocation period, e.g., `weekly`
                  individual_total:
                    type: integer
                    description: >-
                      Total amount to be deducted from your Illusory Wallet for
                      the allocation item.
                    example: 5
                required:
                  - proxy_name
                  - interval
                  - period
      example:
        proxies:
          time:
            - proxy_name: IL-US-AU1-9999
              period: hourly
              interval: 1
              individual_total: 5
        total: 5
    Error:
      type: object
      properties:
        ok:
          type: boolean
          description: Indicates the request was unsuccessful e.g., `false`
        data:
          type: object
          description: Additional error data
          properties:
            proxy_name:
              type: string
              description: Unique identifier of the proxy server
        message:
          type: string
          description: Error message
      example:
        ok: false
        data:
          proxy_name: ILL-US-AU1-9999
        message: Proxy not found
    error--402-user-low-funds:
      type: object
      properties:
        ok:
          type: boolean
          description: Indicates the request was unsuccessful e.g., `false`
        data:
          type: object
          description: Additional error data
          properties:
            funds:
              type: integer
              description: Amount of funds available
            due:
              type: integer
              description: Amount due
        message:
          type: string
          description: Error message
      example:
        ok: false
        data:
          funds: 40
          due: 2198
        message: Insufficient funds. Please add funds to your wallet.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: apiKey
      description: >-
        The `Authorization` header is used to authenticate with the API using
        your `Master` API key. Value is of the format `Bearer YOUR_KEY_HERE`.

````