The API Gateway Service enables developers to securely access the Polygon APIs for use in building their own applications on their desired platforms. This service acts as a single entry point for all developer API applications hosted by Polygon Technology, routing client requests to the appropriate backend services.
https://api-gateway.polygon.technology/
Users and applications who require access to Polygon API applications like bridge transactions, merkle-proof api, tokens apis etc. must register themselves with the API Gateway service and receive an API key that defines their usage limits.
This API key can be used to make requests and calls to the following APIs (This list will be updated as and when more Polygon API endpoints are moved behind the gateway).
Once the API key is obtained you can pass the api key in the headers of your request under x-api-key
key
The API key is an authentication key and it allows to query the APIs behind API Gateway. This section will explain how to register and manage your API keys and limits.
<aside> 🚧
API Gateway Service’s UI is not released yet. All the steps explained below will require you to have basic knowledge of how to programatically hit APIs.
</aside>
Register to Polygon API Gateway using a valid email address and password. Once registered, you should receive an email verification link in your inbox. The verification link will only be valid for 30 mins. If the link expires, you have to register yourself again to generate a new verification link.
Endpoint - POST
https://api-gateway.polygon.technology/api/users/register
Params
Key | Type | Description |
---|---|---|
Body | A valid user/project’s email | |
password | Body | Password must be a minimum of 10 characters in length with at least 1 uppercase, 1 lowercase, 1 numeral and 1 special character in it |
Example
// Register endpoint example
curl --location '<https://api-gateway.polygon.technology/api/users/register>' \\
--header 'Content-Type: application/json' \\
--data-raw '{
"email": "[email protected]",
"password": "John&Doe@137"
}'
The email verification link should be sent to your email from [email protected] once you complete registration. The link will only be valid for 30 mins. Clicking the link should validate your email and present you with the API Key in the response. Use this key in the headers while requesting the APIs.
Endpoint - GET
https://api-gateway.polygon.technology/api/users/verify-email
Params
Key | Type | Description |
---|---|---|
Query | The user/project’s email to be verified | |
otp | Query | A one time password to verify your email |
Example
// Verify-email endpoint example
curl --location '<https://api-gateway.polygon.technology/api/users/verify-email?email=johndoe%40polygon.com&otp=QWERTY1234>'
The get-api-key endpoint retrieves your API key connected to your email. Use this key in the headers while requesting the APIs.
Endpoint - POST
https://api-gateway.polygon.technology/api/users/get-api-key
Params
Key | Type | Description |
---|---|---|
Body | The user/project’s registered email | |
password | Body | The user/project’s registered password |
Example
// Get-api-key endpoint example
curl --location '<https://api-gateway.polygon.technology/api/users/get-api-key>' \\
--header 'Content-Type: application/json' \\
--data-raw '{
"email": "[email protected]",
"password": "John&Doe@137"
}'
Whenever your API key is exposed and misused or you wish to generate a new key, this endpoint helps you to void the current key and replace it with a new api key.
Endpoint - POST
https://api-gateway.polygon.technology/api/users/regenerate-api-key
Params
Key | Type | Description |
---|---|---|
Body | The user/project’s registered email | |
password | Body | The user/project’s registered password |
Example
// Regenerate-api-key endpoint example
curl --location '<https://api-gateway.polygon.technology/api/users/regenerate-api-key>' \\
--header 'Content-Type: application/json' \\
--data-raw '{
"email": "[email protected]",
"password": "John&Doe@137"
}'
This get endpoint helps you raise a request for your password reset. Once the request is successful, an email with an One Time Password (OTP) expiring in 30 mins will be sent to your requested email address using which you can authenticate your password update.
Endpoint - GET
https://api-gateway.polygon.technology/api/users/request-password-reset
Params
| --- | --- | --- |
Example
// Request-password-reset endpoint example
curl --location '<https://api-gateway.polygon.technology/api/users/request-password-reset?email=johndoe%40polygon.com>'