Skip to main content
POST
/
challenge
/
request
/
aptos
Request Aptos challenge
curl --request POST \
  --url https://authapi.moralis.io/challenge/request/aptos \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "domain": "defi.finance",
  "uri": "https://defi.finance/",
  "timeout": 15,
  "network": "mainnet",
  "address": "0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d",
  "publicKey": "0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d",
  "statement": "Please confirm",
  "expirationTime": "2020-01-01T00:00:00.000Z",
  "notBefore": "2020-01-01T00:00:00.000Z",
  "resources": [
    "https://docs.moralis.io/"
  ]
}
'
{
  "id": "fRyt67D3eRss3RrXa",
  "profileId": "0xbfbcfab169c67072ff418133124480fea02175f1402aaa497daa4fd09026b0e1",
  "message": "defi.finance wants you to sign in with your Aptos account:\n0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d\n\nPlease confirm\n\nURI: https://defi.finance/\nVersion: 1\nChain ID: 1\nNonce: DbU1DCTmdzR4lg3wi\nIssued At: 2022-06-12T12:15:31.290Z\nExpiration Time: 2020-01-01T00:00:00.000Z\nNot Before: 2020-01-01T00:00:00.000Z\nResources:\n- https://docs.moralis.io/"
}

Authorizations

X-API-Key
string
header
required

Body

application/json

Request Aptos challenge message.

domain
string<hostname>
required

RFC 4501 dns authority that is requesting the signing.

Example:

"defi.finance"

uri
string<uri>
required

RFC 3986 URI referring to the resource that is the subject of the signing (as in the subject of a claim).

Example:

"https://defi.finance/"

timeout
number
default:15
required

Time in seconds before the challenge is expired

Required range: 15 <= x <= 120
Example:

15

network
enum<string>
required

The network where Contract Accounts must be resolved.

Available options:
mainnet,
testnet
Example:

"mainnet"

address
string
required

Aptos address performing the signing conformant.

Example:

"0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d"

publicKey
string
required

Aptos public key performing the signing conformant.

Example:

"0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d"

statement
string

Human-readable ASCII assertion that the user will sign, and it must not contain .

Example:

"Please confirm"

expirationTime
string<date-time>

ISO 8601 datetime string that, if present, indicates when the signed authentication message is no longer valid.

Example:

"2020-01-01T00:00:00.000Z"

notBefore
string<date-time>

ISO 8601 datetime string that, if present, indicates when the signed authentication message will become valid.

Example:

"2020-01-01T00:00:00.000Z"

resources
string[]

List of information or references to information the user wishes to have resolved as part of authentication by the relying party. They are expressed as RFC 3986 URIs separated by new lines.

Example:
["https://docs.moralis.io/"]

Response

201 - application/json

The back channel challenge containing the id to store on the api and the message to be signed by the user

id
string
required

17-characters Alphanumeric string Secret Challenge ID used to identify this particular request. Is should be used at the backend of the calling service to identify the completed request.

Required string length: 8 - 64
Example:

"fRyt67D3eRss3RrXa"

profileId
string
required

Unique identifier with a length of 66 characters

Example:

"0xbfbcfab169c67072ff418133124480fea02175f1402aaa497daa4fd09026b0e1"

message
string
required

Message that needs to be signed by the end user

Example:

"defi.finance wants you to sign in with your Aptos account:\n0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d\n\nPlease confirm\n\nURI: https://defi.finance/\nVersion: 1\nChain ID: 1\nNonce: DbU1DCTmdzR4lg3wi\nIssued At: 2022-06-12T12:15:31.290Z\nExpiration Time: 2020-01-01T00:00:00.000Z\nNot Before: 2020-01-01T00:00:00.000Z\nResources:\n- https://docs.moralis.io/"