---
updatedAt: 2026-06-30T16:05:21.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/llms.txt
---

# IP authorization

Check if an IP address is authorized for membership access.

## Overview

Use this endpoint to check if a visitor's IP address is authorized for access through a membership subscription. This is how you implement server-side paywalls for institutional customers like libraries, universities, and corporations.

**Example:** A visitor from IP address 128.112.45.67 requests your premium content. Your server calls this endpoint to check if that IP is authorized. If subscriptions are returned, the visitor has access. If not, show the paywall.

***

## How IP Matching Works

The endpoint checks if the provided IP falls within any configured IP range on membership subscriptions. Supported formats:

| Format        | Example          | What It Matches                     |
| ------------- | ---------------- | ----------------------------------- |
| Single IP     | `192.168.1.100`  | Exactly that IP                     |
| CIDR notation | `128.112.0.0/16` | 128.112.0.0 through 128.112.255.255 |
| IPv6          | `2001:db8::/32`  | All IPs in that IPv6 block          |

Only subscriptions with `type` set to `membership` and a non-empty `ip_addresses` field are checked.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "core-api",
    "version": "1.88"
  },
  "servers": [
    {
      "url": "https://www.pelcro.com/api/v1/core"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      },
      "sec1": {
        "type": "apiKey",
        "in": "query",
        "name": "site_id"
      }
    }
  },
  "security": [
    {
      "sec0": [],
      "sec1": []
    }
  ],
  "paths": {
    "/memberships/ip/authorization": {
      "post": {
        "summary": "IP authorization",
        "description": "Check if an IP address is authorized for membership access.",
        "operationId": "api-core-member-ip-authorization",
        "parameters": [
          {
            "name": "site_id",
            "in": "query",
            "description": "The unique identifier of the site associated with your account.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 1
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer eyJ***"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ip_address"
                ],
                "properties": {
                  "ip_address": {
                    "type": "string",
                    "description": "The requester's IP address in a valid IPv4 or IPv6 format."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"data\": [\n\t\t{\n\t\t\t\"id\": 1926,\n\t\t\t\"address\": 112,\n\t\t\t\"plan\": 27,\n\t\t\t\"coupon\": null,\n\t\t\t\"default_source\": null,\n\t\t\t\"latest_invoice\": 4186,\n\t\t\t\"user_id\": 3267,\n\t\t\t\"customer_id\": 3267,\n\t\t\t\"address_required\": false,\n\t\t\t\"billing\": \"send_invoice\",\n\t\t\t\"cancel_at\": null,\n\t\t\t\"cancel_at_period_end\": 0,\n\t\t\t\"auto_renew\": 1,\n\t\t\t\"canceled_at\": null,\n\t\t\t\"created\": 1715004591,\n\t\t\t\"current_period_end\": 1717682991,\n\t\t\t\"current_period_start\": 1715004591,\n\t\t\t\"days_until_due\": 30,\n\t\t\t\"start_date\": 1715004591,\n\t\t\t\"domains\": null,\n\t\t\t\"ended_at\": null,\n\t\t\t\"source\": \"Phone\",\n\t\t\t\"quantity\": 1,\n\t\t\t\"status\": \"active\",\n\t\t\t\"trial_end\": null,\n\t\t\t\"trial_start\": null,\n\t\t\t\"is_gift_donor\": null,\n\t\t\t\"is_gift_recipient\": null,\n\t\t\t\"is_imported\": false,\n\t\t\t\"ip_addresses\": [\n\t\t\t\t\"41.40.191.38\"\n\t\t\t],\n\t\t\t\"gift_donor_subscription_id\": null,\n\t\t\t\"gift_code\": null,\n\t\t\t\"is_redeemed\": null,\n\t\t\t\"cancel_reason\": null,\n\t\t\t\"shipments_remaining\": null,\n\t\t\t\"shipments_undeliverable\": false,\n\t\t\t\"shipments_suspended_until\": null,\n\t\t\t\"old_provider_id\": null,\n\t\t\t\"schedule\": null,\n\t\t\t\"metadata\": null,\n\t\t\t\"expires_at\": null,\n\t\t\t\"renews_at\": 1717682991,\n\t\t\t\"end_date\": null,\n\t\t\t\"recommended_plan_id\": null\n\t\t}\n\t]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 1926,
                            "default": 0
                          },
                          "address": {
                            "type": "integer",
                            "example": 112,
                            "default": 0
                          },
                          "plan": {
                            "type": "integer",
                            "example": 27,
                            "default": 0
                          },
                          "coupon": {},
                          "default_source": {},
                          "latest_invoice": {
                            "type": "integer",
                            "example": 4186,
                            "default": 0
                          },
                          "user_id": {
                            "type": "integer",
                            "example": 3267,
                            "default": 0
                          },
                          "customer_id": {
                            "type": "integer",
                            "example": 3267,
                            "default": 0
                          },
                          "address_required": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          },
                          "billing": {
                            "type": "string",
                            "example": "send_invoice"
                          },
                          "cancel_at": {},
                          "cancel_at_period_end": {
                            "type": "integer",
                            "example": 0,
                            "default": 0
                          },
                          "auto_renew": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "canceled_at": {},
                          "created": {
                            "type": "integer",
                            "example": 1715004591,
                            "default": 0
                          },
                          "current_period_end": {
                            "type": "integer",
                            "example": 1717682991,
                            "default": 0
                          },
                          "current_period_start": {
                            "type": "integer",
                            "example": 1715004591,
                            "default": 0
                          },
                          "days_until_due": {
                            "type": "integer",
                            "example": 30,
                            "default": 0
                          },
                          "start_date": {
                            "type": "integer",
                            "example": 1715004591,
                            "default": 0
                          },
                          "domains": {},
                          "ended_at": {},
                          "source": {
                            "type": "string",
                            "example": "Phone"
                          },
                          "quantity": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "status": {
                            "type": "string",
                            "example": "active"
                          },
                          "trial_end": {},
                          "trial_start": {},
                          "is_gift_donor": {},
                          "is_gift_recipient": {},
                          "is_imported": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          },
                          "ip_addresses": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "example": "41.40.191.38"
                            }
                          },
                          "gift_donor_subscription_id": {},
                          "gift_code": {},
                          "is_redeemed": {},
                          "cancel_reason": {},
                          "shipments_remaining": {},
                          "shipments_undeliverable": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          },
                          "shipments_suspended_until": {},
                          "old_provider_id": {},
                          "schedule": {},
                          "metadata": {},
                          "expires_at": {},
                          "renews_at": {
                            "type": "integer",
                            "example": 1717682991,
                            "default": 0
                          },
                          "end_date": {},
                          "recommended_plan_id": {}
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"errors\": {\n\t\t\"ip_address\": [\n\t\t\t\"The ip address field is required.\"\n\t\t]\n\t}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "properties": {
                        "ip_address": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "The ip address field is required."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": "Unauthenticated."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```

# Sibling pages

* [List members](https://docs.pelcro.com/reference/api-core-list-memberships.md)
* [Create member](https://docs.pelcro.com/reference/api-core-create-membership.md)
* [Invite member](https://docs.pelcro.com/reference/api-core-invite-member.md)
* [Get member](https://docs.pelcro.com/reference/api-core-get-membership.md)
* [Update member](https://docs.pelcro.com/reference/api-core-update-membership.md)
* [Delete member](https://docs.pelcro.com/reference/api-core-delete-membership.md)