BringYour (2023.12.19)

Download OpenAPI specification:Download

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.

Stats Last 90

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

Responses

Response samples

Content type
application/json
{
  • "lookback": 0,
  • "created_time": 0,
  • "all_transfer_data": {
    },
  • "all_transfer_summary": 0,
  • "all_transfer_summary_rate": 0,
  • "all_packets_data": {
    },
  • "all_packets_summary": 0,
  • "all_packets_summary_rate": 0,
  • "providers_data": {
    },
  • "providers_superspeed_data": {
    },
  • "providers_summary": 0,
  • "providers_summary_superspeed": 0,
  • "countries_data": {
    },
  • "countries_summary": 0,
  • "regions_data": {
    },
  • "regions_summary": 0,
  • "cities_data": {
    },
  • "cities_summary": 0,
  • "extender_transfer_data": {
    },
  • "extender_transfer_summary": 0,
  • "extender_transfer_summary_rate": 0,
  • "extenders_data": {
    },
  • "extenders_superspeed_data": {
    },
  • "extenders_summary": 0,
  • "extenders_summary_superspeed": 0,
  • "networks_data": {
    },
  • "networks_summary": 0,
  • "devices_data": {
    },
  • "devices_summary": 0
}

Stats Providers Overview Last 90

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:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "lookback": 0,
  • "created_time": "string",
  • "uptime": {
    },
  • "transfer_data": {
    },
  • "payout": {
    },
  • "search_interest": {
    },
  • "contracts": {
    },
  • "clients": {
    }
}

Stats Providers

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

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "created_time": "string",
  • "providers": [
    ]
}

Stats Provider Last 90

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

Authorizations:
BearerAuth
Request Body schema: application/json
required
client_id
string

udid

Responses

Request samples

Content type
application/json
{
  • "client_id": "string"
}

Response samples

Content type
application/json
{
  • "lookback": 0,
  • "created_time": "string",
  • "uptime": {
    },
  • "transfer_data": {
    },
  • "payout": {
    },
  • "search_interest": {
    },
  • "contracts": {
    },
  • "clients": {
    },
  • "client_details": [
    ]
}

Auth Login

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

  • email
  • phone number
  • Apple JWT
  • Google JWT
Request Body schema: application/json
required
user_auth
string

email or phone number

auth_jwt
string
auth_jwt_type
string
Enum: "apple" "google"

Responses

Request samples

Content type
application/json
{
  • "user_auth": "string",
  • "auth_jwt": "string",
  • "auth_jwt_type": "apple"
}

Response samples

Content type
application/json
{
  • "user_name": "string",
  • "user_auth": "string",
  • "auth_allowed": [
    ],
  • "error": {
    },
  • "network": {
    }
}

Auth Login With Password

Password login for email and phone number.

Request Body schema: application/json
required
user_auth
string

email or phone number

password
string

Responses

Request samples

Content type
application/json
{
  • "user_auth": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "verification_required": {
    },
  • "network": {
    },
  • "error": {
    }
}

Auth Verify

Verify ownership of email or phone number.

Request Body schema: application/json
required
user_auth
string

email or phone number

verify_code
string

Responses

Request samples

Content type
application/json
{
  • "user_auth": "string",
  • "verify_code": "string"
}

Response samples

Content type
application/json
{
  • "network": { },
  • "error": { }
}

Auth Verify Send

Send verification code to email or phone number.

Request Body schema: application/json
required
user_auth
string

email or phone number

Responses

Request samples

Content type
application/json
{
  • "user_auth": "string"
}

Response samples

Content type
application/json
{
  • "user_auth": "string"
}

Auth Password Reset

Send password reset code to email or phone number.

Request Body schema: application/json
required
user_auth
string

email or phone number

Responses

Request samples

Content type
application/json
{
  • "user_auth": "string"
}

Response samples

Content type
application/json
{
  • "user_auth": "string"
}

Auth Password Set

Change password.

Request Body schema: application/json
required
reset_code
string
password
string

Responses

Request samples

Content type
application/json
{
  • "reset_code": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{ }

Auth Network Check

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)
Request Body schema: application/json
required
network_name
string

Responses

Request samples

Content type
application/json
{
  • "network_name": "string"
}

Response samples

Content type
application/json
{
  • "available": true
}

Auth Network Create

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

Request Body schema: application/json
required
user_name
string
user_auth
string

email or phone number

auth_jwt
string
auth_jwt_type
string
Enum: "apple" "google"
password
string
network_name
string
terms
boolean

user consent to accept terms of service

Responses

Request samples

Content type
application/json
{
  • "user_name": "string",
  • "user_auth": "string",
  • "auth_jwt": "string",
  • "auth_jwt_type": "apple",
  • "password": "string",
  • "network_name": "string",
  • "terms": true
}

Response samples

Content type
application/json
{
  • "network": {
    },
  • "verification_required": {
    },
  • "error": {
    }
}

Auth Code Create

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.

Request Body schema: application/json
required
duration_minutes
number
uses
integer

Responses

Request samples

Content type
application/json
{
  • "duration_minutes": 0,
  • "uses": 0
}

Response samples

Content type
application/json
{
  • "auth_code": "string",
  • "duration_minutes": 0,
  • "uses": 0,
  • "error": {
    }
}

Auth Code Login

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.

Request Body schema: application/json
required
auth_code
string

Responses

Request samples

Content type
application/json
{
  • "auth_code": "string"
}

Response samples

Content type
application/json
{
  • "by_jwt": "string",
  • "error": {
    }
}

Auth Network Client

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:
BearerAuth
Request Body schema: application/json
required
client_id
string

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

description
string

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

device_spec
string

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

derived_client_id
string

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

Request samples

Content type
application/json
{
  • "client_id": "string",
  • "description": "string",
  • "device_spec": "string",
  • "derived_client_id": "string"
}

Response samples

Content type
application/json
{
  • "by_client_jwt": "string",
  • "error": {
    }
}

Remove Network Client

Remove a client from the network.

Authorizations:
BearerAuth
Request Body schema: application/json
required
client_id
string

udid

Responses

Request samples

Content type
application/json
{
  • "client_id": "string"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Network Clients

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:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "clients": [
    ]
}

Preferences Set

Set account preferences.

Authorizations:
BearerAuth
Request Body schema: application/json
required
product_updates
boolean

Responses

Request samples

Content type
application/json
{
  • "product_updates": true
}

Response samples

Content type
application/json
{ }

Feedback Send

Feedback.

Authorizations:
BearerAuth
Request Body schema: application/json
required
object
object

Responses

Request samples

Content type
application/json
{
  • "uses": {
    },
  • "needs": {
    }
}

Response samples

Content type
application/json
{ }

Network Provider Locations

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

Response samples

Content type
application/json
{
  • "specs": [
    ],
  • "groups": [
    ],
  • "locations": [
    ],
  • "devices": [
    ]
}

Network Find Provider Locations

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.

Request Body schema: application/json
required
query
string
max_distance_fraction
number
enable_max_distance_fraction
boolean

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "max_distance_fraction": 0,
  • "enable_max_distance_fraction": true
}

Response samples

Content type
application/json
{
  • "specs": [
    ],
  • "groups": [
    ],
  • "locations": [
    ],
  • "devices": [
    ]
}

Network Find Locations

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

Request Body schema: application/json
required
query
string
max_distance_fraction
number
enable_max_distance_fraction
boolean

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "max_distance_fraction": 0,
  • "enable_max_distance_fraction": true
}

Response samples

Content type
application/json
{
  • "specs": [
    ],
  • "groups": [
    ],
  • "locations": [
    ],
  • "devices": [
    ]
}

Network Find Providers

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.

Request Body schema: application/json
required
location_id
string

udid

location_group_id
string

udid

count
integer
exclude_location_ids
Array of strings

Responses

Request samples

Content type
application/json
{
  • "location_id": "string",
  • "location_group_id": "string",
  • "count": 0,
  • "exclude_location_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "client_ids": [
    ]
}

Network Find Providers 2

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.

Request Body schema: application/json
required
Array of objects (ProviderSpec)
count
integer
exclude_client_ids
Array of strings

Responses

Request samples

Content type
application/json
{
  • "specs": [
    ],
  • "count": 0,
  • "exclude_client_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "providers": [
    ]
}

Network Find Providers Spec

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

Request Body schema: application/json
required
query
string

description of the intended use of the connection

Responses

Request samples

Content type
application/json
{
  • "query": "string"
}

Response samples

Content type
application/json
{
  • "specs": [
    ]
}

Wallet Balance

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:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "wallet_info": {
    }
}

Wallet Validate Address

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:
BearerAuth
Request Body schema: application/json
required
address
string

Responses

Request samples

Content type
application/json
{
  • "address": "string"
}

Response samples

Content type
application/json
{
  • "valid": true
}

Wallet Circle Init

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

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "user_token": {
    },
  • "challenge_id": "string",
  • "error": {
    }
}

Wallet Circle Init

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:
BearerAuth
Request Body schema: application/json
required
to_address
string
amount_usdc_nano_cents
integer
terms
boolean

user consent to accept terms of transfer

Responses

Request samples

Content type
application/json
{
  • "to_address": "string",
  • "amount_usdc_nano_cents": 0,
  • "terms": true
}

Response samples

Content type
application/json
{
  • "user_token": {
    },
  • "challenge_id": "string",
  • "error": {
    }
}

Subscription Balance

Get the current subscription status and transfer balance.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "balance_byte_count": 0,
  • "current_subscription": {
    },
  • "active_transfer_balances": [
    ],
  • "pending_payout_usd_nano_cents": 0,
  • "wallet_info": {
    },
  • "update_time": "string"
}

Subscription Check Balance Code

Check if the balance code is valid.

Authorizations:
BearerAuth
Request Body schema: application/json
required
secret
string

Responses

Request samples

Content type
application/json
{
  • "secret": "string"
}

Response samples

Content type
application/json
{
  • "balance": {
    },
  • "error": {
    }
}

Subscription Redeem Balance Code

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

Authorizations:
BearerAuth
Request Body schema: application/json
required
secret
string

Responses

Request samples

Content type
application/json
{
  • "secret": "string"
}

Response samples

Content type
application/json
{
  • "transfer_balance": {
    },
  • "error": {
    }
}

Subscription Create Payment Id

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:
BearerAuth
Request Body schema: application/json
required
object (SubscriptionCreatePaymentIdArgs)

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "subscription_payment_id": "string",
  • "error": {
    }
}

Device Add

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:
BearerAuth
Request Body schema: application/json
required
code
string

share code or adopt code

Responses

Request samples

Content type
application/json
{
  • "code": "string"
}

Response samples

Content type
application/json
{
  • "code_type": "share",
  • "code": "string",
  • "device_name": "string",
  • "associated_network_name": "string",
  • "client_id": "string",
  • "duration_minutes": 0,
  • "error": {
    }
}

Device Create Share Code

Creates a code to share a device.

Authorizations:
BearerAuth
Request Body schema: application/json
required
client_id
string

udid

device_name
string

Name of the device that will be shared to the guest

Responses

Request samples

Content type
application/json
{
  • "client_id": "string",
  • "device_name": "string"
}

Response samples

Content type
application/json
{
  • "share_code": "string",
  • "error": {
    }
}

Device Share Code QR

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

Authorizations:
BearerAuth
path Parameters
code
required
string

Share code

Responses

Device Share Status

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

  • unassociated
  • associated pending confirmation
  • associated
Authorizations:
BearerAuth
Request Body schema: application/json
required
share_code
string

Responses

Request samples

Content type
application/json
{
  • "share_code": "string"
}

Response samples

Content type
application/json
{
  • "pending": true,
  • "associated_network_name": "string",
  • "error": {
    }
}

Device Confirm Share

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

Authorizations:
BearerAuth
Request Body schema: application/json
required
share_code
string
associated_network_name
string

Responses

Request samples

Content type
application/json
{
  • "share_code": "string",
  • "associated_network_name": "string"
}

Response samples

Content type
application/json
{
  • "associated_network_name": "string",
  • "error": {
    }
}

Device Create Adopt Code

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

Request Body schema: application/json
required
device_name
string

Name of the device that will be shared to the adopter

device_spec
string

Responses

Request samples

Content type
application/json
{
  • "device_name": "string",
  • "device_spec": "string"
}

Response samples

Content type
application/json
{
  • "adopt_code": "string",
  • "adopt_secret": "string",
  • "duration_minutes": 0,
  • "error": {
    }
}

Device Adopt Code QR

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

path Parameters
code
required
string

Adopt code

Responses

Device Adopt Status

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

  • unassociated
  • associated pending confirmation
  • associated
Request Body schema: application/json
required
adopt_code
string

Responses

Request samples

Content type
application/json
{
  • "adopt_code": "string"
}

Response samples

Content type
application/json
{
  • "pending": true,
  • "associated_network_name": "string",
  • "error": {
    }
}

Device Confirm Adopt

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

Request Body schema: application/json
required
adopt_code
string
adopt_secret
string
associated_network_name
string

Responses

Request samples

Content type
application/json
{
  • "adopt_code": "string",
  • "adopt_secret": "string",
  • "associated_network_name": "string"
}

Response samples

Content type
application/json
{
  • "by_client_jwt": "string",
  • "error": {
    }
}

Remove Adopt Code

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

Request Body schema: application/json
required
adopt_code
string
adopt_secret
string

Responses

Request samples

Content type
application/json
{
  • "adopt_code": "string",
  • "adopt_secret": "string"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Device Associations

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:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "pending_adoption_devices": [
    ],
  • "incoming_shared_devices": [
    ],
  • "outgoing_shared_devices": [
    ]
}

Device Remove Association

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:
BearerAuth
Request Body schema: application/json
required
code
string

Responses

Request samples

Content type
application/json
{
  • "code": "string"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Device Set Association Name

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

Authorizations:
BearerAuth
Request Body schema: application/json
required
code
string
device_name
string

Name of the device

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "device_name": "string"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Network Set Device Name

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:
BearerAuth
Request Body schema: application/json
required
device_id
string

udid

device_name
string

Responses

Request samples

Content type
application/json
{
  • "device_id": "string",
  • "device_name": "string"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Device Set Provide

Set the provide mode for a device.

Authorizations:
BearerAuth
Request Body schema: application/json
required
client_id
string

udid

ProvideModeDefault-1 (any) or ProvideModeNone0 (any) or ProvideModeNetwork1 (any) or ProvideModeFriendsAndFamily2 (any) or ProvideModePublic3 (any) or ProvideModeStream4 (any) (ProvideMode)

Responses

Request samples

Content type
application/json
{
  • "client_id": "string",
  • "provide_mode": -1
}

Response samples

Content type
application/json
{
  • "provide_mode": -1,
  • "error": {
    }
}

Connect Control

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:
BearerAuth
Request Body schema: application/json
required
pack
Array of strings

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

Responses

Request samples

Content type
application/json
{
  • "pack": [
    ]
}

Response samples

Content type
application/json
{
  • "pack": [
    ],
  • "error": {
    }
}