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

# Update per-session limit for account

> Set the per-session traffic and/or duration ceiling for a sub-account. The proxy disconnects the session once it reaches either ceiling. Send one or both fields; an omitted field is left unchanged, `0` disables that ceiling.


<Note>
  Applies to sub-accounts you own. Each ceiling has three states: omit the field to inherit the parent account's value, send `0` to disable it, or send a positive value to cap it. The proxy disconnects the session once it reaches either ceiling.
</Note>


## OpenAPI

````yaml put /accounts/{id}/session-limit
openapi: 3.0.1
info:
  title: Proxy Resellers API
  x-logo:
    url: logo192.png
    altText: Massive Proxy Resellers API
  description: >
    The Proxy Resellers API allows to manage proxy resellers accounts.

    The accounts created via this API are used to authenticate the Network API
    (see below "Using Credentials).


    ## Features

    - Create an account

    - Update an account

    - Get list of accounts created

    - Enable/Disable account

    - Manage account domains blocklist

    - Set per-session traffic/duration limits for a sub-account

    - Allocate traffic for account

    - Get list of allocations made for account

    - Get current account traffic usage


    ## Authorization

    The API uses API key for authorization. The API key should be included in
    the request header as `x-api-key`.


    Please note that the API key provided for the Network API is not
    automatically enabled for this API, enabling it must be requested to Massive
    support.


    ## Using Credentials

    Successfully created account will have the following credentials to access
    the Massive Network:

    - Username: `<customerUsername>_<accountUsername>`

    - Password: `<accountPassword>`


    **The account will be linked to the customer but have own credentials to
    access the Massive Network.**


    ### Example

    Request:

    ```sh

    curl --location 'https://api-network.joinmassive.com/resellers/accounts' \

    --header 'Content-Type: application/json' \

    --header 'x-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \

    --data-raw '{
      "username": "johndoe@example.com",
      "password": "isdnf8eh8weun823"
    }'

    ```


    Request to the Massive Network considering that x-api-key belongs to the
    demo@joinmassive.com account:

    ```sh

    curl -x 'https://network.joinmassive.com:65535' \

    -U 'demo@joinmassive.com_johndoe@example.com:isdnf8eh8weun823'

    ```


    _demo@joinmassive.com_johndoe@example.com_ is a username and targeting
    params can be provided according to the Massive Network documentation.
  version: v1
servers:
  - url: https://api-network.joinmassive.com/resellers
security: []
paths:
  /accounts/{id}/session-limit:
    put:
      tags:
        - User profile Configuration
      summary: Update per-session limit for account
      description: >
        Set the per-session traffic and/or duration ceiling for a sub-account.
        The proxy disconnects the session once it reaches either ceiling. Send
        one or both fields; an omitted field is left unchanged, `0` disables
        that ceiling.
      operationId: updateSessionLimit
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The account ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateSessionLimitRequest'
      responses:
        '200':
          description: Session limit updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updateSessionLimitResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/AccountNotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - api-key: []
components:
  schemas:
    updateSessionLimitRequest:
      type: object
      minProperties: 1
      description: At least one field is required.
      properties:
        session_traffic_limit:
          type: string
          description: >-
            Per-session traffic ceiling: SI size string ("250kb", "250mb",
            "250gb") or raw byte count. `0` disables; a positive value is >=
            1000 bytes.
          example: 250mb
        session_duration_limit:
          type: string
          description: >-
            Per-session duration ceiling as a duration ("15m", "1h30m").
            `0`/`"0s"` disables; a positive value is >= 1s.
          example: 15m
    updateSessionLimitResponse:
      type: object
      properties:
        id:
          type: string
          description: The account ID.
          example: acc_12345
  responses:
    BadRequestError:
      description: >-
        The request is invalid (more details can be found in the error message
        in the body).
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: The error message.
                example: 'Invalid request: <details>'
    UnauthorizedError:
      description: Operation not authorized
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: The error message.
                example: Unauthorized
    ForbiddenError:
      description: Operation forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: The error message.
                example: Forbidden
    AccountNotFound:
      description: AccountNotFound
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: The error message.
                example: Account not found
    InternalServerError:
      description: Internal Server error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: The error message.
                example: Internal server error
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header

````