REST API Usage and Error Guide

This is a guide for Upbit REST API usage covering requests, authentication, error handling, and gzip support.

Endpoint

Upbit Singapore: https://sg-api.upbit.com

Upbit Indonesia: https://id-api.upbit.com

Upbit Thailand: https://th-api.upbit.com

Open API Beta Service in Upbit Thailand
The API endpoint for Thailand is currently in beta and may be subject to change. Any updates to the endpoint will be announced in advance via official announcements, so please keep this in mind when using the service.
The Upbit Open API supports only TLS version 1.2 or higher to ensure the security of your information. Versions below TLS 1.2 are no longer supported, so please upgrade to at least TLS 1.2.
- TLS 1.2 (Minimum supported version)
- TLS 1.3 (Recommended version)


Content Type

Upbit REST API supports the application/json content type. In particular, for POST requests, the request body must be in JSON format, and the following header should be included:

Content-Type: application/json; charset=utf-8

Form-based POST requests are no longer supported from March 1, 2022.
Due to the end of Form support, POST requests sent using URL-encoded Form data are no longer guaranteed to work properly. Please ensure that the request body is sent strictly in JSON format.

Authentication

For authenticated Exchange API requests, you must include a JWT token generated according to the Authentication guide in the Authorization header. Upbit REST API supports Bearer authentication, and the header should be set as follows:

Authorization: Bearer eyJhb...d8sTw


Rate Limits

Please refer to the Rate Limits document for the REST API request rate limit policy.


Response Status Codes and Error Information

The following table lists the main HTTP status codes returned by the Upbit REST API and their meanings.

HTTP Status CodeDescription
200 OKThe request was processed successfully.
201 CreatedThe requested resource was created successfully.
400 Bad RequestThe request format or parameters are invalid.
401 UnauthorizedAPI authentication failed.
403 ForbiddenThe request is not permitted due to API Key permissions or security restrictions.
404 Not FoundThe requested resource could not be found.
418 I'm a teapotRequests have been restricted due to repeated excessive requests.
429 Too Many RequestsThe API rate limit has been exceeded.
500 Internal Server ErrorThe request could not be processed due to an internal server error.

400 Bad Request

This error occurs when the request format or parameters are invalid.

Error CodeReason and How to Resolve
create_ask_errorReason: The sell order request contains invalid parameters or values.
How to Resolve: Check the required parameters and values for the selected order type. This error may occur when an unsupported combination of order parameters is submitted.
create_bid_errorReason: The buy order request contains invalid parameters or values.
How to Resolve: Check the required parameters and values for the selected order type. This error may occur when an unsupported combination of order parameters is submitted.
insufficient_funds_askReason: Insufficient available balance to place a sell order.
How to Resolve: Check the available asset balance before submitting the order.
insufficient_funds_bidReason: Insufficient available balance to place a buy order.
How to Resolve: Check the available balance before submitting the order.
under_min_total_askReason: The sell order amount is below the minimum required amount.
How to Resolve: Check the minimum order amount for the trading pair and submit the order again.
under_min_total_bidReason: The buy order amount is below the minimum required amount.
How to Resolve: Check the minimum order amount for the trading pair and submit the order again.
withdraw_address_not_registeredReason: The withdrawal address is not registered as an allowed withdrawal address.
How to Resolve: Make sure the address is registered in the withdrawal address allowlist.
validation_errorReason: The API request format is invalid.
How to Resolve: Check for missing required parameters and verify the request data format.
invalid_parameterReason: One or more request parameters are invalid.
How to Resolve: Check the parameter format, allowed values, and valid ranges.
invalid_post_onlyReason: An SMP mode that is incompatible with post_only was specified.
How to Resolve: For orders with time_in_force=post_only, omit smp_type or set it to none. The cancel_maker, cancel_taker, and reduce modes cannot be used with post_only.
duplicated_identifierReason: The specified identifier has already been used.
How to Resolve: Submit the request with a new identifier that has not been used for a previous order.

401 Unauthorized

This error occurs when authentication using a JWT token, API Key, or authorized IP address fails.

Error CodeReason and How to Resolve
invalid_query_payloadReason: The JWT payload is invalid.
How to Resolve: Refer to the Authentication guide and verify that the JWT payload and signature are generated correctly.
jwt_verificationReason: JWT verification failed.
How to Resolve: Check the JWT generation process and ensure that the correct Secret Key is used to generate the signature.
expired_access_keyReason: The API Key has expired.
How to Resolve: Issue a new API Key and use it for subsequent requests.
nonce_usedReason: The specified nonce value has already been used.
How to Resolve: Generate a unique nonce value for each JWT.
no_authorization_ipReason: The request was sent from an IP address that is not registered with the API Key.
How to Resolve: Verify that the requesting IP address is included in the API Key's authorized IP address list.
no_authorization_tokenReason: The authentication token is missing from the request.
How to Resolve: Include a valid authentication token in the Authorization header using the Bearer {JWT} format.

403 Forbidden

This error occurs when a request is not permitted due to API Key permissions or Open API security restrictions.

Error CodeReason and How to Resolve
out_of_scopeReason: The API Key does not have the required permissions to access the requested API.
How to Resolve: Verify that the required permissions are enabled for the API Key. You can check and manage permissions on the API Key Management page for the corresponding Upbit service.

Depending on the API domain, the out_of_scope error may be returned with either HTTP 401 Unauthorized or 403 Forbidden.

When handling API errors, check the error.name field in the response body in addition to the HTTP status code.

404 Not Found

This error occurs when the requested resource does not exist or cannot be retrieved.

Error CodeReason and How to Resolve
—Reason: The requested order, withdrawal, deposit, or trade could not be found.
How to Resolve: Verify the UUID, identifier, or query parameters used in the request.

418 I'm a teapot

This error occurs when requests are restricted due to repeated excessive API calls.

Error CodeReason and How to Resolve
—Reason: Requests have been temporarily restricted due to excessive API calls.
How to Resolve: Stop sending additional requests and adjust the request frequency to comply with the Rate Limits policy.

429 Too Many Requests

This error occurs when the permitted API request rate limit is exceeded.

Error CodeReason and How to Resolve
—Reason: The API request rate limit has been exceeded.
How to Resolve: Refer to the Rate Limits guide and adjust the request frequency and number of API calls.

500 Internal Server Error

This error occurs when the server cannot process a request due to an internal error.

Error CodeReason and How to Resolve
—Reason: The request could not be processed due to service maintenance or a temporary system error.
How to Resolve: Try again after a short interval. For order requests, verify the order status before resubmitting to avoid unintended duplicate orders. If the error persists, check the request timestamp and error response details.

Error Response Format

When an error occurs, the API returns a JSON response containing the following fields:

  • error.name: The error code.
  • error.message: A message describing the error.

The Quotation API returns error.name as an integer, while the Exchange API returns it as a string.

For API-specific error examples, refer to the response example section at the bottom right of each API Reference page.

Quotation API Error Response

{
  "error": {
    "name": 400,
    "message": "ERROR_MESSAGE"
  }
}

Exchange API Error Response

{
  "error": {
    "name": "ERROR_CODE",
    "message": "ERROR_MESSAGE"
  }
}

Encoding

When sending a GET or DELETE API request that includes query parameters, all query parameters must be URL-encoded before sending the request. If the request is not properly URL-encoded, the server will return a 400 Invalid parameter Response. However, if an array-type parameter in the Exchange API includes [] in its name, the "[" and "]" characters must be excluded from URL encoding.

What is the URL Encoding?
URL encoding is an encoding method that converts characters that cannot be included in a URL within a communication protocol into transmittable characters. Target characters, including special characters, are converted during encoding into a string consisting of a percent sign (%) followed by two hexadecimal digits.

(Example) : is encoded to %3A and + is encoded to %2B.

gzip Response Support

You can receive REST API responses in gzip-compressed format by specifying the Accept-Encoding: gzip header in your request. Using gzip encoding reduces the size of data transferred between the server and client, which helps save traffic costs and decrease response times. gzip encoding is only supported by Quotation APIs. To enable gzip, set the following header in your request:

Accept-Encoding: gzip


API Reference Example Code Guide

To make API usage easier, example code snippets are provided at the top right of each API Reference page. Examples are available for four environments/languages: Shell (cURL), Python, Java, and Node.js. For Java and Node.js, examples are provided for multiple popular HTTP client libraries, which you can switch between using the dropdown arrow above the code block:

  • Java - AsyncHttp, java.net.http, OkHttp, Unirest
  • Node.js - Axios, fetch, https

You can input sample or custom values for each request parameter and body field in the documentation. The example code will update in real-time based on your inputs.

Note: For Exchange APIs (such as trading or asset management), the authentication token part is not included in the example code. Please refer to the Authentication documentation for JWT token generation examples. You must implement token creation and include the resulting token in your requests when integrating with these APIs.