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

# PUT /v1/key/allowed-ips — Restrict a Key to Your Servers

> Bind an API key to specific IP addresses or CIDR ranges so a leaked key is useless from anywhere else.

Binds the key to the addresses your servers actually call from. Requests from anywhere else are refused with `403 ip_not_allowed`. An empty array clears the restriction.

This is the cheapest protection against the most common way keys leak: a log line, a screenshot, a committed `.env`.

<Warning>
  A list that does not include the address you are calling from is **refused, not applied** — setting an allowlist you are not inside is indistinguishable from revoking your own key. The error echoes the address we saw. To hand a key to servers you are not on, include your own address, apply, then remove it once they are connecting.
</Warning>

The same setting is available in the account panel at [csboard.com/profile?tab=api](https://csboard.com/profile?tab=api). Neither is the only way in.

**Authentication required.** Send your key as `Authorization: Bearer csb_pub_...`.


## OpenAPI

````yaml PUT /key/allowed-ips
openapi: 3.1.0
info:
  title: CSBoard API
  version: 1.0.0
  description: >-
    Market data over the CSBoard marketplace — live listings, floats, stickers,
    minAsk prices, FX rates — plus opt-in buying straight from your balance.
    Free to read, key-gated, built for automation.
  contact:
    name: CSBoard
    url: https://csboard.com/docs
servers:
  - url: https://csboard.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Status
    description: Liveness and freshness probes.
  - name: Market data
    description: Read the live catalog, prices, and FX rates.
  - name: Trading
    description: Buy listings from your CSBoard balance. Opt-in, key-gated.
  - name: Account
    description: Your balance, settled funds, and trading status.
  - name: Webhooks
    description: Register an endpoint and receive signed order updates instead of polling.
paths:
  /key/allowed-ips:
    put:
      tags:
        - Account
      summary: Restrict this key to your own addresses
      description: >-
        Bind the key to a set of addresses or CIDR ranges, v4 or v6. An empty
        array clears the restriction. Requests from anywhere else are refused
        with 403 ip_not_allowed.\n\nA list that would not admit the calling
        address is refused rather than applied — setting an allowlist you are
        not inside is indistinguishable from revoking your own key. The same
        operation is available from the account panel.
      operationId: putKeyAllowedIps
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ips
              properties:
                ips:
                  type: array
                  items:
                    type: string
                  description: >-
                    Addresses or CIDR ranges. Empty clears the restriction. Max
                    20.
      responses:
        '200':
          description: Applied.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      allowed_ips:
                        type: array
                        items:
                          type: string
                      your_ip:
                        type: string
        '400':
          description: >-
            `invalid_request` for a malformed entry, or `would_lock_you_out`
            when the list excludes the calling address (which is echoed back).
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your key as a Bearer token on every request: `Authorization: Bearer
        csb_pub_...`. Generate keys in your CSBoard profile.

````