Blockstream AMP API Specification

The API changelog is viewable using the api/changelog endpoint.

The api/info endpoint will return the current API version.

The blockstream-amp-confirm.py Python client will check that the version of it is compatible with the current API version before running any commands.

To view the API specification below in an interactive format it can be pasted into a tool such as swagger.io

The following is not guaranteed to be the latest version of the API specification and is presented only as an example of the API’s functionality. You will receive the latest version as part of a ‘Blockstream AMP API Update’ email if you are signed up for a test or live account.

---
swagger: "2.0"
info:
  description: "This is an API for interacting with Blockstream Asset
    Management Platform.\n\n
    Examples of how to authenticate and call the API programmatically using
    Python and nodejs can be obtained by request."
  version: "0.1.12"
  title: "Blockstream Asset Management Platform"
  contact:
    email: "[email protected]"
host: "amp.blockstream.com"
basePath: "/api"
tags:
- name: "general"
  description: "General API operations"
- name: "user"
  description: "Operations about user and user information"
- name: "registered users"
  description: "Operations about registered users"
- name: "categories"
  description: "Operations about categories"
- name: "assets"
  description: "Operations about assets"
- name: "assignments"
  description: "Operations about asset assignments"
- name: "distributions"
  description: "Operations about asset distributions"
- name: "gaids"
  description: "Operations about Blockstream Green Managed Assets accounts"
- name: "managers"
  description: "Operations about issuer delegated managers"
schemes:
- "https"
paths:
  /info:
    get:
      tags:
      - "general"
      summary: "Gets information about the API. Token authentication is not
        required by this endpoint."
      description: "API version information."
      consumes:
      - "application/json"
      produces:
      - "application/json"
      responses:
        200:
          description: ""
          schema:
            required:
              - version
            properties:
              version:
                type: string
                example: "1.0.1"
              notes:
                type: string
  /changelog:
    get:
      tags:
      - "general"
      summary: "Gets information about API changes."
      responses:
        200:
          description: "Map version: changelog, may include multiple versions."
          schema:
            properties:
              version:
                type: string
                example: "changelog"
  /user/change-password:
    post:
      tags:
      - "user"
      summary: "Change the password for the current user."
      description: "The password you provide will be the new user password."
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - in: "body"
        name: "body"
        required: true
        schema:
          required:
          - password
          properties:
            password:
              type: string
              description: "The new password used to access Blockstream AMP."
      responses:
        200:
          description: "Password and authentication token"
          schema:
            properties:
              username:
                type: string
                description: "The username used to access Blockstream AMP."
              password:
                type: string
                description: "The password used to access Blockstream AMP."
              token:
                type: string
                description: "The token that can be used to authenticate
                  subsequent API calls."
        400:
          description: "Invalid credentials"
  /user/obtain_token:
    post:
      tags:
      - "user"
      summary: "Returns a token used to authenticate all other API calls apart
        from /info."
      description: "The username and password you provide should be the ones
        used to access Blockstream AMP. The token returned can be used in
        subsequent API calls by setting the request header like so:\n\n
        { 'content-type': 'application/json', 'Authorization':
        'token <returned_token>' } \n\nExamples of how to authenticate and
        call the API programmatically using Python and nodejs can be
        obtained by request."
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - in: "body"
        name: "body"
        required: true
        schema:
          required:
          - username
          - password
          properties:
            username:
              type: string
              description: "The username used to access Blockstream AMP."
            password:
              type: string
              description: "The password used to access Blockstream AMP."
      responses:
        200:
          description: "Authentication token"
          schema:
            required:
            - token
            properties:
              token:
                type: string
                description: "The token that can be used to authenticate
                  subsequent API calls."
        400:
          description: "Invalid credentials"
  /user/refresh-token:
    get:
      tags:
      - "user"
      summary: "Renew the authentication token for the current user."
      description: "Renew authentication token."
      consumes:
      - "application/json"
      produces:
      - "application/json"
      responses:
        200:
          description: "New authentication token"
          schema:
            properties:
              token:
                type: string
                description: "The new token that can be used to authenticate
                  subsequent API calls."
  /registered_users/:
    get:
      tags:
      - "registered users"
      summary: "List of all registered users."
      description: ""
      responses:
        200:
          description: ""
          schema:
            type: array
            items:
              $ref: "#/definitions/RegisteredUserResponse"
  /registered_users/{registeredUserId}:
    get:
      tags:
      - "registered users"
      summary: "Details of the registered user requested."
      description: ""
      parameters:
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/RegisteredUserResponse"
        403:
          description: "Not authorized"
        404:
          description: "Registered user not found"
  /registered_users/add:
    post:
      tags:
      - "registered users"
      summary: "Adds a registered user"
      description: ""
      parameters:
      - in: "body"
        name: "body"
        required: true
        schema:
          $ref: "#/definitions/RegisteredUserAdd"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/RegisteredUserResponse"
        400:
          description: "Bad input.\nShows invalid GAIDs, if they exist."
        403:
          description: "Not authorized"
  /registered_users/{registeredUserId}/edit:
    put:
      tags:
      - "registered users"
      summary: "Updates a registered user"
      parameters:
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      - in: "body"
        name: "body"
        required: true
        schema:
          $ref: "#/definitions/RegisteredUserEdit"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/RegisteredUserResponse"
        403:
          description: "Not authorized"
        404:
          description: "Registered user not found"
  /registered_users/{registeredUserId}/delete:
    delete:
      tags:
      - "registered users"
      summary: "Deletes a registered user"
      parameters:
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      responses:
        204:
          description: "Successful delete"
        400:
          description: "Bad input"
        403:
          description: "Not authorized"
        404:
          description: "Registered user not found"
  /registered_users/{registeredUserId}/summary:
    get:
      tags:
      - "registered users"
      summary: "Summary of the registered user"
      parameters:
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      responses:
        200:
          description: ""
          schema:
            type: array
            items:
              $ref: "#/definitions/RegisteredUserSummary"
        403:
          description: "Not authorized"
        404:
          description: "Registered user not found"
  /registered_users/{registeredUserId}/gaids:
    get:
      tags:
      - "registered users"
      summary: "List of registered user GAIDs"
      parameters:
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      responses:
        200:
          description: ""
          schema:
            type: array
            items:
              type: string
        400:
          description: "Bad input"
        403:
          description: "Not authorized"
  /registered_users/{registeredUserId}/gaids/add:
    post:
      tags:
      - "registered users"
      summary: "
          Associate a new GAID to registered user.\n
          If the registered user had no GAIDs, the new one will be set as the
          default GAID, otherwise the default GAID remains the same."
      parameters:
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      - in: "body"
        name: "GAID"
        required: true
        schema:
          type: string
      responses:
        200:
          description: "Success"
        400:
          description: "Bad input"
        403:
          description: "Not authorized"
  /registered_users/{registeredUserId}/gaids/set-default:
    post:
      tags:
      - "registered users"
      summary: "
          Set a GAID already associated to registered user as the default.\n
          The default GAID is used to obtain receiving addresses from Green for
          assignments."
      parameters:
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      - in: "body"
        name: "GAID"
        required: true
        schema:
          type: string
      responses:
        200:
          description: "Success"
        400:
          description: "Bad input"
        403:
          description: "Not authorized"
  /categories:
    get:
      tags:
      - "categories"
      summary: "Lists all Categories that can be associated with Investors."
      description: ""
      responses:
        200:
          description: "List of all categories"
          schema:
            type: array
            items:
              $ref: "#/definitions/CategoryResponse"
  /categories/add:
    post:
      tags:
      - "categories"
      summary: "Adds a new Category"
      description: "Adds a new category."
      parameters:
      - in: "body"
        name: "body"
        required: true
        schema:
          $ref: "#/definitions/CategoryAdd"
      responses:
        200:
          description: "Category"
          schema:
            $ref: "#/definitions/CategoryResponse"
        403:
          description: "Not authorized"
  /categories/{categoryId}:
    get:
      tags:
      - "categories"
      summary: "Gets the details of the provided category"
      description: "Returns details of the category."
      parameters:
      - name: "categoryId"
        in: "path"
        description: "ID of category"
        required: true
        type: integer
      responses:
        200:
          description: "Category"
          schema:
            $ref: "#/definitions/CategoryResponse"
        403:
          description: "Not authorized"
        404:
          description: "Category not found"
  /categories/{categoryId}/edit:
    put:
      tags:
      - "categories"
      summary: "Allows the update of the name and description of a category."
      parameters:
      - name: "categoryId"
        in: "path"
        description: "ID of category"
        required: true
        type: integer
      - in: "body"
        name: "body"
        required: true
        schema:
          $ref: '#/definitions/CategoryEdit'
      responses:
        200:
          description: "Category"
          schema:
            $ref: "#/definitions/CategoryResponse"
        400:
          description: "Invalid data"
        403:
          description: "Not authorized"
        404:
          description: "Category not found"
  /categories/{categoryId}/delete:
    delete:
      tags:
      - "categories"
      summary: "Delete a category."
      description: ""
      parameters:
      - name: "categoryId"
        in: "path"
        description: "ID of category"
        required: true
        type: integer
      responses:
        204:
          description: "Successful delete"
        404:
          description: "Category not found"
        403:
          description: "Not authorized"
  /categories/{categoryId}/registered_users/{registeredUserId}/add:
    put:
      tags:
      - "categories"
      summary: "Add a registered user to a category."
      description: "Add a registered user to a category."
      parameters:
      - name: "categoryId"
        in: "path"
        description: "ID of category"
        required: true
        type: integer
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      responses:
        200:
          description: "Category"
          schema:
            $ref: "#/definitions/CategoryResponse"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /categories/{categoryId}/registered_users/{registeredUserId}/remove:
    put:
      tags:
      - "categories"
      summary: "Remove a registered user from a category."
      description: "Remove a registered user from a category."
      parameters:
      - name: "categoryId"
        in: "path"
        description: "ID of category"
        required: true
        type: integer
      - name: "registeredUserId"
        in: "path"
        description: "ID of registered user"
        required: true
        type: integer
      responses:
        200:
          description: "Category"
          schema:
            $ref: "#/definitions/CategoryResponse"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /categories/{categoryId}/assets/{assetUuid}/add:
    put:
      tags:
      - "categories"
      summary: "Add an asset to a category."
      description: "Add an asset to a category."
      parameters:
      - name: "categoryId"
        in: "path"
        description: "ID of category"
        required: true
        type: integer
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Category"
          schema:
            $ref: "#/definitions/CategoryResponse"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /categories/{categoryId}/assets/{assetUuid}/remove:
    put:
      tags:
      - "categories"
      summary: "Remove an asset from a category."
      description: "Remove an asset from a category."
      parameters:
      - name: "categoryId"
        in: "path"
        description: "ID of category"
        required: true
        type: integer
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Category"
          schema:
            $ref: "#/definitions/CategoryResponse"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /assets/:
    get:
      tags:
      - "assets"
      summary: "Returns a list of all assets"
      responses:
        200:
          description: "List of assets"
          schema:
            required:
            - name
            - asset_uuid
            - issuer
            - amount
            - asset_id
            type: array
            items:
              $ref: "#/definitions/Asset"
        403:
          description: "Not authorized"
  /assets/{assetUuid}:
    get:
      tags:
      - "assets"
      summary: "Gets details of a given asset"
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Asset"
          schema:
            $ref: "#/definitions/Asset"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/issue:
    post:
      tags:
      - "assets"
      summary: "Issues a new asset"
      description: "Issue an asset on the Liquid Network.\n
        If is_reissuable is true then reissuance_amount and reissuance_address
        must be provided and reissuance_address must be different from
        destination_address.\n
        Name, ticker, domain and pubkey are committed to the issuance
        transaction, thus they cannot be changed later.\n
        See https://docs.blockstream.com/liquid-securities/api-tutorial.html
        for more information on the Liquid Asset Registry."
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - in: "body"
        name: "body"
        required: true
        schema:
          $ref: '#/definitions/Issuance'
      responses:
        201:
          description: "Asset Issuance"
          schema:
            $ref: '#/definitions/IssuanceResponse'
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
  /assets/{assetUuid}/edit:
    put:
      tags:
      - "assets"
      summary: "Updates an existing asset"
      description: "The only field that can be updated is the asset's
        authorization endpoint."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            issuer_authorization_endpoint:
              type: string
              description: "
                  Issuer-specified authorization endpoint. It is queried when
                  authorizing a transaction and it can be use to override the
                  authorization result."
      responses:
        200:
          description: "Assets"
          schema:
            $ref: "#/definitions/Asset"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/delete:
    delete:
      tags:
      - "assets"
      summary: "Deletes the given asset and any associated relational data."
      description: "The deletion cannot be undone. Deletion does not affect the
        underlying asset on the Liquid blockchain, neither does it destroy an
        issued asset amount. Use with caution for assets accidentally issued."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        204:
          description: "Successful delete"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/register:
    get:
      tags:
      - "assets"
      summary: "Registers the asset with the Blockstream Asset Registry"
      description: "Registers the asset if the requirements are satisifed.\n\n
        The asset registry allows you to register an asset and prove ownership
        against a domain name.\nThe asset needs to have a ticker, domain and
        pubkey.\nFor more information see: https://docs.blockstream.com/liquid/
        developer-guide/developer-guide-index.html
        #proof-of-issuance-blockstream-s-liquid-asset-registry"
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Asset"
          schema:
            $ref: "#/definitions/Asset"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/register-authorized:
    get:
      tags:
      - "assets"
      summary: "Register authorization with Blockstream Green"
      description: "Authorizes the asset within Green to be handled by Green's
        wallet control features. Allows whitelisting etc."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Asset"
          schema:
            $ref: "#/definitions/Asset"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/lock:
    put:
      tags:
      - "assets"
      summary: "Lock the asset"
      description: "
          If an asset is locked, all Green authorization requests will be
          rejected. Note that this does not affect transactions from the
          treasury wallet."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Asset"
          schema:
            $ref: "#/definitions/Asset"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/unlock:
    put:
      tags:
      - "assets"
      summary: "Unlock the asset"
      description: "
          If an asset is unlocked, Green authorization requests are processed
          and may be accepted."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Asset"
          schema:
            $ref: "#/definitions/Asset"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/activities:
    get:
      tags:
      - "assets"
      summary: "List of confirmed blockchain asset activities"
      description: "Returned activities can be of type: issuance, reissuance,
        distribution, transactions.
        Results are paged and sortable. See parameter notes for details of use.
        The start parameter is 1 (not zero) based to make paging easier for
        clients.
        start=1, count=50 should return activities list indexes 0 to 49.
        start=51, count=50 should return activities list indexes 50 to 99.
        a negative value can be provided to return from the end of the list.
        Height_start and height_stop will filter and return only activites
        confirmed between these block heights.
        If there are lost outputs, we will include them in this list."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "query"
        name: "start"
        type: "integer"
        description: "Start index for pagination"
        required: false
        default: 1
      - in: "query"
        name: "count"
        type: "integer"
        description: "Number of results per call"
        required: false
        default: 100000
      - in: "query"
        name: "sortcolumn"
        type: "string"
        description: "The sortcolumn parameter can either be an index number
          (starting at 1) or the string name of the column. "
        required: false
        default: 1
      - in: "query"
        name: "sortorder"
        type: "string"
        description: "The sortorder parameter can either be asc (for ascending)
          or desc (for descending) and defaults to asc if the parameter is not
          included."
        required: false
        default: "asc"
      - in: "query"
        name: "height_start"
        type: "integer"
        description: "Start block height for filtering."
        required: false
        default: 1
      - in: "query"
        name: "height_stop"
        type: "integer"
        description: "Stop block height for filtering."
        required: false
        default: 21000000
      responses:
        200:
          description: "List of Asset activities"
          schema:
            type: array
            items:
              $ref: "#/definitions/Activity"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/ownerships:
    get:
      tags:
      - "assets"
      summary: "List of asset ownership at a given point in time"
      description: "Returns ownership distribution.\n\nOwnership point in time
        is based upon the confirmation height of the associated transaction.\n\n
        Warning: if some lost outputs are present the values may be incorrect."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "query"
        name: "height"
        type: "integer"
        description: "If provided the height parameter must be a valid Liquid
          block height else height will be set to the last Liquid block.
          Example: height=100."
        required: false
      responses:
        200:
          description: "List of Asset ownerships based upon confirmed
            transactions."
          schema:
            type: array
            items:
              $ref: "#/definitions/Ownership"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/balance:
    get:
      tags:
      - "assets"
      summary: "Balance of asset"
      description: "Returns the balance of an asset and the list of outputs that
        the server lost track of. Under normal circumstances, the list of lost
        outputs is empty."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Balance of an assets."
          schema:
            $ref: "#/definitions/Balance"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/lost-outputs:
    get:
      tags:
      - "assets"
      summary: "Lost outputs lists"
      description: "Returns the list of outputs that the server is now unable to
        track. This might happen if the asset or reissuance token has been
        transferred by the issuer without using the Blockstream AMP API.
        Should be empty under normal circumstances."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Lists of lost outputs"
          schema:
            type: object
            properties:
              lost_outputs:
                description: "List of outputs which the server has lost track
                  of."
                $ref: "#/definitions/LostOutputs"
              reissuance_lost_outputs:
                description: "List of outputs which the server has lost track
                  of (for reissuance token)."
                $ref: "#/definitions/LostOutputs"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/summary:
    get:
      tags:
      - "assets"
      summary: "Summary of asset"
      description: "Returns some statistics on a selected asset."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Summary of an assets."
          schema:
            $ref: "#/definitions/Summary"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/utxos:
    get:
      tags:
      - "assets"
      summary: "List of asset UTXOs"
      description: "List all UTXOs for the selected asset"
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "List of asset UTXOs"
          schema:
            $ref: "#/definitions/Utxos"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/utxos/blacklist:
    post:
      tags:
      - "assets"
      summary: "Move UTXOs to blacklist"
      description: "
          Set one or more UTXOs in blacklist\n
          Note: blacklisting only affects transaction spending utxos with a
          GAID. For instance it does not affect the issuer's utxos."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        description: "List of UTXOs"
        schema:
          type: array
          items:
            type: object
            properties:
              txid:
                type: string
              vout:
                type: integer
      responses:
        200:
          description: "List of modified UTXOs"
          schema:
            $ref: "#/definitions/Utxos"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/utxos/whitelist:
    post:
      tags:
      - "assets"
      summary: "Move UTXOs to whitelist"
      description: "
          Set one or more UTXOs in whitelist\n
          Note: whitelisting only affects transaction spending utxos with a
          GAID. For instance it does not affect the issuer's utxos."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        description: "List of UTXOs"
        schema:
          type: array
          items:
            type: object
            properties:
              txid:
                type: string
              vout:
                type: integer
      responses:
        200:
          description: "List of modified UTXOs"
          schema:
            $ref: "#/definitions/Utxos"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/treasury-addresses:
    get:
      tags:
      - "assets"
      summary: "List of asset treasury addresses"
      description: "
          List all treasury addresses for the selected asset.\n
          Users of Green Liquid Managed Assets accounts must send to one of
          these addresses to send the asset back to the treasury wallet."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "List of treasury addresses"
          schema:
            type: array
            items:
              type: string
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/treasury-addresses/add:
    post:
      tags:
      - "assets"
      summary: "Add treasury addresses"
      description: "Add a list of treasury addresses for the selected asset."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        description: "List of treasury addresses"
        schema:
          type: array
          items:
            type: string
      responses:
        200:
          description: "Success"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/treasury-addresses/delete:
    delete:
      tags:
      - "assets"
      summary: "Remove treasury addresses"
      description: "Remove a list of treasury addresses for the selected asset."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        description: "List of treasury addresses"
        schema:
          type: array
          items:
            type: string
      responses:
        200:
          description: "Success"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/memo:
    get:
      tags:
        - "assets"
      summary: "Get memo for the asset"
      description: ""
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Text of the memo"
          schema:
            type: string
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/memo/set:
    post:
      tags:
        - "assets"
      summary: "Set memo for the asset"
      description: ""
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        description: "Text of the memo"
        schema:
          type: string
      responses:
        200:
          description: "Success"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/assignments:
    get:
      tags:
      - "assignments"
      summary: "List of asset assignments"
      description: "List of asset assignments."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "query"
        name: "is_distributed"
        type: "boolean"
        description: "Filter on distribution status"
        required: false
      - in: "query"
        name: "has_vested"
        type: "boolean"
        description: "Filter on vesting status"
        required: false
      - in: "query"
        name: "vesting_timestamp_from"
        type: "integer"
        description: "Filter vesting after a specified timestamp (in Unix Epoch
          time)"
        required: false
      - in: "query"
        name: "registered_user"
        type: "integer"
        description: "Filter on registered user id"
        required: false
      - in: "query"
        name: "creator"
        type: "integer"
        description: "Filter on creator id"
        required: false
      responses:
        200:
          description: "List of Asset Assignments"
          schema:
            type: array
            items:
              $ref: "#/definitions/Assignment"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/assignments/{assignmentId}:
    get:
      tags:
      - "assignments"
      summary: "Gets the details of asset assignment"
      description: "Details of the assignment."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "assignmentId"
        in: "path"
        description: "Id of assignment"
        required: true
        type: "integer"
      responses:
        200:
          description: "Asset Assignment"
          schema:
            $ref: "#/definitions/Assignment"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/assignments/create:
    post:
      tags:
      - "assignments"
      summary: "Create asset assignments"
      description: "
        Creates an asset assignment. An assignment is an allocation of an amount
        of the asset to an investor.\n
        It is possible to set the value 'ready_for_distribution' to true
        (false), so that the assignment will (not) be included in future
        distributions.\n
        It is possible to specify a 'vesting_timestamp', so that the assignment
        will be included only in distributions created after the corresponding
        date.\n
        Assignments array must have exactly one element.\n"
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        schema:
          required:
          - assignments
          properties:
            assignments:
              type: array
              items:
                $ref: "#/definitions/AssignmentCreate"
      responses:
        200:
          description: "Asset Assignments"
          schema:
            type: array
            items:
              $ref: "#/definitions/Assignment"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/assignments/{assignmentId}/lock:
    put:
      tags:
      - "assignments"
      summary: "Lock an asset assignment"
      description: "
        Lock the assignment so that it will not be included in future
        distributions."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "assignmentId"
        in: "path"
        description: "Id of assignment"
        required: true
        type: "integer"
      responses:
        200:
          description: "Asset Assignment"
          schema:
            $ref: "#/definitions/Assignment"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/assignments/{assignmentId}/unlock:
    put:
      tags:
      - "assignments"
      summary: "Unlock an asset assignment"
      description: "
        Unlock the assignment so that it will be included in future
        distributions."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "assignmentId"
        in: "path"
        description: "Id of assignment"
        required: true
        type: "integer"
      responses:
        200:
          description: "Asset Assignment"
          schema:
            $ref: "#/definitions/Assignment"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/assignments/{assignmentId}/delete:
    delete:
      tags:
      - "assignments"
      summary: "Deletes the given assignment."
      description: "Sets the assignment to deleted so it will be excluded from
        future lists and details views etc."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "assignmentId"
        in: "path"
        description: "Id of assignment"
        required: true
        type: "integer"
      responses:
        204:
          description: "Successful delete"
        403:
          description: "Not authorized"
        404:
          description: "Asset or assignment not found"
  /assets/{assetUuid}/distributions:
    get:
      tags:
        - "distributions"
      summary: "List of asset distributions"
      description: "Distributions of assigned amounts of an asset. A
        distribution represents the sending of an asset amount to one or more
        investors. One of more confirmed Liquid transactions represent the
        completion of a distribution. The returned data includes details of
        transaction data and is grouped by distribution_uuid. A distribution may
         span multiple transactions, depending on the number of outputs
         required. The distribution_status field is derived from the status of
         each transaction making up the distribution."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "List of Asset Distributions"
          schema:
            type: array
            items:
              $ref: "#/definitions/Distribution"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/distributions/{distributionUuid}:
    get:
      tags:
      - "distributions"
      summary: "Details of the asset distribution"
      description: "Returns details of the Assets distribution.\n\nSee
        /assets/{assetUuid}/distributions for an explanation of the structure of
        a distribution."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "distributionUuid"
        in: "path"
        description: "UUID of distribution"
        required: true
        type: string
      responses:
        200:
          description: "Asset Distribution details"
          schema:
            $ref: "#/definitions/Distribution"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/distributions/create/:
    get:
      tags:
      - "distributions"
      summary: "Creates an asset distribution."
      description: "An asset must be registered as an authorized asset using the
        register-authorized endpoint before a distribution can begin. Returns
        data to perform a distribution based on assignments. Use
        /assets/{assetUuid}/assignments for a preview of the distribution. Note
        that you must access the Liquid node rpc to perform the distribution.
        Save the returned data to a file and then call
        'python3 blockstream-amp-confirm.py -u USERNAME -p PASSWORD
        -n NODE_URL distribute -f FILENAME'. The script creates and sends the
        transaction, it waits until confirmed (2 minutes) and then it calls the
        Blockstream AMP API to confirm the distribution."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Asset Distribution Data"
          schema:
            $ref: "#/definitions/DistributionCreate"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/distributions/{distributionUuid}/confirm:
    post:
      tags:
      - "distributions"
      summary: "Confirm a distribution transaction"
      description: "Warning: this API should not be called directly; use the
        distribution confirm script provided.\nConfirms the distribution
        transaction was made. 'tx_data' is that returned from liquid-cli's
        'gettransaction' method, including surrounding '{' and '}' marks;
        'change_data' is that returned from liquid-cli's 'listunspent' method,
        including surrounding '{' and '}' marks."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "distributionUuid"
        in: "path"
        description: "UUID of distribution"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            tx_data:
              type: object
            change_data:
              type: object
      responses:
        200:
          description: "Asset Distribution"
          schema:
            items:
              $ref: "#/definitions/Distribution"
        403:
          description: "Not authorized"
        404:
          description: "Asset or distribution not found"
  /assets/{assetUuid}/distributions/{distributionUuid}/cancel:
    delete:
      tags:
      - "distributions"
      summary: "Cancel a distribution"
      description: "Cancel an asset distribution. The status of the distribution
        must be 'pending'. Removes the 'distribution_uuid' from pending
        distributions. This essentially returns the distribution to an
        assignment marked as 'ready_for_distribution'."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "distributionUuid"
        in: "path"
        description: "UUID of distribution batch"
        required: true
        type: "integer"
      responses:
        200:
          description: "The distribution was cancelled"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /gaids/{gaid}/validate:
    get:
      tags:
      - "gaids"
      summary: "Validate a GAID"
      description: "GAID identifies an account of a Green wallet, to be valid a
        GAID must be associated with a Managed Assets account."
      parameters:
      - name: "gaid"
        in: "path"
        description: "Identifier for the Green Managed Assets account"
        required: true
        type: "string"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/ValidateGaid"
        400:
          description: "Bad input"
        403:
          description: "Not authorized"
  /gaids/{gaid}/address:
    get:
      tags:
      - "gaids"
      summary: "Obtain a address for a GAID"
      description: "
        Obtain a confidential address for a Blockstream AMP GAID.
        This will not work for GAID associated with non Managed Assets
        accounts.
        Note that you don't need to call this endpoint to perform a
        distribution, as it is handled internally.
        Managed Assets accounts generate 2of2 outputs that, unlike other Green
        accounts, are not recoverable by the user if the Green server becomes
        unavaible or rogue. For this reason you should not send assets that are
        not Managed Assets to addresses generated with this endpoint.
        Managed Assets accounts are intended to store only Managed Assets and
        few L-BTC for the transaction fees."
      parameters:
      - name: "gaid"
        in: "path"
        description: "Identifier for the Green Managed Assets account"
        required: true
        type: "string"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/AddressGaid"
        403:
          description: "Not authorized"
  /gaids/{gaid}/registered_user:
    get:
      tags:
      - "gaids"
      summary: "Returns registered user associated to gaid"
      description: "
          Returns registered user associated to gaid if such registered user
          exists and belongs to the issuer."
      parameters:
      - name: "gaid"
        in: "path"
        description: "Identifier for the Green Managed Assets account"
        required: true
        type: "string"
      responses:
        200:
          description: ""
          schema:
            properties:
              registered_user:
                type: integer
                description: "Registered user ID"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
  /gaids/{gaid}/balance:
    get:
      tags:
      - "gaids"
      summary: "Returns a list of asset balances for gaid"
      description: "
          Returns a list of confirmed balances for all assets issued by the
          issuer, for the Blockstream Green Managed Assets account identified
          by gaid."
      parameters:
      - name: "gaid"
        in: "path"
        description: "Identifier for the Green Managed Assets account"
        required: true
        type: "string"
      responses:
        200:
          description: "List of balances"
          schema:
            type: array
            items:
              $ref: "#/definitions/GaidBalance"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
  /gaids/{gaid}/balance/{assetUuid}:
    get:
      tags:
      - "gaids"
      summary: "Returns the asset balance for gaid"
      description: "
          Returns the asset confirmed balance for the Blockstream Green Managed
          Assets account identified by gaid."
      parameters:
      - name: "gaid"
        in: "path"
        description: "Identifier for the Green Managed Assets account"
        required: true
        type: "string"
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Balance"
          schema:
            $ref: "#/definitions/GaidBalance"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/reissuances:
    get:
      tags:
      - "assets"
      summary: "List of asset reissuances"
      description: "Details of each Liquid transaction where the associated
        asset was reissued. The reissuance itself would normally be carried out
        by the bash script returned from the reissue-request API endpoint."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "List of Asset reissuances"
          schema:
            type: array
            items:
              $ref: "#/definitions/Reissuance"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/reissue-request:
    post:
      tags:
      - "assets"
      summary: "Requests the json to reissue an asset"
      description: "Request the json that will be passed to the script provided
        to reissue the given amount of the asset. The amount to be reissued
        should be provided and the return value will be a json. The script will
        reissue the stated amount of the asset and post the resulting
        transaction data back to the Blockstream AMP API reissue-confim
        endpoint to confirm and register the transaction and increase the
        available supply within Blockstream AMP."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            amount_to_reissue:
              type: integer
      responses:
        200:
          description: "JSON to be passed to reissuance script"
          schema:
            properties:
                command:
                    type: string
                min_supported_client_version:
                    type: integer
                base_url:
                    type: string
                asset_uuid:
                    type: string
                asset_id:
                    type: string
                amount:
                  type: integer
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/reissue-confirm:
    post:
      tags:
      - "assets"
      description: "Warning: you should not need to call this manually, use the
        blockstream-amp-confirm.py script provided which will reissue the asset
        and call this API endpoint as part of its execution.\nConfirms the
        reissuance was made."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            details:
              type: object
            listissuances:
                type: array
                items:
                  type: object
            reissuance_output:
                type: object
      responses:
        200:
          description: "Confirmation of the validity of the reissuance
            transaction."
          schema:
            properties:
              txid:
                type: string
              vin:
                type: integer
              reissuance_amount:
                type: integer
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/burn-request:
    post:
      tags:
      - "assets"
      summary: "Request a burn transaction."
      description: "Returns data to perform a burn transaction. Note that you
        must access the Liquid node rpc to perform the burn. Save the returned
        data to a file and then call 'python3 blockstream-amp-confirm.py
        -u USERNAME -p PASSWORD -n NODE_URL burn -f FILENAME'. The script
        creates and sends the transaction, it waits until confirmed (2 minutes)
        and then it calls the Blockstream AMP API to confirm the burn."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            amount:
              type: integer
      responses:
        200:
          description: "Asset Burn Data"
          schema:
            $ref: "#/definitions/BurnCreate"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/burn-confirm:
    post:
      tags:
      - "assets"
      summary: "Confirm a burn transaction"
      description: "Warning: this API should not be called directly; use the
        burn confirm script provided.\nConfirms the burn transaction was made.
        'tx_data' is that returned from liquid-cli's 'gettransaction' method,
        including surrounding '{' and '}' marks; 'change_data' is that returned
        from liquid-cli's 'listunspent' method, including surrounding '{' and
        '}' marks."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            tx_data:
              type: object
              properties:
                txid:
                  type: string
            change_data:
              type: array
              items:
                type: "object"
      responses:
        200:
          description: "Correctly recorder"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/txs:
    get:
      tags:
      - "assets"
      summary: "List of asset transactions"
      description: ""
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "query"
        name: "start"
        type: "integer"
        description: "Start index for pagination"
        required: false
        default: 1
      - in: "query"
        name: "count"
        type: "integer"
        description: "Number of results per call"
        required: false
        default: 100000
      - in: "query"
        name: "height_start"
        type: "integer"
        description: "Start block height for filtering."
        required: false
        default: 1
      - in: "query"
        name: "height_stop"
        type: "integer"
        description: "Stop block height for filtering."
        required: false
        default: 21000000
      responses:
        200:
          description: "List of asset transactions"
          schema:
            type: array
            items:
              $ref: "#/definitions/Tx"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /assets/{assetUuid}/txs{txid}:
    get:
      tags:
      - "assets"
      summary: "An asset transaction"
      description: ""
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - name: "txid"
        in: "path"
        description: "Transaction ID"
        required: true
        type: "string"
      responses:
        200:
          description: "List of asset transactions"
          schema:
            $ref: "#/definitions/Tx"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset or Transaction not found"
  /assets/{assetUuid}/update-blinders:
    get:
      tags:
      - "assets"
      summary: "Update blinders for an output"
      description: "Warning: this API should not be called directly; use the
        confirm script provided."
      parameters:
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            txid:
              type: string
            vout:
              type: integer
            asset_blinder:
              type: string
            amount_blinder:
              type: string
      responses:
        200:
          description: ""
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset or Transaction not found"
  /managers:
    get:
      tags:
      - "managers"
      summary: "List of issuer delegated managers"
      description: "List of issuer delegated managers"
      responses:
        200:
          description: "List of issuer delegated managers"
          schema:
            type: array
            items:
              $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Asset not found"
  /managers/me:
    get:
      tags:
      - "managers"
      summary: "Details of the logged manager"
      description: "Details of the logged manager"
      responses:
        200:
          description: "Manager details"
          schema:
            $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /managers/{managerId}:
    get:
      tags:
      - "managers"
      summary: "Details of the manager"
      description: "Details of the manager"
      parameters:
      - name: "managerId"
        in: "path"
        description: "ID of the manager"
        required: true
        type: integer
      responses:
        200:
          description: "Manager details"
          schema:
            $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /managers/create:
    post:
      tags:
      - "managers"
      summary: "Create a new manager"
      description: "Create a new manager"
      parameters:
      - in: "body"
        name: "body"
        required: true
        schema:
          properties:
            username:
              type: string
            password:
              type: string
      responses:
        201:
          description: "Manager details"
          schema:
            $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /managers/{managerId}/change-password:
    post:
      tags:
      - "managers"
      summary: "Change the manager password"
      description: "Change the manager password"
      parameters:
      - name: "managerId"
        in: "path"
        description: "ID of the manager"
        required: true
        type: integer
      - in: "body"
        name: "body"
        required: true
        schema:
          required:
          - password
          properties:
            password:
              type: string
              description: "The new password for the manager"
      responses:
        200:
          description: "New credentials"
          schema:
            properties:
              username:
                type: string
              password:
                type: string
              token:
                type: string
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /managers/{managerId}/lock:
    put:
      tags:
      - "managers"
      summary: "Lock the manager"
      description: "Lock the manager"
      parameters:
      - name: "managerId"
        in: "path"
        description: "ID of the manager"
        required: true
        type: integer
      responses:
        200:
          description: "Manager details"
          schema:
            $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /managers/{managerId}/unlock:
    put:
      tags:
      - "managers"
      summary: "Unlock the manager"
      description: "Unlock the manager"
      parameters:
      - name: "managerId"
        in: "path"
        description: "ID of the manager"
        required: true
        type: integer
      responses:
        200:
          description: "Manager details"
          schema:
            $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /managers/{managerId}/assets/{assetUuid}/add:
    put:
      tags:
      - "managers"
      summary: "Authorize the manager to manage the asset"
      description: "Authorize the manager to manage the asset"
      parameters:
      - name: "managerId"
        in: "path"
        description: "ID of the manager"
        required: true
        type: integer
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Manager details"
          schema:
            $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
  /managers/{managerId}/assets/{assetUuid}/remove:
    put:
      tags:
      - "managers"
      summary: "Revoke authorization to manage the asset"
      description: "Revoke authorization to manage the asset"
      parameters:
      - name: "managerId"
        in: "path"
        description: "ID of the manager"
        required: true
        type: integer
      - name: "assetUuid"
        in: "path"
        description: "UUID of asset"
        required: true
        type: "string"
        format: "uuid"
      responses:
        200:
          description: "Manager details"
          schema:
            $ref: "#/definitions/Manager"
        400:
          description: "Invalid input"
        403:
          description: "Not authorized"
        404:
          description: "Not found"
definitions:
  RegisteredUserAdd:
    required:
      - name
    type: "object"
    properties:
      GAID:
        type: string
        example: "GAEnrGHeqCd5UQ2jTW2Mo32o6a2GG"
        description: "Identifier for the Green Managed Assets account."
      is_company:
        type: boolean
      name:
        type: string
        minLength: 1
        maxLength: 255
  RegisteredUserResponse:
    type: "object"
    properties:
      id:
        type: integer
      GAID:
        type: string
        description: "Default GAID."
      is_company:
        type: boolean
      name:
        type: string
      categories:
        type: array
        example: [1, 2]
        items:
          type: integer
      creator:
        type: integer
  RegisteredUserEdit:
    type: "object"
    properties:
      name:
        type: string
  RegisteredUserSummary:
    type: "object"
    properties:
      asset_uuid:
        type: string
      asset_id:
        type: string
      assignments:
        type: array
        items:
          $ref: "#/definitions/Assignment"
      assignments_sum:
        type: integer
      distributions:
        type: array
        items:
          $ref: "#/definitions/Distribution"
      distributions_sum:
        type: integer
      balance:
        type: integer
  ValidateGaid:
    type: "object"
    properties:
      is_valid:
        type: boolean
      error:
        type: string
  AddressGaid:
    type: "object"
    properties:
      address:
        type: string
      error:
        type: string
  CategoryAdd:
    type: "object"
    required:
      - name
    properties:
      name:
        type: string
        minLength: 1
        maxLength: 255
      description:
        type: string
        maxLength: 1023
  CategoryResponse:
    type: "object"
    properties:
      id:
        type: integer
      name:
        type: string
      description:
        type: string
      registered_users:
        type: array
        example: [1, 2]
        items:
          type: integer
      assets:
        type: array
        items:
          type: string
  CategoryEdit:
    type: "object"
    properties:
      name:
        type: string
      description:
        type: string
  Asset:
    type: "object"
    properties:
      name:
        type: string
      asset_uuid:
        type: string
      issuer:
        type: integer
      asset_id:
        type: string
      reissuance_token_id:
        type: string
      requirements:
        type: array
        example: [1, 2]
        items:
          type: integer
      ticker:
        type: string
      precision:
        type: integer
      domain:
        type: string
      pubkey:
        type: string
      is_registered:
        type: boolean
      is_authorized:
        type: boolean
      is_locked:
        type: boolean
      issuer_authorization_endpoint:
        type: string
      transfer_restricted:
        type: boolean
  Assignment:
    type: "object"
    properties:
      id:
        type: integer
      registered_user:
        type: integer
      amount:
        type: integer
      receiving_address:
        type: string
      distribution_uuid:
        type: string
      ready_for_distribution:
        type: boolean
      vesting_datetime:
        type: string
        format: "date-time"
        description: "Assignment will not be distributed before this date."
      vesting_timestamp:
        type: integer
        description: "
          Assignment will not be distributed before this timestamp, in Unix
          Epoch time (seconds since the Epoch)."
      has_vested:
        type: boolean
      is_distributed:
        type: boolean
      creator:
        type: integer
  AssignmentCreate:
    type: "object"
    properties:
      registered_user:
        type: integer
      amount:
        type: integer
        minimum: 1
        maximum: 2100000000000000
      ready_for_distribution:
        type: boolean
        default: false
      vesting_timestamp:
        type: integer
        default: null
        description: "
          Vesting timestamp in Unix Epoch time (seconds since the Epoch),
          must be a future timestamp, may be null. Assignment will not be
          distributed before the corresponding date."
    required:
      - registered_user
      - amount
  Distribution:
    type: object
    properties:
      distribution_uuid:
        type: string
      distribution_status:
        type: string
        enum: [UNCONFIRMED, CONFIRMED]
      transactions:
        type: array
        items:
          $ref: "#/definitions/Transaction"
  Transaction:
    type: object
    properties:
      txid:
        type: string
      transaction_status:
        type: string
        enum: [UNCONFIRMED, CONFIRMED]
      included_blockheight:
        type: integer
      confirmed_datetime:
        type: string
        format: "date-time"
      assignments:
        type: array
        items:
          $ref: "#/definitions/DistributionAssignment"
  DistributionAssignment:
    type: "object"
    properties:
      registered_user:
        type: integer
      amount:
        type: integer
      vout:
        type: integer
  DistributionCreate:
    type: object
    properties:
      command:
        type: string
        description: "distribute"
      min_supported_client_script_version:
        type: integer
      base_url:
        type: string
      distribution_uuid:
        type: string
      asset_uuid:
        type: string
      asset_id:
        type: string
      map_address_amount:
        type: string
        description: "Map in the form {address: amount, ...}"
      map_address_asset:
        type: string
        description: "Map in the form {address: asset, ...}"
  BurnCreate:
    type: object
    properties:
      command:
        type: string
        description: "burn"
      min_supported_client_script_version:
        type: integer
      base_url:
        type: string
      asset_uuid:
        type: string
      asset_id:
        type: string
      amount:
        type: number
        description: "Amount in BTC"
      utxos:
        description: "List of UTXOs"
        type: array
        items:
          type: object
          properties:
            txid:
              type: string
            vout:
              type: integer
  Activity:
    type: "object"
    properties:
      type:
        type: string
      datetime:
        type: string
        format: 'date-time'
      description:
        type: string
      txid:
        type: string
      vout:
        type: integer
      blockheight:
        type: integer
      asset_blinder:
        type: string
      amount_blinder:
        type: string
      registered user:
        type: integer
        description: "Id of the registered user, if the output is a change this
          field is None"
      amount:
        type: integer
  Tx:
    type: "object"
    properties:
      txid:
        type: string
      datetime:
        type: string
        format: 'date-time'
      blockheight:
        type: integer
      is_issuance:
        type: boolean
      is_reissuance:
        type: boolean
      is_distribution:
        type: boolean
      inputs:
        type: array
        items:
          $ref: "#/definitions/Input"
      outputs:
        type: array
        items:
          $ref: "#/definitions/Output"
      unblinded_url:
        type: string
  Input:
    type: "object"
    properties:
      asset_id:
        type: string
      vin:
        type: integer
      prev_txid:
        type: string
      prev_vout:
        type: integer
      amount:
        type: integer
      asset_blinder:
        type: string
      amount_blinder:
        type: string
      registered user:
        type: integer
      GAID:
        type: string
      is_treasury:
        type: boolean
  Output:
    type: "object"
    properties:
      asset_id:
        type: string
      vout:
        type: integer
      amount:
        type: integer
      asset_blinder:
        type: string
      amount_blinder:
        type: string
      registered user:
        type: integer
      GAID:
        type: string
      is_treasury:
        type: boolean
      is_spent:
        type: boolean
      is_burnt:
        type: boolean
  Ownership:
    type: "object"
    properties:
      owner:
        type: string
        description: "Id of the owner, if the owner is the issuer, this field is
          the string 'ISSUER'"
      amount:
        type: integer
      GAID:
        type: string
  Outpoint:
    type: "object"
    properties:
      txid:
        type: string
      vout:
        type: integer
  Balance:
    type: "object"
    properties:
      confirmed_balance:
        type: array
        items:
          $ref: "#/definitions/Ownership"
      lost_outputs:
        description: "List of outputs which the server has lost track of."
        $ref: "#/definitions/LostOutputs"
      reissuance_lost_outputs:
        description: "List of outputs which the server has lost track of (for
          reissuance token)."
        $ref: "#/definitions/LostOutputs"
  LostOutputs:
    type: array
    items:
      $ref: "#/definitions/Outpoint"
  Summary:
    type: "object"
    properties:
      asset_id:
        type: string
        description: "Asset id in hexadecimal format"
      reissuance_token_id:
        type: string
        description: "Reissuance token id in hexadecimal format (null if not
          reissuable)"
      issued:
        type: integer
        description: "Total issued tokens"
      reissued:
        type: integer
        description: "Total reissued tokens"
      assigned:
        type: integer
        description: "Total assigned and not distributed tokens"
      distributed:
        type: integer
        description: "Total distributed tokens"
      burned:
        type: integer
        description: "Total burned tokens"
      blacklisted:
        type: integer
        description: "Total blacklisted tokens"
      registered_users:
        type: integer
        description: "Number of eligible registered users"
      active_registered_users:
        type: integer
        description: "Number of registered users with a positive wallet balance"
      active_green_subaccounts:
        type: integer
        description: "Number of Green Managed Assets accounts with a positive
            balance"
      reissuance_tokens":
        type: integer
        description: "Total reissuance tokens"
  Issuance:
    type: "object"
    properties:
      name:
        type: string
        minLength: 5
        maxLength: 255
        description: "The name of the Asset as it will appear in Managed
            Assets. Length must be 5 to 255 ascii characters."
      amount:
        type: integer
        minimum: 1
        maximum: 2100000000000000
        description: "The amount of the asset to issue. Refer to the precision
            field for how this is represented in the various Blockstream Liquid
            applications."
      destination_address:
        type: string
        description: "Must be a valid Liquid address generated by the treasury's
            Liquid node."
      domain:
        type: string
        minLength: 4
        maxLength: 255
        description: "The domain that will be used to verify the asset if the
            asset is registered with the Liquid Asset Registry. Must be a valid
            domain name format, for example: example.com or sub.example.com. Do
            not include the http/s or www prefixes."
      ticker:
        type: string
        minLength: 3
        maxLength: 5
        description: "The ticker you would like to assign to the asset if the
            asset is registered with the Liquid Asset Registry. Length must be 3
            to 5 characters. Valid characters are a to z, A to Z, 0 to 9, ‘.’
            and ‘-‘."
      precision:
        type: integer
        default: 0
        minimum: 0
        maximum: 8
        description: "
            The precision that will be applied by apps that use the Liquid Asset
            Registry. To help explain how all the various apps show amounts
            using the precision, an amount of 10000 issued through Blockstream
            AMP API with a precision of 2 would show as:\n
            - 10000 through any Blockstream AMP API, which always shows
              amounts as undivisible and at sats level.\n
            - 100.00 on Blockstream Green Mobile, Blockstream Green Desktop,
              and Blockstream Explorer, all of which use the precision held in
              the registry.\n
            - 0.00010000 in elements-cli RPC commands, where BTC is the base
              unit.\n\n
            Please note that when an asset is issued via Blockstream AMP with
            a reissuance token, the reissuance token is always seen in sats. So
            1 reissuance token will show in elements as 0.00000001. Precision is
            not taken into account when displaying reissuance token amounts in
            apps using the Liquid Asset Registry, which will always show amounts
            in sats."
      pubkey:
        type: string
        maxLength: 66
        minLength: 66
        description: "Pubkey for the Liquid Asset Registry, must be a compressed
            pubkey in hex. You can obtian the pubkey from an Elements address
            using the Elements getaddressinfo rpc command."
      is_confidential:
        type: boolean
        default: false
        description: "If true, the issuance amount will not be readable on the
            Liquid blockchain."
      is_reissuable:
        type: boolean
        default: false
        description: "If true, the asset will be created as reissuable. If
            is_reissuable is true then reissuance_amount and reissuance_address
            must also be provided, and reissuance_address must be different from
            destination_address."
      reissuance_amount:
        type: integer
        default: 0
        minimum: 0
        maximum: 2100000000000000
        description: "The amount of reissuance tokens to create if is_reissuable
            is set to True.\n
            Note that when an asset is issued via Blockstream AMP with a
            reissuance token, the reissuance token is always seen in sats. So 1
            reissuance token will show in elements as 0.00000001. Precision is
            not taken into account when displaying reissuance token amounts in
            apps using the Liquid Asset Registry."
      reissuance_address:
        type: string
        default: "\"\""
        description: "The address that will receive the reissuance token if
            is_reissuable is set to True. If is_reissuable is False, this must
            either be an empty string or omitted."
      transfer_restricted:
        type: boolean
        default: true
        description: "
            If true, the asset can be transferred only between users
            registered by the issuer, with a Blockstream Green Managed Assets
            account associated to them.\n
            If false, the asset can be transferred only between Green Managed
            Assets accounts. This second option enforces weaker rules, as
            anyone could create a Green Managed Assets account, and then
            receive the asset.\n
            In both cases, the asset can also be received by or sent to the
            treasury wallet."
    required:
      - name
      - amount
      - destination_address
      - domain
      - ticker
      - pubkey
  IssuanceResponse:
    type: "object"
    properties:
      name:
        type: string
      amount:
        type: integer
      destination_address:
        type: string
      domain:
        type: string
      ticker:
        type: string
      pubkey:
        type: string
      is_confidential:
        type: boolean
      is_reissuable:
        type: boolean
      reissuance_amount:
        type: integer
      reissuance_address:
        type: string
      asset_id:
        type: string
        minLength: 64
        maxLength: 64
        description: "Asset id of the newly generated asset in hex"
      reissuance_token_id:
        type: string
        minLength: 64
        maxLength: 64
        description: "Reissuance token id of the newly generated asset in hex,
          may be null"
      asset_uuid:
        type: string
        minLength: 36
        maxLength: 36
        description: "Asset UUID used by the server"
      txid:
        minLength: 64
        maxLength: 64
        type: string
        description: "Issuance transaction id"
      vin:
        type: integer
        description: "Issuance transaction input"
      asset_vout:
        type: integer
        description: "Issuance transaction output for newly created assets"
      reissuance_vout:
        type: integer
        description: "Issuance transaction output for newly created reissuance
          tokens, may be null"
      issuer_authorization_endpoint:
         type: string
         description: "
            Issuer-specified authorization endpoint. It is queried when
            authorizing a transaction and it can be use to override the
            authorization result."
      transfer_restricted:
        type: boolean
        description: "If false allow sharing tokens with registered users not
          recorded in platform."
      issuance_assetblinder:
        type: string
        minLength: 64
        maxLength: 64
        description: "Issuance asset amount blinder. Is '00..00' if the issuance
          is not confidential."
      issuance_tokenblinder:
        type: string
        minLength: 64
        maxLength: 64
        description: "Issuance token amount blinder. Is null if the issuance is
          not reissuable. Is '00..00' if the issuance is reissuable and not
          confidential."
  Reissuance:
    type: "object"
    properties:
      txid:
        type: string
      vout:
        type: integer
      destination_address:
        type: string
      reissuance_amount:
        type: integer
      confirmed_in_block:
        type: string
      created:
        type: string
        format: 'date-time'
  Utxos:
    type: array
    items:
      $ref: "#/definitions/Utxo"
  Utxo:
    type: "object"
    properties:
      txid:
        type: string
      vout:
        type: integer
      asset:
        type: string
      amount:
        type: integer
      registered_user:
        type: integer
      gaid:
        type: string
      blacklisted:
        type: boolean
  GaidBalance:
    type: "object"
    properties:
      asset_id:
        type: string
      asset_uuid:
        type: string
      balance:
        type: integer
  Manager:
    type: "object"
    properties:
      username:
        type: string
      id:
        type: integer
      is_locked:
        type: boolean
      assets:
        type: array
        items:
          type: string