Resources

Error code catalog

Every public error code in one table.

Branch on code

Messages can improve without a version change. The code is the stable contract.

43 codes

HTTP, Code, Retry, Meaning and fix table
HTTPCodeRetryMeaning and fix
400INVALID_INPUTNoGeneric schema or input validation failure. Fix: Read error.message, correct the value it names and send the request again. On a seat enquiry it can also mean the train does not serve that journey: check that it stops at both stations.
400VALIDATION_ERRORNoA request field is missing or invalid. The message names it, and error.details[].field names the parameter (date, items[2].date, match, callback_url). Fix: Correct each field that error.details[].field names (for example date or items[2].date) and send the request again. It is not counted.
400INVALID_STATION_CODENoStation code format or reference validation failed. Fix: Send a station code of 1 to 6 letters or digits, such as NDLS, or J for Jalna. Look a code up with GET /stations/search.
400INVALID_TRAIN_NUMBERNoTrain number format validation failed. Fix: Send the train number as 4 to 6 digits or capital letters, such as 12951. Find a number with GET /trains/search.
400INVALID_DATENoDate format or allowed window validation failed. Fix: Send the date as YYYY-MM-DD in India time (IST), inside the window the endpoint's page gives.
400INVALID_QUOTANoUnknown quota code. Fix: Use a quota code the endpoint's page lists, such as GN or TQ.
400INVALID_CLASS_CODENoUnknown class code. Fix: Use a class code the endpoint's page lists, such as SL, 3A or 2A.
401MISSING_API_KEYNoNo key in X-RailCore-Key, Authorization: Bearer or X-Api-Key, or the key is too short. Fix: Send your key in X-RailCore-Key (or Authorization: Bearer, or X-Api-Key). Keys are at least 20 characters long; create one under API keys in the developer dashboard.
401AMBIGUOUS_API_KEYNoMore than one key header was sent, with different keys. Send the key in one header. Fix: Send the key in one header only, or make every key header carry the same key.
401INVALID_API_KEYNoThe credential is unknown or revoked. Fix: Check the key for a typo or a missing part. If it was revoked or rotated, use the current key from the developer dashboard.
401API_KEY_DISABLEDNoThe credential was disabled by policy or an operator. Fix: Use another active key from the developer dashboard, or contact support to find out why this one was disabled.
401API_KEY_EXPIREDNoCredential expiry has passed. Fix: Create or rotate a key in the developer dashboard and update your configuration with the new one.
401SIGNATURE_INVALIDNoHMAC signature missing or not verified. Growth, Scale and Enterprise keys must sign every request; a key with no signing secret must be rotated. Fix: Rebuild the signature: method, path with /v1, the canonical query (sorted by key then value), the SHA-256 hex of the exact body bytes sent, the timestamp and the nonce, one per line; HMAC-SHA256 with your signing secret, base64. A key with no signing secret must be rotated to get one.
401TIMESTAMP_EXPIREDNoSigned timestamp is outside the five-minute window. Fix: Send the current Unix time in seconds in X-RailCore-Timestamp and keep your server clock in sync (NTP). It must be within five minutes of RailCore's clock.
401NONCE_REUSEDNoThe signed nonce already appeared in the replay window. Fix: Generate a new random nonce of 16 to 128 characters for every request, retries included.
401PLAYGROUND_TOKEN_EXPIREDNoA docs playground token has expired or is not valid. They last 15 minutes; the playground gets a new one by itself. Fix: Get a new playground token: the docs console does this by itself, or sign in again. Tokens last 15 minutes.
403IP_NOT_ALLOWEDNoCaller IP is not in the key allowlist. Fix: Send requests from an address on the key's IP allowlist, or add this address to the allowlist in the developer dashboard.
403SCOPE_MISSINGNoThe key lacks the operation scope. Fix: Use a key whose scopes include the scope on this endpoint's page, or create a key with that scope.
403PLAN_INACTIVENoThe subscription is paused, past due, or cancelled. Fix: Renew, resume or reactivate the subscription in the developer dashboard's billing section. Requests work again as soon as it is active.
403PLAN_ENDPOINT_DISABLEDNoThe current plan does not include the endpoint. Fix: Move to a plan that includes this endpoint (see railcore.tech/pricing), or use an endpoint your plan includes.
402CREDITS_EXHAUSTEDNoThe month's requests are used up, or too few are left for this request. Nothing is fetched. Fix: Wait for your monthly requests to renew, or upgrade your plan. Check X-RailCore-Credits-Remaining before large requests such as seat batches.
429RATE_LIMITEDYesThe account's per-minute budget, or a Free account's daily budget, is used up. Every key on the account shares it. Honor Retry-After. Fix: Wait for the seconds in Retry-After, then retry with jitter. Limits belong to the account and are shared by all of its keys: spread requests out, or move to a plan with a higher limit.
429JOB_LIMIT_EXCEEDEDYesFive async jobs are already active on the account, across all of its keys. Fix: Wait for an active job to finish, or cancel one with DELETE /jobs/{job_id}, then submit again. An account can run five jobs at once.
404TRAIN_NOT_FOUNDNoNo train has that number, on any /trains/{train_number}/ path but /live. The message names it: Train 99999 not found. Check the train number. Fix: Check the train number. Find the right one by name or number with GET /trains/search.
404STATION_NOT_FOUNDNoA station code or name could not be resolved. The message names it: Station ZZZZ not found. Check the station code. Fix: Check the station code. Find it by name with GET /stations/search.
404COACH_POSITION_NOT_FOUNDNoOn /trains/{train_number}/coach-position: the train exists, but no source RailCore reads publishes its coach composition. The message names it: No coach composition is published for train 12345. Not counted. Fix: No source publishes this train's coach composition. Retrying soon will not help; try again on another day.
404NO_TRAINS_FOUNDNoNo train matches the route and date. Fix: Try another date, nearby stations, or match=city to include every station in both cities.
404NOT_FOUNDNoNothing matches the request: a train with no run on the date asked for on live train status, no fare for a fare estimate, or a path the API does not have. Fix: Nothing matches the request. Check the identifiers and the date (a train may not run that day), then ask again.
404JOB_NOT_FOUNDNoThe async job does not exist or expired. Fix: Check the job ID. Jobs and their results expire, so submit the job again if it is gone.
409CHART_NOT_PREPAREDYesThe chart is not ready yet. Fix: Ask again later: the chart is prepared a few hours before the train leaves.
422TATKAL_NOT_OPENNoTatkal booking has not opened for the journey yet. error.opens_at (IST) says when, if known. Not counted. Fix: Ask again after the time in error.opens_at (IST). Tatkal opens the day before the train leaves its origin, at 10:00 for AC classes and 11:00 for the rest.
422QUOTA_NOT_AVAILABLENoThe train does not offer that quota in that class for the journey. Not counted. Fix: Choose another quota or class: the train does not offer this quota in this class.
422QUOTA_NOT_SUPPORTEDNoSeat availability is not offered for that quota on any train: it answers GN, TQ, SS and LD only. Premium Tatkal (PT), HP, DP, HO, YU and FT can be checked on IRCTC. RailCore refuses it before the seat provider is asked. Not counted. Fix: Use GN, TQ, SS or LD. Other quotas, Premium Tatkal included, cannot be checked through RailCore; check them on IRCTC.
422CLASS_NOT_AVAILABLENoThe train does not carry that class. error.message lists the classes it does. Not counted. Fix: Choose one of the classes the message lists for this train.
422TRAIN_NOT_RUNNINGNoThe train does not leave the boarding station on that date. error.message lists the days it does. Not counted. Fix: Choose one of the days the message lists, or check the boarding station.
422BOOKING_NOT_OPENNoThe date has not opened for booking: reservations open 60 days before the journey, at 8:00 AM in India. RailCore refuses it before the seat provider is asked. error.message names the day it opens. Not counted. Fix: Choose a date inside the booking window: reservations open 60 days before the journey, at 08:00 IST.
409JOB_ALREADY_FINISHEDNoThe job is already terminal and cannot be cancelled. Fix: There is nothing to cancel. Read the job's result with GET /jobs/{job_id} instead.
410API_VERSION_SUNSETNoThe requested API major has reached its announced sunset date. Migrate to a supported version. Fix: Move to a supported API version. The changelog names the current one.
410ENDPOINT_RETIREDNoThe endpoint no longer answers API keys. The Link header and error.details name the endpoint to use instead. Fix: Use the endpoint the Link header and error.details name. For live train status that is GET /trains/{train_number}/live.
503UPSTREAM_UNAVAILABLEYesEvery live-data route for the request failed. Sent with Retry-After; not counted. Fix: Wait for the seconds in Retry-After, then retry with exponential backoff and jitter (about 500 ms, 1 s, 2 s, 4 s) and stop after five attempts. The request is not counted.
503UPSTREAM_TIMEOUTYesThe live-data source ran past its deadline. Sent with Retry-After; not counted. Fix: Wait for the seconds in Retry-After, then retry with exponential backoff and jitter (about 500 ms, 1 s, 2 s, 4 s) and stop after five attempts. The request is not counted.
500INTERNALYesUnexpected server error. Fix: Retry with backoff. If it keeps happening, contact support with the X-RailCore-Request-ID.
503METERING_UNAVAILABLEYesThe request could not be counted, so the data was withheld. Fix: Retry with backoff. The request was not counted and no data was sent.

Last updated