Only this pageAll pages
Powered by GitBook
1 of 72

URnetwork API Docs

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Stats

API reference

About

BringYour is a web-standards VPN marketplace with an emphasis on fast, secure internet everwhere.

The API for BringYour bootstraps the connect protocol, and is the source of JWTs and other match-making transactions.

The JWT returned by /auth routes does not have a clientId. The connect protocol requires a JWT with a clientId. Use the /network routes to obtain a JWT with a clientId.

In the BringYour network:

  • a network name is a globally unique subnet (xyz.bringyour.network)

  • a clientId is a globally unique 16-byte address

  • clientIds are equivalent to IPv6, but are expressed as UDID

  • clients also have an IPv6 and IPv4 mapped to their clientId

Outside of IP translation like taptun/utun, clients are typically addressed via their clientId.

Unless otherwise specified, time/date strings will be formatted in the Go default 2006-01-02 15:04:05.999999999 -0700 MST.

Providers

Hello

Set preferences

Preferences

Getting Started

Note the API lives at https://api.bringyour.com.

The API uses an authentication JWT. There are two roles of JWT: admin (user) and client. Admins have more privileges on the network. To get started with an admin JWT, . Then in the dialog, tap the button "Copy an Auth Code". This will copy a limited-time auth code to the clipboard. Use the following API request to convert the auth code into an admin JWT.

Last 90

Providers overview last 90

create a network on the website
Code login

Auth

Wallet

Device

Feedback

Share code

Login with password

Password reset

Code create

Provider last 90

Create provider spec

Balance

Auth client

Create adopt code

Share status

Code login

Balance

Verify

Password set

Network create

Find providers

Add

Find locations

Clients

Verify send

Qr.png

Set name

Wallets

Referral code

Check balance code

Subscription

Connect

Adopt code

Account

Network

Transfer

Payout wallet

Control

Confirm share

Login

Find providers2

Qr.png

Send feedback

Stats

Circle transfer out

Set association name

Redeem balance code

Remove association

Network check

Create payment id

Confirm adopt

Remove client

Validate address

Circle init

Find provider locations

Adopt status

Create share code

Wallet

Remove adopt code

get

Get all providers in the caller network. Each provider includes stats from the last 24 hours.

Authorizations
Responses
200Success
application/json
get
GET /stats/providers HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "created_time": "text",
  "providers": [
    {
      "client_id": "text",
      "connected": true,
      "connected_events_last_24h": [
        {
          "event_time": "text",
          "connected": true
        }
      ],
      "uptime_last_24h": 1,
      "transfer_data_last_24h": 1,
      "payout_last_24h": 1,
      "search_interest_last_24h": 1,
      "contracts_last_24h": 1,
      "clients_last_24h": 1,
      "provide_mode": 1
    }
  ]
}
get

Simple hello to the network that returns some useful information. This can be used for discovery.

Responses
200Success
application/json
get
GET /hello HTTP/1.1
Host: api.bringyour.com
Accept: */*
200Success
{
  "client_address": "text"
}
post

Set account preferences.

Authorizations
Body
product_updatesbooleanOptional
Responses
200Success
application/json
Responseobject
post
POST /preferences/set-preferences HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "product_updates": true
}
200Success
{}
get

Get account preferences.

Authorizations
Responses
200Success
application/json
get
GET /preferences HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "product_updates": true
}
get

Get network statistics for the last 90 days. The statistics are updated approximately every 60s.

Responses
200Success
application/json
get
GET /stats/last-90 HTTP/1.1
Host: api.bringyour.com
Accept: */*
200Success
{
  "lookback": 1,
  "created_time": 1,
  "all_transfer_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "all_transfer_summary": 1,
  "all_transfer_summary_rate": 1,
  "all_packets_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "all_packets_summary": 1,
  "all_packets_summary_rate": 1,
  "providers_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "providers_superspeed_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "providers_summary": 1,
  "providers_summary_superspeed": 1,
  "countries_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "countries_summary": 1,
  "regions_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "regions_summary": 1,
  "cities_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "cities_summary": 1,
  "extender_transfer_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "extender_transfer_summary": 1,
  "extender_transfer_summary_rate": 1,
  "extenders_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "extenders_superspeed_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "extenders_summary": 1,
  "extenders_summary_superspeed": 1,
  "networks_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "networks_summary": 1,
  "devices_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "devices_summary": 1
}
get

Get statistics for all providers in the caller network for the last 90 days. This is meant to answer the top level question of how the providers in a network are performing.

Authorizations
Responses
200Success
application/json
get
GET /stats/providers-overview-last-90 HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "lookback": 1,
  "created_time": "text",
  "uptime": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "transfer_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "payout": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "search_interest": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "contracts": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "clients": {
    "ANY_ADDITIONAL_PROPERTY": 1
  }
}
post

Password login for email and phone number.

Body
user_authstringOptional

email or phone number

passwordstringOptional
Responses
200Success
application/json
post
POST /auth/login-with-password HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "user_auth": "text",
  "password": "text"
}
200Success
{
  "verification_required": {
    "user_auth": "text"
  },
  "network": {
    "by_jwt": "text",
    "name": "text"
  },
  "error": {
    "message": "text"
  }
}
post

Send password reset code to email or phone number.

Body
user_authstringOptional

email or phone number

Responses
200Success
application/json
post
POST /auth/password-reset HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "user_auth": "text"
}
200Success
{
  "user_auth": "text"
}
post

Create a limited use code (auth code) to share authentication with connected apps and tools. The code is tied to the caller session, and will be expired with any of the caller's sessions. Currently a code cannot be created for a client JWT (from /network/auth-client). This is a subset of an OAuth flow.

Body
duration_minutesnumberOptional
usesintegerOptional
Responses
200Success
application/json
post
POST /auth/code-create HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "duration_minutes": 1,
  "uses": 1
}
200Success
{
  "auth_code": "text",
  "duration_minutes": 1,
  "uses": 1,
  "error": {
    "auth_code_limit_exceeded": true,
    "message": "text"
  }
}
post

Get detailed stats on a single provider in the caller network. This is meant to give the user complete visibility over usage.

Authorizations
Body
client_idstringOptional

udid

Responses
200Success
application/json
post
POST /stats/provider-last-90 HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "client_id": "text"
}
200Success
{
  "lookback": 1,
  "created_time": "text",
  "uptime": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "transfer_data": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "payout": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "search_interest": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "contracts": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "clients": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "client_details": [
    {
      "client_id": "text",
      "transfer_data": {
        "ANY_ADDITIONAL_PROPERTY": 1
      }
    }
  ]
}
post

Create a spec object for find-providers2 using a description of the intended use of the network.

Body
querystringOptional

description of the intended use of the connection

Responses
200Success
application/json
post
POST /network/create-provider-spec HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "query": "text"
}
200Success
{
  "specs": [
    {
      "location_id": "text",
      "location_group_id": "text",
      "client_id": "text",
      "best_available": true
    }
  ]
}
get

Get the balance for the USDC user custody wallet. The user custody wallet allows BringYour to query the balance, but the user must take actions against the wallet.

Authorizations
Responses
200Success
application/json
get
GET /wallet/balance HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "wallet_info": {
    "wallet_id": "text",
    "token_id": "text",
    "blockchain": "text",
    "blockchain_symbol": "text",
    "create_date": "text",
    "balance_usdc_nano_cents": 1,
    "address": "text"
  }
}
post

Gain permission to use the connect protocol as the requested clientId, or assign a new clientId. Each network can have at most 128 clientIds. Above that number, new clientId requests will error until one or more existing clientIds are removed.

Authorizations
Body
client_idstringOptional

udid. Optional. If this is given, it must currently exist in the network. Omit this to assign a new client id.

descriptionstringOptional

If this is a new device, sets the device name to the description of the device.

device_specstringOptional

If this is a new device, sets the device spec.

derived_client_idstringOptional

udid. Optional. | The client that the new client is derived from. If this is called with a client jwt, the derived client id is inferred from the jwt.

Responses
200Success
application/json
post
POST /network/auth-client HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 89

{
  "client_id": "text",
  "description": "text",
  "device_spec": "text",
  "derived_client_id": "text"
}
200Success
{
  "by_client_jwt": "text",
  "error": {
    "client_limit_exceeded": true,
    "message": "text"
  }
}
post

Creates a code to adopt a device. The adopt code is valid for a limited time.

Body
device_namestringOptional

Name of the device that will be shared to the adopter

device_specstringOptional
Responses
200Success
application/json
post
POST /device/create-adopt-code HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "device_name": "text",
  "device_spec": "text"
}
200Success
{
  "adopt_code": "text",
  "adopt_secret": "text",
  "duration_minutes": 1,
  "error": {
    "message": "text"
  }
}
post

The status of the shared device. The status can be one of:

  • unassociated
  • associated pending confirmation
  • associated
Authorizations
Body
share_codestringOptional
Responses
200Success
application/json
post
POST /device/share-status HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 21

{
  "share_code": "text"
}
200Success
{
  "pending": true,
  "associated_network_name": "text",
  "error": {
    "message": "text"
  }
}
post

Authenticate with an auth code. The returned session is tied to the session that created the auth code, and will be expired with any of the creator's sessions. This is a subset of an OAuth flow.

Body
auth_codestringOptional
Responses
200Success
application/json
post
POST /auth/code-login HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "auth_code": "text"
}
200Success
{
  "by_jwt": "text",
  "error": {
    "message": "text"
  }
}
get

Get the current subscription status and transfer balance.

Authorizations
Responses
200Success
application/json
get
GET /subscription/balance HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "balance_byte_count": 1,
  "current_subscription": {
    "subscription_id": "text",
    "store": "text",
    "plan": "text"
  },
  "active_transfer_balances": [
    {
      "balance_id": "text",
      "network_id": "text",
      "start_time": "text",
      "end_time": "text",
      "start_balance_byte_count": 1,
      "net_revenue_nano_cents": 1,
      "balance_byte_count": 1
    }
  ],
  "pending_payout_usd_nano_cents": 1,
  "wallet_info": {
    "wallet_id": "text",
    "token_id": "text",
    "blockchain": "Polygon",
    "blockchain_symbol": "MATIC",
    "create_date": "text",
    "balance_usdc_nano_cents": 1,
    "address": "text"
  },
  "update_time": "text"
}
post

Verify ownership of email or phone number.

Body
user_authstringOptional

email or phone number

verify_codestringOptional
Responses
200Success
application/json
post
POST /auth/verify HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "user_auth": "text",
  "verify_code": "text"
}
200Success
{
  "network": {},
  "error": {}
}
post

Change password.

Body
reset_codestringOptional
passwordstringOptional
Responses
200Success
application/json
Responseobject
post
POST /auth/password-set HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "reset_code": "text",
  "password": "text"
}
200Success
{}
post

Create a new network. A user authority can be associated with at most one network.

Body
user_namestringOptional
user_authstringOptional

email or phone number

auth_jwtstringOptional
auth_jwt_typestring · enumOptionalPossible values:
passwordstringOptional
network_namestringOptional
termsbooleanOptional

user consent to accept terms of service

Responses
200Success
application/json
post
POST /auth/network-create HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 134

{
  "user_name": "text",
  "user_auth": "text",
  "auth_jwt": "text",
  "auth_jwt_type": "apple",
  "password": "text",
  "network_name": "text",
  "terms": true
}
200Success
{
  "network": {
    "by_jwt": "text",
    "network_id": "text",
    "network_name": "text"
  },
  "verification_required": {
    "user_auth": "text"
  },
  "error": {
    "message": "text"
  }
}
post

Randomly sample providers that for a location or group, which are active and in good health. This allows random iteration by using the exclude input to mark visited providers.

Body
location_idstringOptional

udid

location_group_idstringOptional

udid

countintegerOptional
exclude_location_idsstring[]Optional

udid

Responses
200Success
application/json
post
POST /network/find-providers HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "location_id": "text",
  "location_group_id": "text",
  "count": 1,
  "exclude_location_ids": [
    "text"
  ]
}
200Success
{
  "client_ids": [
    "text"
  ]
}
post

Add a device, which can either be owned by the network or shared with the network. The code provided can be either adoption code or a share code. Once a code is added, the device becomes an associated device until confirmation. If the device is a shared device, it will remain an associated device after confirmation.

Authorizations
Body
codestringOptional

share code or adopt code

Responses
200Success
application/json
post
POST /device/add HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "code": "text"
}
200Success
{
  "code_type": "share",
  "code": "text",
  "device_name": "text",
  "associated_network_name": "text",
  "client_id": "text",
  "duration_minutes": 1,
  "error": {
    "message": "text"
  }
}
post

Search for locations, groups, and devices that match a query, regardless of whether an providers are active.

Body
querystringOptional
max_distance_fractionnumberOptional
enable_max_distance_fractionbooleanOptional
Responses
200Success
application/json
post
POST /network/find-locations HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 78

{
  "query": "text",
  "max_distance_fraction": 1,
  "enable_max_distance_fraction": true
}
200Success
{
  "specs": [
    {
      "location_id": "text",
      "location_group_id": "text",
      "client_id": "text",
      "best_available": true
    }
  ],
  "groups": [
    {
      "location_group_id": "text",
      "name": "text",
      "provider_count": 1,
      "promoted": true,
      "match_distance": 1
    }
  ],
  "locations": [
    {
      "location_id": "text",
      "location_type": "city",
      "name": "text",
      "city": "text",
      "city_location_id": "text",
      "region": "text",
      "region_location_id": "text",
      "country": "text",
      "country_location_id": "text",
      "country_code": "text",
      "provider_count": 1,
      "match_distance": 1
    }
  ],
  "devices": [
    {
      "client_id": "text",
      "device_name": "text"
    }
  ]
}
get

Get the latest status of all clients on this network.

Includes:

  • Resident status, which is the platform counterpart for the client that handles control commands.
  • Connections, which are transports from the client to the platform. Note there can be multiple active connections for a single client.
  • Provide status
Authorizations
Responses
200Success
application/json
get
GET /network/clients HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "clients": [
    {
      "client_id": "text",
      "device_id": "text",
      "network_id": "text",
      "description": "text",
      "device_name": "text",
      "device_spec": "text",
      "create_time": "text",
      "auth_time": "text",
      "resident": {
        "client_id": "text",
        "instance_id": "text",
        "resident_id": "text",
        "resident_host": "text",
        "resident_service": "text",
        "resident_block": "text",
        "resident_internal_ports": [
          1
        ]
      },
      "provide_mode": 1,
      "connections": [
        {
          "client_id": "text",
          "connection_id": "text",
          "connect_time": "text",
          "disconnect_time": "text",
          "connection_host": "text",
          "connection_service": "text",
          "connection_block": null
        }
      ]
    }
  ]
}
post

Send verification code to email or phone number.

Body
user_authstringOptional

email or phone number

Responses
200Success
application/json
post
POST /auth/verify-send HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "user_auth": "text"
}
200Success
{
  "user_auth": "text"
}
get

A QR code that maps to a URL to add the shared device. Send it to someone to scan to add the device.

Authorizations
Path parameters
codestringRequired

Share code

Responses
200Success
image/png
Responsestring · binary
get
GET /device/share-code/{code}/qr.png HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
binary
post

Sets the name of a device owned by the network. To set the name of devices shared with the network, use /device/set-association-name.

Authorizations
Body
device_idstringOptional

udid

device_namestringOptional
Responses
200Success
application/json
post
POST /device/set-name HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "device_id": "text",
  "device_name": "text"
}
200Success
{
  "error": {
    "message": "text"
  }
}
get

Get a list of wallets associated with your network

Authorizations
Responses
200Success
application/json
get
GET /account/wallets HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "wallets": [
    {
      "wallet_id": "text",
      "circle_wallet_id": "text",
      "network_id": "text",
      "wallet_type": "circle_uc",
      "blockchain": "SOL",
      "wallet_address": "text",
      "active": true,
      "default_token_type": "USDC",
      "create_time": "text"
    }
  ]
}
get

Unique network code to refer new users

Authorizations
Responses
200Success
application/json
get
GET /account/referral-code HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "referral_code": "text"
}
post

Check if the balance code is valid.

Authorizations
Body
secretstringOptional
Responses
200Success
application/json
post
POST /subscription/check-balance-code HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "secret": "text"
}
200Success
{
  "balance": {
    "start_time": "text",
    "end_time": "text",
    "balance_byte_count": 1
  },
  "error": {
    "message": "text"
  }
}
get

Fetches the payout wallet associated with the network

Authorizations
Responses
200Success
application/json
get
GET /account/payout-wallet HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "wallet_id": "text"
}
post

Set an existing account wallet as the wallet to receive network payments.

Authorizations
Body
wallet_idstringOptional

udid

Responses
200Success
application/json
Responseobject
post
POST /account/payout-wallet HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "wallet_id": "text"
}
200Success
{}
post

Out-of-band control messages for the connect protocol. Blocking request-response control messages need to be handled out-of-band to resolve the possibility of dedlocks in the client sequence.

Authorizations
Body
packstring[]Optional

base64 encoded connect protobuf Pack processed as control messages. As an inline message, these would be sent to the control id.

Responses
200Success
application/json
post
POST /connect/control HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "pack": [
    "text"
  ]
}
200Success
{
  "pack": [
    "text"
  ],
  "error": {
    "message": "text"
  }
}
post

Confirm the share of a device. This must be called from the side that initiates the share.

Authorizations
Body
share_codestringOptional
associated_network_namestringOptional
Responses
200Success
application/json
post
POST /device/confirm-share HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 54

{
  "share_code": "text",
  "associated_network_name": "text"
}
200Success
{
  "associated_network_name": "text",
  "error": {
    "message": "text"
  }
}
post

Start a login for a user authority. The user authority may be:

  • email
  • phone number
  • Apple JWT
  • Google JWT
Body
user_authstringOptional

email or phone number

auth_jwtstringOptional
auth_jwt_typestring · enumOptionalPossible values:
Responses
200Success
application/json
post
POST /auth/login HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 62

{
  "user_auth": "text",
  "auth_jwt": "text",
  "auth_jwt_type": "apple"
}
200Success
{
  "user_name": "text",
  "user_auth": "text",
  "auth_allowed": [
    "password"
  ],
  "error": {
    "suggested_user_auth": "password",
    "message": "text"
  },
  "network": {
    "by_jwt": "text"
  }
}
post

Randomly sample providers for locations, groups, or devices, which are active and in good health. This allows random iteration by using the exclude input to mark visited providers.

Body
countintegerOptional
exclude_client_idsstring[]Optional

udid

Responses
200Success
application/json
post
POST /network/find-providers2 HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 176

{
  "specs": [
    {
      "location_id": "text",
      "location_group_id": "text",
      "client_id": "text",
      "best_available": true
    }
  ],
  "count": 1,
  "exclude_client_ids": [
    "text"
  ],
  "exclude_destinations": [
    [
      "text"
    ]
  ]
}
200Success
{
  "providers": [
    {}
  ]
}
get

A QR code that maps to a URL to adopt the device. Send it to someone to scan to adopt the device.

Path parameters
codestringRequired

Adopt code

Responses
200Success
image/png
Responsestring · binary
get
GET /device/adopt-code/{code}/qr.png HTTP/1.1
Host: api.bringyour.com
Accept: */*
200Success
binary
post

Feedback.

Authorizations
Body
Responses
200Success
application/json
Responseobject
post
POST /feedback/send-feedback HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 313

{
  "uses": {
    "personal": true,
    "business": true
  },
  "needs": {
    "private": true,
    "safe": true,
    "global": true,
    "collaborate": true,
    "app_control": true,
    "block_data_brokers": true,
    "block_ads": true,
    "focus": true,
    "connect_servers": true,
    "run_servers": true,
    "prevent_cyber": true,
    "audit": true,
    "zero_trust": true,
    "visualize": true,
    "other": "text"
  }
}
200Success
{}
get

Retrieves the paid and unpaid byte count provided to the network

Authorizations
Responses
200Success
application/json
get
GET /transfer/stats HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "paid_bytes_provided": 1,
  "unpaid_bytes_provided": 1
}
post

Set up a transfer from the Circle USDC user self custody wallet to an address. This starts a process that must be completed by the user.

Authorizations
Body
to_addressstringOptional
amount_usdc_nano_centsintegerOptional
termsbooleanOptional

user consent to accept terms of transfer

Responses
200Success
application/json
post
POST /wallet/circle-transfer-out HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 61

{
  "to_address": "text",
  "amount_usdc_nano_cents": 1,
  "terms": true
}
200Success
{
  "user_token": {
    "user_token": "text",
    "encryption_key": "text"
  },
  "challenge_id": "text",
  "error": {
    "message": "text"
  }
}
post

Set the name of the association. To set the name of devices owned by the network, use /device/set-name.

Authorizations
Body
codestringOptional
device_namestringOptional

Name of the device

Responses
200Success
application/json
post
POST /device/set-association-name HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 36

{
  "code": "text",
  "device_name": "text"
}
200Success
{
  "error": {
    "message": "text"
  }
}
post

Redeem the balance code and add the transfer balance to the caller network.

Authorizations
Body
secretstringOptional
Responses
200Success
application/json
post
POST /subscription/redeem-balance-code HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "secret": "text"
}
200Success
{
  "transfer_balance": {
    "transfer_balance_id": "text",
    "start_time": "text",
    "end_time": "text",
    "balance_byte_count": 1
  },
  "error": {
    "message": "text"
  }
}
post

Remove a device association. The association can be any of:

  • pending adoption device
  • incoming shared device (not owned by the caller network)
  • outgoing shared device (owned by the caller network)
Authorizations
Body
codestringOptional
Responses
200Success
application/json
post
POST /device/remove-association HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "code": "text"
}
200Success
{
  "error": {
    "message": "text"
  }
}
post

Check if the network name is available. A new network name must satisfy:

  • at least 3 characters different from an existing network name
  • at least 8 characters
  • domain name compatible (see RFC 5890)
  • not contain the dash (-) character (BringYour subdomains are reverse-flattened to a single level using dashes)
Body
network_namestringOptional
Responses
200Success
application/json
post
POST /auth/network-check HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "network_name": "text"
}
200Success
{
  "available": true
}
post

Creates an anonymous payment identifier to be used with purchases. This keeps network information out of the payment processor system. For example in Google Play this is called the "obfuscated account id".

Authorizations
Body
objectOptional
Responses
200Success
application/json
post
POST /subscription/create-payment-id HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
200Success
{
  "subscription_payment_id": "text",
  "error": {
    "message": "text"
  }
}
post

Confirm the adoption of a device. This must be called from the side that initiates the adoption.

Body
adopt_codestringOptional
adopt_secretstringOptional
associated_network_namestringOptional
Responses
200Success
application/json
post
POST /device/confirm-adopt HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 76

{
  "adopt_code": "text",
  "adopt_secret": "text",
  "associated_network_name": "text"
}
200Success
{
  "by_client_jwt": "text",
  "error": {
    "message": "text"
  }
}
post

Remove a client from the network.

Authorizations
Body
client_idstringOptional

udid

Responses
200Success
application/json
post
POST /network/remove-client HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "client_id": "text"
}
200Success
{
  "error": {
    "message": "text"
  }
}
post

Validate a USDC wallet address on the user custody wallet chain. This can be used to check whether an address can receive a transfer out from the user custody wallet. Please use this before initiating any transfer out to avoid lost funds.

Authorizations
Body
addressstringOptional
Responses
200Success
application/json
post
POST /wallet/validate-address HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "address": "text"
}
200Success
{
  "valid": true
}
post

Initialize the Circle USDC user self custody wallet. This starts a process that must be completed by the user.

Authorizations
Responses
200Success
application/json
post
POST /wallet/circle-init HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success
{
  "user_token": {
    "user_token": "text",
    "encryption_key": "text"
  },
  "challenge_id": "text",
  "error": {
    "message": "text"
  }
}
post

Search for locations and groups that match a query, where there are at least one active provider in good health. The match algorithm accounts for typos and misspelling, and the tolerance can be tuned in the input. Note that a location or group will need to be mapped to an actual provider using /network/find-providers.

Body
querystringOptional
max_distance_fractionnumberOptional
enable_max_distance_fractionbooleanOptional
Responses
200Success
application/json
post
POST /network/find-provider-locations HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 78

{
  "query": "text",
  "max_distance_fraction": 1,
  "enable_max_distance_fraction": true
}
200Success
{
  "specs": [
    {
      "location_id": "text",
      "location_group_id": "text",
      "client_id": "text",
      "best_available": true
    }
  ],
  "groups": [
    {
      "location_group_id": "text",
      "name": "text",
      "provider_count": 1,
      "promoted": true,
      "match_distance": 1
    }
  ],
  "locations": [
    {
      "location_id": "text",
      "location_type": "city",
      "name": "text",
      "city": "text",
      "city_location_id": "text",
      "region": "text",
      "region_location_id": "text",
      "country": "text",
      "country_location_id": "text",
      "country_code": "text",
      "provider_count": 1,
      "match_distance": 1
    }
  ],
  "devices": [
    {
      "client_id": "text",
      "device_name": "text"
    }
  ]
}
post

The status of the adopt-code device. The status can be one of:

  • unassociated
  • associated pending confirmation
  • associated
Body
adopt_codestringOptional
Responses
200Success
application/json
post
POST /device/adopt-status HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 21

{
  "adopt_code": "text"
}
200Success
{
  "pending": true,
  "associated_network_name": "text",
  "error": {
    "message": "text"
  }
}
post

Creates a code to share a device.

Authorizations
Body
client_idstringOptional

udid

device_namestringOptional

Name of the device that will be shared to the guest

Responses
200Success
application/json
post
POST /device/create-share-code HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "client_id": "text",
  "device_name": "text"
}
200Success
{
  "share_code": "text",
  "error": {
    "message": "text"
  }
}
post

Create a new wallet for your network. You can then use it as a payout wallet by posting to /account/payout-wallet.

Authorizations
Body
blockchainstring · enumOptional

The blockchain associated with the address

Possible values:
wallet_addressstringOptional

The "SOL" or "MATIC" wallet address

default_token_typestring · enumOptional

We only support "USDC"

Possible values:
Responses
200Success
application/json
post
POST /account/wallet HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 72

{
  "blockchain": "SOL",
  "wallet_address": "text",
  "default_token_type": "USDC"
}
200Success
{
  "wallet_id": "text"
}
post

Remove an adopt code. This must be called from the side that initiates the adoption.

Body
adopt_codestringOptional
adopt_secretstringOptional
Responses
200Success
application/json
post
POST /device/remove-adopt-code HTTP/1.1
Host: api.bringyour.com
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "adopt_code": "text",
  "adopt_secret": "text"
}
200Success
{
  "error": {
    "message": "text"
  }
}

Remove

Set provide

Associations

post

Remove a wallet from your list of account wallets

Authorizations
Body
wallet_idstringOptional

udid

Responses
200Success
application/json
post
POST /account/wallets/remove HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "wallet_id": "text"
}
200Success
{
  "success": true,
  "error": {
    "message": "text"
  }
}
post

Set the provide mode for a device.

Authorizations
Body
client_idstringOptional

udid

provide_modeone ofOptional
anyOptional
or
anyOptional
or
anyOptional
or
anyOptional
or
anyOptional
or
anyOptional
Responses
200Success
application/json
post
200Success
get

The devices associated with the caller network. Associated devices are:

  • pending adoption devices
  • incoming shared devices (not owned by the caller network)
  • outgoing shared devices (owned by the caller network)
Authorizations
Responses
200Success
application/json
get
200Success

Provider locations

POST /device/set-provide HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "client_id": "text",
  "provide_mode": 1
}
{
  "provide_mode": 1,
  "error": {
    "message": "text"
  }
}
GET /device/associations HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "pending_adoption_devices": [
    {
      "code": "text",
      "device_name": "text",
      "duration_minutes": 1
    }
  ],
  "incoming_shared_devices": [
    {
      "pending": true,
      "code": "text",
      "device_name": "text",
      "client_id": "text",
      "network_name": "text"
    }
  ],
  "outgoing_shared_devices": [
    {
      "pending": true,
      "code": "text",
      "device_name": "text",
      "client_id": "text",
      "network_name": "text"
    }
  ]
}
get

A list of locations and groups where there are at least one active provider in good health. Note that a location or group will need to be mapped to an actual provider using /network/find-providers.

Responses
200Success
application/json
get
GET /network/provider-locations HTTP/1.1
Host: api.bringyour.com
Accept: */*
200Success
{
  "specs": [
    {
      "location_id": "text",
      "location_group_id": "text",
      "client_id": "text",
      "best_available": true
    }
  ],
  "groups": [
    {
      "location_group_id": "text",
      "name": "text",
      "provider_count": 1,
      "promoted": true,
      "match_distance": 1
    }
  ],
  "locations": [
    {
      "location_id": "text",
      "location_type": "city",
      "name": "text",
      "city": "text",
      "city_location_id": "text",
      "region": "text",
      "region_location_id": "text",
      "country": "text",
      "country_location_id": "text",
      "country_code": "text",
      "provider_count": 1,
      "match_distance": 1
    }
  ],
  "devices": [
    {
      "client_id": "text",
      "device_name": "text"
    }
  ]
}