curl --request POST \
--url https://api.chainstack.com/v2/nodes/{node_id}/access-rules/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "ip",
"value": "203.0.113.10"
}
'{
"id": "NAR-123-456-789",
"node_id": "ND-123-456-789",
"type": "ip",
"value": "203.0.113.10",
"status": "deactivated",
"created_at": "2026-10-01T09:30:00.000000Z",
"updated_at": "2026-10-01T09:30:00.000000Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Create a node access rule with the Chainstack Platform API v2
Restrict a node endpoint to an IP address or origin using the Chainstack Platform API v2. Send a POST request to /v2/nodes//access-rules/ with the rule type and value.
curl --request POST \
--url https://api.chainstack.com/v2/nodes/{node_id}/access-rules/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "ip",
"value": "203.0.113.10"
}
'{
"id": "NAR-123-456-789",
"node_id": "ND-123-456-789",
"type": "ip",
"value": "203.0.113.10",
"status": "deactivated",
"created_at": "2026-10-01T09:30:00.000000Z",
"updated_at": "2026-10-01T09:30:00.000000Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Chainstack API uses API keys to authenticate requests. You can view and manage your API keys in the platform UI.
Your API keys carry many privileges, so be sure to keep them secure!
Provide your API key as the Authorization header. The value of the header consists of Bearer prefix and secret key generated through the platform UI.
curl -X GET 'https://api.chainstack.com/v1/organization/' \
--header 'Authorization: Bearer FX7CWlLg.FMpAO8cgCX2N7s41EncRru2nb5CmTZUt'
All API requests must be made over HTTPS.
Path Parameters
ID of the node.
"ND-123-456-789"
Body
Rule type:
ip— allow requests from an IP address.origin— allow requests whose HTTPOriginheader matches the value.
ip, origin The value to allow:
- For
ip— an IPv4 or IPv6 address, for example203.0.113.10. - For
origin— a host name (example.com), a host name with a wildcard for its subdomains (*.example.com), or*for any origin. Up to 65 characters, no spaces.
"203.0.113.10"
Response
ID of the access rule.
"NAR-123-456-789"
ID of the node the rule belongs to.
"ND-123-456-789"
Rule type:
ip— allow requests from an IP address.origin— allow requests whose HTTPOriginheader matches the value.
ip, origin The allowed IP address or origin.
"203.0.113.10"
Whether the rule is enforced. New rules start as deactivated.
activated, deactivated When the rule was created.
When the rule was last changed.
Was this page helpful?