<p>Numerical value similar to HTTP status. Contains information on the type of error that occurred: for example, a data input error, privacy error, or server error. This is a required parameter.</p>
<p>A string literal in the form of <code>/[A-Z_0-9]+/</code>, which summarizes the problem. For example, <code>AUTH_KEY_UNREGISTERED</code>. This is an optional parameter.</p>
<p>A full machine-readable JSON list of RPC errors that can be returned by all methods in the API can be found <ahref="/file/464001173/109f8/k9gTkjfzNHs.87735.json/de2c1dc08a54bde597">here »</a>, what follows is a description of its fields: </p>
<li><code>errors</code> - All error messages and codes for each method (object).<ul>
<li>Keys: Error codes as strings (numeric strings)</li>
<li>Values: All error messages for each method (object)<ul>
<li>Keys: Error messages (string)</li>
<li>Values: An array of methods which may emit this error (array of strings)</li>
</ul>
</li>
</ul>
</li>
<li><code>descriptions</code> - Descriptions for every error mentioned in <code>errors</code> (and a few other errors not related to a specific method)<ul>
<li>Keys: Error messages</li>
<li>Values: Error descriptions</li>
</ul>
</li>
<li><code>user_only</code> - A list of methods that can only be used by users, <strong>not</strong> bots.</li>
</ul>
<p>Error messages and error descriptions may contain <code>printf</code> placeholders in key positions, for now only <code>%d</code> is used to map durations contained in error messages to error descriptions.</p>
<p>Example:</p>
<pre><codeclass="language-json">{
"errors": {
"420": {
"2FA_CONFIRM_WAIT_%d": [
"account.deleteAccount"
],
"SLOWMODE_WAIT_%d": [
"messages.forwardMessages",
"messages.sendInlineBotResult",
"messages.sendMedia",
"messages.sendMessage",
"messages.sendMultiMedia"
]
}
},
"descriptions": {
"2FA_CONFIRM_WAIT_%d": "Since this account is active and protected by a 2FA password, we will delete it in 1 week for security purposes. You can cancel this process at any time, you'll be able to reset your account in %d seconds.",
"SLOWMODE_WAIT_%d": "Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat.",
"FLOOD_WAIT_%d": "Please wait %d seconds before repeating the action."
<p>The request must be repeated, but directed to a different data center.</p>
<h4><aclass="anchor"href="#examples-of-errors"id="examples-of-errors"name="examples-of-errors"><iclass="anchor-icon"></i></a>Examples of Errors:</h4>
<ul>
<li>FILE_MIGRATE_X: the file to be accessed is currently stored in a different data center.</li>
<li>PHONE_MIGRATE_X: the phone number a user is trying to use for authorization is associated with a different data center.</li>
<li>NETWORK_MIGRATE_X: the source IP address is associated with a different data center (for registration)</li>
<li>USER_MIGRATE_X: the user whose identity is being used to execute queries is associated with a different data center (for registration)</li>
</ul>
<p>In all these cases, the error description's string literal contains the number of the data center (instead of the X) to which the repeated query must be sent.
<ahref="/api/datacenter">More information about redirects between data centers »</a></p>
<p>The query contains errors. In the event that a request was created using a form and contains user generated data, the user should be notified that the data must be corrected before the query is repeated.</p>
<h4><aclass="anchor"href="#examples-of-errors"id="examples-of-errors"name="examples-of-errors"><iclass="anchor-icon"></i></a>Examples of Errors:</h4>
<ul>
<li>FIRSTNAME_INVALID: The first name is invalid</li>
<li>LASTNAME_INVALID: The last name is invalid</li>
<li>PHONE_NUMBER_INVALID: The phone number is invalid</li>
<li>PHONE_CODE_HASH_EMPTY: phone_code_hash is missing</li>
<li>PHONE_CODE_EMPTY: phone_code is missing</li>
<li>PHONE_CODE_EXPIRED: The confirmation code has expired</li>
<li>API_ID_INVALID: The api_id/api_hash combination is invalid</li>
<li>PHONE_NUMBER_OCCUPIED: The phone number is already in use</li>
<li>PHONE_NUMBER_UNOCCUPIED: The phone number is not yet being used</li>
<li>USERS_TOO_FEW: Not enough users (to create a chat, for example)</li>
<li>USERS_TOO_MUCH: The maximum number of users has been exceeded (to create a chat, for example)</li>
<li>TYPE_CONSTRUCTOR_INVALID: The type constructor is invalid</li>
<li>FILE_PART_INVALID: The file part number is invalid</li>
<li>FILE_PARTS_INVALID: The number of file parts is invalid</li>
<p>Similar to <ahref="#400-bad-request">400 BAD_REQUEST</a>, but the app must display the error to the user a bit differently.<br>
Do not display any visible error to the user when receiving the <code>rpc_error</code> constructor: instead, wait for an <ahref="/constructor/updateServiceNotification">updateServiceNotification</a> update, and handle it as usual.<br>
Basically, an <ahref="/constructor/updateServiceNotification">updateServiceNotification</a><code>popup</code> update will be emitted independently (ie NOT as an <ahref="/type/Updates">Updates</a> constructor inside <code>rpc_result</code> but as a normal update) immediately after emission of a 406 <code>rpc_error</code>: the update will contain the actual localized error message to show to the user with a UI popup. </p>
<p>An exception to this is the <code>AUTH_KEY_DUPLICATED</code> error, which is only emitted if any of the non-media DC detects that an authorized session is sending requests in parallel from two separate TCP connections, from the same or different IP addresses.<br>
Note that parallel connections are still allowed and actually recommended for media DCs.<br>
Also note that by session we mean a logged-in session identified by an <ahref="/constructor/authorization">authorization</a> constructor, fetchable using <ahref="/method/account.getAuthorizations">account.getAuthorizations</a>, not an MTProto session. </p>
<p>If the client receives an <code>AUTH_KEY_DUPLICATED</code> error, the session is already invalidated by the server and the user must generate a new auth key and login again. </p>
<p>The maximum allowed number of attempts to invoke the given method with the given input parameters has been exceeded. For example, in an attempt to request a large number of text messages (SMS) for the same phone number.</p>
<p>An internal server error occurred while a request was being processed; for example, there was a disruption while accessing a database or file storage.</p>
<p>If a client receives a 500 error, or you believe this error should not have occurred, please collect as much information as possible about the query and error and send it to the developers.</p>
<p>If a server returns an error with a code other than the ones listed above, it may be considered the same as a 500 error and treated as an <ahref="#500-internal">internal server error</a>.</p></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.