Hyphen
  • Hyphen
  • Concepts
    • Auth Methods
    • Hyphen Multi-Sig Account
      • Device Key
      • Recovery Key
      • Server Key
    • Paymaster
    • Hybrid Custody
  • Mechanism Paper
  • iOS SDK
    • Quick Start
    • Authenticating Users
    • Using Hyphen UI Kit
      • Account Management Screen
    • Sample Project
  • Android SDK
    • Quick Start
    • Authenticating Users
    • Handling 2FA / Transaction Request
    • Using Hyphen UI Kit
    • Sending Transactions
  • Flutter SDK
    • Quick Start
    • Authenticating Users
    • Using Hyphen UI Kit
    • Sending Transactions
    • Example App
  • Hybrid Custody
    • Into the Hybrid Custody
  • Without Using SDK
    • Authenticating Users
    • Handling 2FA Push
  • REST API
    • API Reference
      • Account
      • Auth
      • Device
      • Key
      • Sign
    • Swagger
Powered by GitBook
On this page

Was this helpful?

  1. REST API
  2. API Reference

Device

PreviousAuthNextKey

Last updated 1 year ago

Was this helpful?

Device Management

2FA (Two-Factor Authorization)

Get 2FA Status

get
Authorizations
Path parameters
idstringRequired
Responses
200
Ok
application/json
get
GET //device/v1/2fa/{id} HTTP/1.1
Host: api.dev.hyphen.at
Authorization: Bearer JWT
Accept: */*
200

Ok

{
  "twoFactorAuth": {
    "id": "text",
    "accountId": "text",
    "request": {
      "id": "faceb00c-cafe-babe-badd-deadbeef1234",
      "app": {
        "appId": "swirl-dev",
        "appName": "Swirl"
      },
      "userOpInfo": {
        "type": "sign-in",
        "signIn": {
          "email": "john@acme.com",
          "ip": "127.0.0.1",
          "location": "Seoul, KR"
        }
      },
      "srcDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "destDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "message": "deadbeefdeadbeefdeadbeef",
      "requestedAt": "2021-01-01T00:00:00Z"
    },
    "status": "pending",
    "extra": null,
    "result": {
      "txId": "text"
    },
    "expiresAt": "2021-01-01T00:00:00Z"
  }
}

Deny 2FA

delete

Rejects 2FA request.

Authorizations
Path parameters
idstringRequired
Responses
204Success
application/json
delete
DELETE //device/v1/2fa/{id} HTTP/1.1
Host: api.dev.hyphen.at
Authorization: Bearer JWT
Accept: */*
204Success
{
  "twoFactorAuth": {
    "id": "text",
    "accountId": "text",
    "request": {
      "id": "faceb00c-cafe-babe-badd-deadbeef1234",
      "app": {
        "appId": "swirl-dev",
        "appName": "Swirl"
      },
      "userOpInfo": {
        "type": "sign-in",
        "signIn": {
          "email": "john@acme.com",
          "ip": "127.0.0.1",
          "location": "Seoul, KR"
        }
      },
      "srcDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "destDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "message": "deadbeefdeadbeefdeadbeef",
      "requestedAt": "2021-01-01T00:00:00Z"
    },
    "status": "pending",
    "extra": null,
    "result": {
      "txId": "text"
    },
    "expiresAt": "2021-01-01T00:00:00Z"
  }
}
  • Device Management
  • GETList My Devices
  • PUTEdit device
  • 2FA (Two-Factor Authorization)
  • GETGet 2FA Status
  • PUTRe-request 2FA request
  • DELETEDeny 2FA
  • POSTApprove 2FA request

List My Devices

get
Authorizations
Responses
200
Ok
application/json
get
GET //device/v1/devices HTTP/1.1
Host: api.dev.hyphen.at
Authorization: Bearer JWT
Accept: */*
200

Ok

{
  "devices": [
    {
      "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
      "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
      "sdkVersion": "1.0.0",
      "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
      "name": "iPhone 14",
      "osName": "iOS",
      "osVersion": "16.2",
      "deviceManufacturer": "Apple",
      "deviceModel": "SM-265N",
      "lang": "en",
      "type": "mobile"
    }
  ]
}

Edit device

put
Authorizations
Path parameters
publicKeystringRequired
Body

Make all properties in T optional

sdkVersionstringOptionalExample: 1.0.0
idstringOptionalExample: deadbeef-dead-beef-cafe-deadbeefcafe
pushTokenstringOptional

Firebase Push Registration ID. Should be regularly updated if changes.

Example: bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...
namestringOptionalExample: iPhone 14
osNamestringOptionalExample: iOS
osVersionstringOptionalExample: 16.2
deviceManufacturerstringOptionalExample: Apple
deviceModelstringOptionalExample: SM-265N
langstringOptionalExample: en
Responses
200
Ok
application/json
put
PUT //device/v1/devices/{publicKey} HTTP/1.1
Host: api.dev.hyphen.at
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 244

{
  "sdkVersion": "1.0.0",
  "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
  "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
  "name": "iPhone 14",
  "osName": "iOS",
  "osVersion": "16.2",
  "deviceManufacturer": "Apple",
  "deviceModel": "SM-265N",
  "lang": "en"
}
200

Ok

{
  "device": {
    "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
    "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
    "sdkVersion": "1.0.0",
    "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
    "name": "iPhone 14",
    "osName": "iOS",
    "osVersion": "16.2",
    "deviceManufacturer": "Apple",
    "deviceModel": "SM-265N",
    "lang": "en",
    "type": "mobile"
  }
}

Re-request 2FA request

put

Updates existing 2FA request, such as requesting to the other device.

Authorizations
Path parameters
idstringRequired
Body
destDeviceIdstringRequired
Responses
200
Ok
application/json
put
PUT //device/v1/2fa/{id} HTTP/1.1
Host: api.dev.hyphen.at
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "destDeviceId": "text"
}
200

Ok

{
  "twoFactorAuth": {
    "id": "text",
    "accountId": "text",
    "request": {
      "id": "faceb00c-cafe-babe-badd-deadbeef1234",
      "app": {
        "appId": "swirl-dev",
        "appName": "Swirl"
      },
      "userOpInfo": {
        "type": "sign-in",
        "signIn": {
          "email": "john@acme.com",
          "ip": "127.0.0.1",
          "location": "Seoul, KR"
        }
      },
      "srcDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "destDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "message": "deadbeefdeadbeefdeadbeef",
      "requestedAt": "2021-01-01T00:00:00Z"
    },
    "status": "pending",
    "extra": null,
    "result": {
      "txId": "text"
    },
    "expiresAt": "2021-01-01T00:00:00Z"
  }
}

Approve 2FA request

post

Approves 2FA request. The client should sign the message from the request with the device key, and provide it to the signature field in the request.

Authorizations
Path parameters
idstringRequired
Body
txIdstringRequired

The transaction ID of the transaction that the user signed.

Example: deadbeef...deadbeef
Responses
204Success
application/json
post
POST //device/v1/2fa/{id}/approve HTTP/1.1
Host: api.dev.hyphen.at
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 30

{
  "txId": "deadbeef...deadbeef"
}
204Success
{
  "twoFactorAuth": {
    "id": "text",
    "accountId": "text",
    "request": {
      "id": "faceb00c-cafe-babe-badd-deadbeef1234",
      "app": {
        "appId": "swirl-dev",
        "appName": "Swirl"
      },
      "userOpInfo": {
        "type": "sign-in",
        "signIn": {
          "email": "john@acme.com",
          "ip": "127.0.0.1",
          "location": "Seoul, KR"
        }
      },
      "srcDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "destDevice": {
        "id": "deadbeef-dead-beef-cafe-deadbeefcafe",
        "publicKey": "faceb00ccafebabedeadbeefbadf00defaceb00ccafebabedeadbeefbadf00de",
        "sdkVersion": "1.0.0",
        "pushToken": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
        "name": "iPhone 14",
        "osName": "iOS",
        "osVersion": "16.2",
        "deviceManufacturer": "Apple",
        "deviceModel": "SM-265N",
        "lang": "en",
        "type": "mobile"
      },
      "message": "deadbeefdeadbeefdeadbeef",
      "requestedAt": "2021-01-01T00:00:00Z"
    },
    "status": "pending",
    "extra": null,
    "result": {
      "txId": "text"
    },
    "expiresAt": "2021-01-01T00:00:00Z"
  }
}