# Server API

# User

# User resource

Generic user information. By default, only public information is shared without any scopes. Verified phone numbers or email can be requested with additional scopes.

User’s public information (default)

{
  "id": "0d8c5fa3-c8a5-4c5f-8435-f35aef353f30"
}

Authenticated user with their email (user:email:read permission)

{
  ...
  "email": "user@endpass.com"
}

Authenticated user with their verified phone numbers (user:phone:read permission)

{
  ...
  "phones": [
    {
      "id": "c4d4ef1c-0d73-4a6f-aad9-7600a8fc79b8",
      "createdAt": 1557220652,
      "status": "Verified",
      "country": "7",
      "number": "7771112233",
      "main": true
    }
  ]
}
Fields Description
id (string) Resource ID
email (string) User’s email
phones (Phone) User’s verified phone numbers

# Phone

Fields Description
id (string) Resource ID
createdAt (timestamp) Creation timestamp
status (string, enumerable) Verification status
country (string) Country code
number (string) Phone number
main (boolean) Is main phone

# Show current user

Returns user information.

# HTTP Request

GET https://api.endpass.com/v1/user

# Scopes

  • user:email:read
  • user:phone:read
curl "https://api.endpass.com/v1/user"
  -H "Authorization: Bearer <access_token>"

# User's address

Returns user's address

Default response body

[
  {
    "main": false,
    "created_at": 1577454009,
    "apartmentNumber": "37",
    "streetNumber": "8327",
    "street": "W North Ave",
    "city": "Chicago",
    "stateRegion": "Melrose Park",
    "country": "USA",
    "postalCode": "postal code",
    "lat": 39.38,
    "lng": -76.69,
    "verified": true
  }
]

# User data resource

Field Description
main (boolean) Main address flag
created_at (number) Timestamp, UTC tz
apartmentNumber (string) Apartment number
streetNumber (string) Street Number
street (string) Street name
city (string) City
stateRegion (string) State region
country (string) Country
postalCode (string) PostalCode
lat (number) Latitude
lng (number) Longitude
verified (boolean) Is verified

# HTTP Request

GET https://api.endpass.com/v1/user/address

Return list of user's addresses.

# Scopes

user:address:read

# User's personal data

Returns user's personal data fields.

Default response body

{
  "id": "be954fe3-f42a-4745-8bf0-2262faef02a4",
  "firstName": "Franz",
  "lastName": "Kafka",
  "dateOfBirth": -2729635200,
  "verified": true
}

# Personal data resource

Field Description
id (string) Resource ID
firstName (string) First name
lastName (string) Last name
dateOfBirth (number) Timestamp, UTC tz
verified (boolean) Is verified

# HTTP Request

GET https://api.endpass.com/v1/user/info/personal

# Scopes

  • user:data:read

# HTTP Status Codes

  • 200
  • 204 (in case there is no record saved before)

# User's Accounts

Account resource represents all of a user’s accounts.

List of account

["0x123...", "0x456..."]

Account resource

{
  "address": "0x123..."
}

# Account resource

Fields Description
address (string) Address hash

# Show user accounts

Returns a list of user accounts that have a keystore.

# HTTP Request

GET https://api.endpass.com/v1/accounts

# Scopes

  • wallet:accounts:read
curl "https://api.endpass.com/v1/accounts"
  -H "Authorization: Bearer <access_token>"

# Last active account

Returns user last active account.

# HTTP Request

GET https://api.endpass.com/v1/accounts/active

# Scopes

  • wallet:address:read
curl "https://api.endpass.com/v1/accounts/active"
  -H "Authorization: Bearer <access_token>"

# Users's Documents

Document resource represents a user’s document.

List of documents

[
  {
    "id": "f1f80c7a-57c7-4259-8e80-d1bb09932e82",
    "createdAt": 1543336121,
    "status": "Draft",
    "documentType": "Passport",
    "description": "Custom document description",
    "imageId": "f10c347a-59x2-4259-8e80-d1bb09932z30",
    "imageHash": "D47D9147CB585F96AB6D6B34DB0D84DD0608E0F8BC6F7604E50373347E276272",
    "mimeType": "image/jpeg",
    "backImageId": "h53c347a-59x2-4259-8e80-d1bb09932z30",
    "backImageHash": "C54D9147CB585F96AB6D6B34DB0D84DD0608E0F8BC6F7604E50373347E276272",
    "backMimeType": "image/png",
    "firstName": "Test",
    "lastName": "User",
    "number": "47313892501",
    "dateOfBirth": 1543323121,
    "dateOfIssue": 1543336122,
    "dateOfExpiry": 1543336123,
    "issuingCountry": "Country",
    "issuingAuthority": "Authority",
    "issuingPlace": "Place",
    "address": "Address"
  }
]

Document's public information (default)

{
  "id": "f1f80c7a-57c7-4259-8e80-d1bb09932e82",
  "createdAt": 1543336121
}

Document's status

Related scopes:

  • documents:passport:status:read
  • documents:proof_address:status:read
  • documents:driver_license:status:read
  • documents:id_card:status:read
  • documents:selfie:status:read
{
  ...
  "status": "Draft"
}

Document's data

Related scopes:

  • documents:passport:data:read
  • documents:proof_address:data:read
  • documents:driver_license:data:read
  • documents:id_card:data:read
{
  ...
  "documentType": "Passport",
  "description": "Custom document description",
  "imageId": "f10c347a-59x2-4259-8e80-d1bb09932z30",
  "imageHash": "D47D9147CB585F96AB6D6B34DB0D84DD0608E0F8BC6F7604E50373347E276272",
  "mimeType": "image/jpeg",
  "backImageId": "h53c347a-59x2-4259-8e80-d1bb09932z30",
  "backImageHash": "C54D9147CB585F96AB6D6B34DB0D84DD0608E0F8BC6F7604E50373347E276272",
  "backMimeType": "image/png",
  "firstName": "Test",
  "lastName": "User",
  "number": "47313892501",
  "dateOfBirth": 1543323121,
  "dateOfIssue": 1543336122,
  "dateOfExpiry": 1543336123,
  "issuingCountry": "Country",
  "issuingAuthority": "Authority",
  "issuingPlace": "Place",
  "address": "Address"
}

# Document resource

Fields Description
id (string) Resource ID
createdAt (timestamp) Creation timestamp
status (string, enumerable) Document current status
documentType (string, enumerable) Document type
description (string) Description
imageId (string) Front File ID
imageHash (string) Front File Hash
mimeType (string) Front File Content Type
backImageId (string) Back File ID
backImageHash (string) Back File Hash
backMimeType (string) Back File Content Type
firstName (string) First name
lastName (string) Last name
number (string) Document number
dateOfBirth (timestamp) Date of birth
dateOfIssue (timestamp) Document issue date
dateOfExpiry (timestamp) Document expiration date
issuingCountry (string) Document issuing country
issuingAuthority (string) Document issuing authority
issuingPlace (string) Document issuing place
address (string) Address

# Document types

Key Description
Passport Passport
DriverLicense Driver license
IdCard Identity card
ProofOfAddress Proof of address
Selfie Selfie video

# Document statuses

Key Description
Draft Default status, not submitted to verification service
Recognition Submitted to verification service, waiting result
PendingReview Document queued to manual verification
NotReadable Document not readable, need update document file (image)
NotVerified Received failed result from the verification service
Verified Document verified

# Show user documents

Returns all user documents.

# HTTP Request

GET https://api.endpass.com/v1/documents

# Scopes

  • documents:passport:status:read
  • documents:proof_address:status:read
  • documents:driver_license:status:read
  • documents:id_card:status:read
  • documents:selfie:status:read
curl "https://api.endpass.com/v1/documents"
  -H "Authorization: Bearer <access_token>"

# Show document

Returns document by ID.

# HTTP Request

GET https://api.endpass.com/v1/documents/{ID}

# Scopes

  • documents:passport:data:read
  • documents:proof_address:data:read
  • documents:driver_license:data:read
  • documents:id_card:data:read
curl "https://api.endpass.com/v1/documents/{ID}"
  -H "Authorization: Bearer <access_token>"

# Show document's front file

Returns the document's front file content (jpeg, pdf) into binary stream.

If there is no uploaded file returns 204.

# HTTP Request

GET https://api.endpass.com/v1/documents/{ID}/front/file

# Scopes

  • documents:passport:image:read
  • documents:proof_address:image:read
  • documents:driver_license:image:read
  • documents:id_card:image:read
curl "https://api.endpass.com/v1/documents/{ID}/front/file"
  -H "Authorization: Bearer <access_token>"

# Show document's back file

Returns the document's back file content (jpeg, pdf) into binary stream.

If there is no uploaded file returns 204.

# HTTP Request

GET https://api.endpass.com/v1/documents/{ID}/back/file

# Scopes

  • documents:passport:image:read
  • documents:proof_address:image:read
  • documents:driver_license:image:read
  • documents:id_card:image:read
curl "https://api.endpass.com/v1/documents/{ID}/back/file"
  -H "Authorization: Bearer <access_token>"

# Scopes list

# Scopes resource

Returns scopes granted by user for particular application.

{
  "scopes": [
    "user:address:read",
    "user:phone:read",
    "user:email:read",
    "user:data:read",
    "documents:passport:status:read",
    "documents:proof_address:data:read",
    "documents:driver_license:image:read",
    "wallet:address:read",
    "wallet:accounts:read"
  ]
}
Fields Description
scopes (string, array) Granted scopes list

# HTTP Request

GET https://api.endpass.com/v1/scopes

curl "https://api.endpass.com/v1/scopes"
  -H "Authorization: Bearer <access_token>"

# Server Api Errors

The Endpass API uses the following error codes:

Error Code Meaning
400 Bad Request -- Missing parameter or invalid request.
401 Unauthorized -- Invalid auth (invalid, expired or revoked Oauth token).
402 Payment required -- Payment failure or pending.
403 Forbidden -- User hasn’t authenticated necessary scope.
404 Not Found -- Resource not found.
405 Method Not Allowed -- Invalid method or route.
423 Locked -- User has been banned.
429 Too Many Requests -- Rate limit exceeded.
500 Internal Server Error -- Internal server error.