Authentication
There are two levels of authentication to be considered when using Polymarket’s CLOB.
All signing can be handled directly by the client libraries.
L1: Private Key Authentication
The highest level of authentication is via an account’s Polygon private key.
The private key remains in control of a user’s funds and all trading is non-custodial.
The operator never has control over users’ funds.
Private key authentication is required for:
- Placing an order (for signing the order)
- Creating or revoking API keys
L1 Header
Header | Required? | Description |
---|---|---|
POLY_ADDRESS | yes | Polygon address |
POLY_SIGNATURE | yes | CLOB EIP 712 signature |
POLY_TIMESTAMP | yes | Current UNIX timestamp |
POLY_NONCE | yes | Nonce. Default 0 |
The POLY_SIGNATURE
is generated by signing the following EIP-712 struct.
Implementations exist in:
Signing Example
L2: API Key Authentication
The next level of authentication consists of the API key, secret, and passphrase.
These are used solely to authenticate API requests made to Polymarket’s CLOB, such as posting/canceling orders or retrieving an account’s orders and fills.
When a user on-boards via:
the server uses the signature as a seed to deterministically generate credentials.
An API credential includes:
key
: UUID identifying the credentialssecret
: Secret string used to generate HMACs (not sent with requests)passphrase
: Secret string sent with each request, used to encrypt/decrypt the secret (never stored)
All private endpoints require an API key signature (L2 Header
).
L2 Header
Header | Required? | Description |
---|---|---|
POLY_ADDRESS | yes | Polygon address |
POLY_SIGNATURE | yes | HMAC signature for request |
POLY_TIMESTAMP | yes | Current UNIX timestamp |
POLY_API_KEY | yes | Polymarket API key |
POLY_PASSPHRASE | yes | Polymarket API key passphrase |
API Key Operations
Create API Key
Create new API key credentials for a user.
HTTP Request:
Derive API Key
Derive an existing API key for an address and nonce.
HTTP Request:
Get API Keys
Retrieve all API keys associated with a Polygon address.
HTTP Request:
Delete API Key
Delete an API key used to authenticate a request.
HTTP Request:
Access Status
Check the value of cert_required
by signer address.
HTTP Request:
Get Closed Only Mode Status
Retrieve the closed-only mode flag status.
HTTP Request: