Unlock Protocol Users API
The Users API from Unlock Protocol — 8 operation(s) for users.
The Users API from Unlock Protocol — 8 operation(s) for users.
openapi: 3.0.0
info:
title: Unlock Locksmith Applications Users API
version: '2'
description: Locksmith provides backend functionality for enabling ticketing, metadata storage, and notification hooks.
license:
name: MIT
servers:
- url: https://locksmith.unlock-protocol.com
description: Production Server
- url: https://staging-locksmith.unlock-protocol.com
description: Staging Server
tags:
- name: Users
paths:
/v2/api/users/{emailAddress}/{selectedProvider}/waas:
post:
operationId: getWaasToken
description: Gets Coinbase WAAS token for user by email and selected provider.
parameters:
- name: captcha
in: header
required: true
description: Recaptcha value to pass.
schema:
type: string
- name: emailAddress
in: path
required: true
schema:
type: string
- name: selectedProvider
in: path
required: true
schema:
type: string
requestBody:
required: true
description: JSON object containing sign in token
content:
application/json:
schema:
type: object
properties:
token:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
properties:
token:
type: string
400:
$ref: '#/components/responses/400.BadRequest'
401:
$ref: '#/components/responses/401.NotAuthenticated'
404:
$ref: '#/components/responses/404.NotFound'
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
/v2/api/users/{emailAddress}/existNextAuth:
get:
operationId: getUserAccountType
description: Gets User account type by email.
parameters:
- name: emailAddress
in: path
required: true
schema:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
properties:
userAccountType:
type: array
items:
type: string
enum:
- UNLOCK_ACCOUNT
- GOOGLE_ACCOUNT
- PASSKEY_ACCOUNT
- EMAIL_CODE
400:
$ref: '#/components/responses/400.BadRequest'
404:
$ref: '#/components/responses/404.NotFound'
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
/v2/api/users/{emailAddress}/send-verification-code:
get:
operationId: sendVerificationCode
description: Sends a verification code to the user's email if the current code is expired or does not exist.
parameters:
- name: captcha
in: header
required: true
description: Recaptcha value to pass.
schema:
type: string
- name: emailAddress
in: path
required: true
schema:
type: string
responses:
200:
description: Email code sent successfully.
content:
application/json:
schema:
type: object
properties:
message:
type: string
400:
$ref: '#/components/responses/400.BadRequest'
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
/v2/api/users/{emailAddress}/verify-email-code:
post:
operationId: verifyEmailCode
description: Verifies the email code sent to the users email address.
parameters:
- name: emailAddress
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
code:
type: string
responses:
200:
description: Verification successful.
content:
application/json:
schema:
type: object
properties:
message:
type: string
token:
type: string
400:
description: Missing parameters or invalid/expired verification code.
content:
application/json:
schema:
type: object
properties:
message:
type: string
404:
description: Verification code not found.
content:
application/json:
schema:
type: object
properties:
message:
type: string
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
/users/{emailAddress}/passwordEncryptedPrivateKey:
put:
operationId: updateUserEncryptedPrivateKey
security:
- User: []
description: Updates a user's private key, using their email address as key. In the case of failure a rejected promise is returned to the caller.
parameters:
- name: emailAddress
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
user:
type: string
token:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
properties:
emailAddress:
type: string
user:
type: string
400:
$ref: '#/components/responses/400.BadRequest'
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
/users/{emailAddress}/privatekey:
get:
operationId: getUserPrivateKey
security:
- User: []
description: Given a user's email address, retrieves their private key. In the case of failure a rejected promise is returned to the caller.
parameters:
- name: emailAddress
in: path
required: true
schema:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
properties:
passwordEncryptedPrivateKey:
type: string
400:
$ref: '#/components/responses/400.BadRequest'
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
/users/{emailAddress}/recoveryphrase:
get:
operationId: getUserRecoveryPhrase
security:
- User: []
description: Given a user's email address, retrieves their recovery phrase. In the case of failure a rejected promise is returned to the caller.
parameters:
- name: emailAddress
in: path
required: true
schema:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
properties:
emailAddress:
type: string
recoveryPhrase:
type: string
400:
$ref: '#/components/responses/400.BadRequest'
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
/users/{publicKey}/eject:
post:
operationId: ejectUser
security:
- User: []
description: Ejects a user given their public key. In the case of failure, a rejected promise is returned to the caller.
parameters:
- name: publicKey
in: path
required: true
schema:
type: string
requestBody:
description: Structured data used to generate the signature
required: true
content:
application/json:
schema:
type: object
additionalProperties: true
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
properties:
publicKey:
type: string
400:
$ref: '#/components/responses/400.BadRequest'
401:
$ref: '#/components/responses/401.Unauthorized'
500:
$ref: '#/components/responses/500.InternalError'
tags:
- Users
components:
responses:
404.NotFound:
description: The item you are making request for does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/GenericNotFound'
401.NotAuthenticated:
description: User is not authenticated.
content:
application:
schema:
$ref: '#/components/schemas/GenericServerError'
400.BadRequest:
description: Bad Request.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Bad request due to invalid input.
500.InternalError:
description: Unable to fullfil request due to internal server error.
content:
application/json:
schema:
$ref: '#/components/schemas/GenericServerError'
401.Unauthorized:
description: User is not authorized to perform this action.
content:
application/json:
schema:
$ref: '#/components/schemas/NotAuthenticated'
schemas:
GenericServerError:
type: object
nullable: false
properties:
message:
type: string
default: There was an error in fullfiling the request.
nullable: false
NotAuthenticated:
type: object
nullable: false
properties:
message:
type: string
default: You are not authorized or authenticated to perform this action.
nullable: false
GenericNotFound:
type: object
nullable: false
properties:
message:
type: string
default: resource not found
nullable: false
securitySchemes:
User:
type: http
scheme: bearer
bearerFormat: JWT
Application:
type: apiKey
name: api-key
in: query