ID Classification API

Use Attestr AI / ML model for instant classification and recognition of identity document images.

Image Constraints

Following images constraints are enforced for better accuracy of classification algorithm.

  • Maximum allowed image size is 10 MB.
  • Minimum image dimensions are 200 x 200 pixels.
  • Only JPEG and PNG images are supported.

API Details

Request

TypeURL
Posthttps://api.attestr.com/api/{version}/public/xtract/classify

Request Body Parameters

TypeNameDescriptionOptional (Default)Min VersionMax Version
StringsrcMedia document IDRequiredv1
Stringlabellabel to identify. Following labels are supported. UIDAI - For Aadhaar document PAN - For PAN card PP - For passportRequiredv1
NumberthresholdThreshold value. Classification is considered valid for the input label if output confidence is more than specified threshold value. Allowed values are float number 0.1 to 1.0 with 1 digit precision after decimal.Optionalv1

Request Header Parameters

TypeNameValue / DescriptionOptionalMin VersionMax Version
StringContent-Typeapplication/jsonRequiredv1
StringAuthorizationBasic {authToken}Requiredv1

If you do not have the authentication token, please refer to Register App to generate one.

Sample Request

JSON
Copy

Response

Http Status Code 200

KeyDescriptionTypeMin VersionMax Version
validBoolean to check if the input media image matches the specified input label. False if the label does not match.Booleanv1
confidenceConfidence outcome from AI model while predicting the image type, specifies how likely the image matches the input label.Numberv1
labelSame as input labelStringv1
suggestedLabelThe suggested label for the input media document, if the input label does not match. The possible values are UIDAI, PAN, PP, OTHER.Stringv1
suggestedLabelConfidenceConfidence level for the suggested label if availableNumberv1

Sample Response

Valid Match

JSON
Copy

Invalid Match

JSON
Copy

Error Response

ParameterTypeDescription
codeNumberUnique error codes for different errors. Always available.
messageStringError message describing the error. Always Available.
detailsStringDetail error message. Available only for certain types of errors.

Error Codes

HTTP StatusError CodeError Message
4004001Malformed data or missing required parameter values
4004005Operation could not be performed due to low credits balance
4014016Invalid client authorization
4034031Unauthorized access
4034035Requested service is not provisioned for your account
4034039Client's IP address is not whitelisted
4294291Maximum account rate limit exceeded
4294292Maximum API rate limit exceeded
4294293Maximum account daily limit exceeded
4294294Maximum API daily limit exceeded
5005001Request could not be processed

Sample Error Response

JSON
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard