Skip to content
SwapWalletDocs
فارسیGet an API key

API keys

Every request to the Wallet API acts on your own SwapWallet account and is authenticated with your personal API key. Create the key in the app under Profile → API key → Create a new key. It starts with apikey-.

Send the key in the Authorization header of every request, as a bearer token:

Authorization: Bearer apikey-…

The key is built for programs: requests made with it skip the interactive checks the app asks for, such as SMS, email or Google Authenticator codes. Replacing the key in the app (Profile → API key → Replace with a new key) stops the old one at once.

If you need a key limited to certain IP addresses or with narrower permissions, contact SwapWallet support.

The key can trade and withdraw from your account without any further confirmation. Keep it on your server, in an environment variable or a secrets store, never in client code or a repository. If it leaks, replace it in the app right away.

Check an API key

GET/v1/utils/authentication/check

Confirms that the key in the Authorization header is valid and active. Call it once after setting up your integration, or as a light health check before a batch of requests. It has no other effect.

Parameters

No parameters.

Returns

Returns {"status": "OK"} when the key is valid.

Errors

  • 401API_KEY_AUTHENTICATION_FAILED

    The key doesn’t exist or was replaced.

  • 401INVALID_AUTH_TOKEN

    The header isn’t in the form Bearer apikey-….

  • 401

    The Authorization header is missing.

  • 400USER_ACCOUNT_SUSPENDED

    The account is suspended.

  • 400PIN_CODE_REQUIRED

    The account has an app PIN code, and the request carries no valid PIN token (X-Pincode-Token).

GET/v1/utils/authentication/check
curl https://swapwallet.app/api/v1/utils/authentication/check \
  -H "Authorization: Bearer $SWAPWALLET_API_KEY"
Response
{
  "status": "OK"
}