Unlock Protocol Transfer API

The Transfer API from Unlock Protocol — 2 operation(s) for transfer.

OpenAPI Specification

unlock-protocol-transfer-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Unlock Locksmith Applications Transfer 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: Transfer
paths:
  /v2/transfer/{network}/locks/{lockAddress}/keys/{keyId}:
    post:
      operationId: createTransferCode
      security:
      - User: []
      description: Create a transfer code to transfer an airdropped key to an email address.
      parameters:
      - $ref: '#/components/parameters/Network'
      - $ref: '#/components/parameters/LockAddress'
      - $ref: '#/components/parameters/KeyId'
      responses:
        200:
          description: Successfully created transfer code and sent an email to the recipient.
          content:
            application/json:
              schema:
                type: object
                required:
                - owner
                - lock
                - token
                - deadline
                - transferCode
                properties:
                  owner:
                    type: string
                  lock:
                    type: string
                  token:
                    type: string
                  deadline:
                    type: number
                  transferCode:
                    type: string
                    description: Part of the transfer code that is required to be used with the part sent to the recipient.
        404:
          description: Key not found.
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  message:
                    type: string
        401:
          $ref: '#/components/responses/401.NotAuthenticated'
      tags:
      - Transfer
  /v2/transfer/done:
    post:
      operationId: transferDone
      security:
      - User: []
      description: Finalize the transfer of a key to a recipient. This is to copy over any locksmith related data to the recipient's account.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - transferSignature
              - owner
              - lock
              - token
              - network
              - deadline
              properties:
                transferSignature:
                  type: string
                  description: The signature of the transfer code sent to the recipient.
                owner:
                  type: string
                lock:
                  type: string
                token:
                  type: string
                network:
                  type: number
                deadline:
                  type: number
      responses:
        200:
          description: Successfully transferred key to recipient.
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  message:
                    type: string
        403:
          description: Transfer not authorized by locksmith
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  message:
                    type: string
        404:
          description: Key not found.
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  message:
                    type: string
        401:
          $ref: '#/components/responses/401.NotAuthenticated'
      tags:
      - Transfer
components:
  responses:
    401.NotAuthenticated:
      description: User is not authenticated.
      content:
        application:
          schema:
            $ref: '#/components/schemas/GenericServerError'
  parameters:
    Network:
      in: path
      name: network
      required: true
      description: Network id.
      schema:
        type: integer
    LockAddress:
      in: path
      name: lockAddress
      required: true
      description: Lock address.
      schema:
        type: string
    KeyId:
      in: path
      name: keyId
      required: true
      description: Key Id.
      schema:
        type: string
  schemas:
    GenericServerError:
      type: object
      nullable: false
      properties:
        message:
          type: string
          default: There was an error in fullfiling the request.
          nullable: false
  securitySchemes:
    User:
      type: http
      scheme: bearer
      bearerFormat: JWT
    Application:
      type: apiKey
      name: api-key
      in: query