blockreq_createEndpoint
此内容尚不支持你的语言。
Description
Section titled “Description”Creates a new endpoint on a specified blockchain network. Each account is limited to 100 endpoints. The response includes the generated API key and endpoint URLs.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
chain | string | Yes | Network slug (use blockreq_supportedNetworks to list available chains) |
name | string | No | Custom name for the endpoint (auto-generated if omitted) |
Returns
Section titled “Returns”| Field | Type | Description |
|---|---|---|
endpointId | string | Unique endpoint identifier |
name | string | Endpoint name |
chain | string | Network slug |
status | string | Always active for new endpoints |
apiKey | string | Generated API key |
httpsUrl | string | HTTPS endpoint URL |
wssUrl | string | WebSocket endpoint URL |
Errors
Section titled “Errors”| Code | Message | Description |
|---|---|---|
| -32602 | Invalid chain | Chain slug not in supported networks |
| -32003 | Endpoint limit reached (100) | Account has reached the maximum number of endpoints |
Request Example
Section titled “Request Example”{ "jsonrpc": "2.0", "method": "blockreq_createEndpoint", "params": [{ "chain": "ethereum", "name": "my-prod-endpoint" }], "id": 1}Response Example
Section titled “Response Example”{ "jsonrpc": "2.0", "id": 1, "result": { "endpointId": "a1b2c3d4-...", "name": "my-prod-endpoint", "chain": "ethereum", "status": "active", "apiKey": "f8e7d6c5b4a3...", "httpsUrl": "https://eth-mainnet.blockreq.com/v1/rpc/f8e7d6c5b4a3...", "wssUrl": "wss://eth-mainnet.blockreq.com/v1/rpc/f8e7d6c5b4a3..." }}Code Examples
Section titled “Code Examples”curl -X POST https://eth-mainnet.blockreq.com/v1/rpc/YOUR_API_KEY \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"blockreq_createEndpoint","params":[{"chain":"ethereum","name":"my-prod-endpoint"}],"id":1}'const response = await fetch('https://eth-mainnet.blockreq.com/v1/rpc/YOUR_API_KEY', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'blockreq_createEndpoint', params: [{ chain: 'ethereum', name: 'my-prod-endpoint' }], id: 1, }),});const data = await response.json();console.log(`Created: ${data.result.httpsUrl}`);