Create access token - Platform API

POST /tokens creates a Shared Node access token and returns it with its ready-to-use endpoint URL. The token's id and name are generated.

POST https://public-api.getblock.io/api/v1/tokens

The combination of protocol, network, mode, api, and region must be one GetBlock serves. Read valid combinations from GET /protocols/{id}. For a token on a Dedicated or Limitless Node, use POST /dedicated/{id}/tokens or POST /limitless/{id}/tokens.

Parameters

ParameterTypeRequiredDescription
protocolstringYesProtocol id from GET /protocols, such as eth.
networkstringYesNetwork id, such as mainnet.
apistringYesAPI type, such as json-rpc, ws, or graphql.
modestringNoSync mode, full or archive. Default full.
regionstringNoRegion, such as eu-central-1. Default eu-central-1.
addonstringNoAdd-on id from GET /addons, such as mevprotected.

Body parameters, sent as JSON.

Request Example

bashcurl -X POST https://public-api.getblock.io/api/v1/tokens \
  -H "Authorization: Bearer $GETBLOCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"protocol":"eth","network":"mainnet","api":"json-rpc","mode":"archive","region":"eu-central-1"}'
javascriptconst response = await fetch('https://public-api.getblock.io/api/v1/tokens', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ protocol: 'eth', network: 'mainnet', api: 'json-rpc', mode: 'archive', region: 'eu-central-1' })
});
const body = await response.json();

console.log(body.endpoint);
pythonimport os
import requests

body = requests.post(
    "https://public-api.getblock.io/api/v1/tokens",
    headers={"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"},
    json={"protocol": "eth", "network": "mainnet", "api": "json-rpc", "mode": "archive", "region": "eu-central-1"},
).json()

print(body["endpoint"])

Response Example

201 Created:

json{
  "id": "9b2796d7b4c448de83b01644bb93f625",
  "name": "eth-9b279",
  "status": "active",
  "namespace": "shared",
  "protocol": "eth",
  "network": "mainnet",
  "api": "json-rpc",
  "mode": "archive",
  "region": "eu-central-1",
  "addon": "",
  "dedicated_node_id": "",
  "limitless_node_id": "",
  "endpoint": "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/",
  "created_at": "2026-10-02T13:19:13Z",
  "updated_at": "2026-10-02T13:19:13Z"
}

Response Parameters

FieldTypeDescription
idstringThe access token, the credential inside endpoint. Treat it as a secret.
namestringGenerated name, such as eth-9b279.
statusstringactive, or locked when suspended by plan or billing state.
namespacestringAccess type the token was issued for, such as shared.
protocolstringProtocol id.
networkstringNetwork id.
apistringAPI type served on the endpoint.
modestringSync mode. Empty when it does not apply.
regionstringRegion serving the endpoint.
addonstringAdd-on bound to the token. Empty when none.
dedicated_node_idstringSet only for tokens bound to a Dedicated Node.
limitless_node_idstringSet only for tokens bound to a Limitless Node.
endpointstringReady-to-use RPC URL.
created_at, updated_atstringRFC 3339 UTC times.

Use Cases

  • Provision an endpoint per environment from a deployment script
  • Give each customer or service its own token, so one can be rotated without touching the others
  • Create an MEV-protected endpoint by passing "addon": "mevprotected"

Error Handling

HTTPCause
400A required field is missing, or the combination is not served. The error field says which.
401Missing or invalid API key.
403Your plan does not allow it: the token limit is reached, or the network or region needs a paid plan.
429Too many requests. Wait and retry.
502A GetBlock service behind the API did not answer. Retry later.

Error bodies carry an error message and a request_id. See Errors.