Menu

P2P apps

Signalling, relay, TURN and an offline mailbox for browser and device apps.

OperationMethod and path
Create a p2p appPOST /p2p/apps
The caller's p2p appsGET /p2p/apps
One of the caller's p2p appsGET /p2p/apps/{id}
Change a p2p appPATCH /p2p/apps/{id}
Delete a p2p appDELETE /p2p/apps/{id}
Attach one of the caller's own hostnames to a p2p appPOST /p2p/apps/{id}/domains
A p2p app's own domains, oldest firstGET /p2p/apps/{id}/domains
Detach an app domainDELETE /p2p/apps/{id}/domains/{domain_id}
Re-check an app domain's DNS nowPOST /p2p/apps/{id}/domains/{domain_id}/verify-dns
Mint a mailbox token for a p2p appPOST /p2p/apps/{id}/mailbox-credentials
Mint TURN credentials for a p2p appPOST /p2p/apps/{id}/turn-credentials

Create a p2p app#

POST /p2p/apps · operation createP2pApp

name (a DNS label: 1..63 of a-z, 0-9 and interior hyphens; the app answers on <name>.<p2p domain>), origins (exact web origins or *.domain.tld wildcards, at most 20; empty admits any origin), settings (known limit keys, positive integers clamped at their ceilings), mailbox_enabled (default false). Its default hostname works at once. Apps may be billed by the hour (billing in the answer; 402 insufficient-funds when the credits do not cover the first hour). Delete it with DELETE /p2p/apps/{id} to stop its billing. Cost (credit charges in GET /credits/charges): the per_hour credit charge of recurring.p2p-app-hourly is billed every hour while what it creates exists; the per_mb_hour_cached credit charge of recurring.p2p-app-hourly times the mailbox's cached MB is billed every hour while what it creates exists; the per_mb_relayed credit charge of p2p.relay-traffic is billed per use; the per_mb_served_mailbox credit charge of p2p.mailbox-traffic is billed per use.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Strong authenticationa session needs an authenticator enrolled and a recent proof of it (a step-up in the last 15 minutes, or totp_code / backup_code in the body); an API key is not asked — see authentication
Chargedyes — see the charges below
Retry safetya repeat is refused or changes nothing: an app name is unique: a repeat is refused 409 conflict (the name is taken)

Credit charges (each a contract of the list of credit charges; the credit charge in force is filled in from the API):

ContractRateWhenTimesCredit charge in force
recurring.p2p-app-hourlyper_hourevery hour while it exists—see the credit charges
recurring.p2p-app-hourlyper_mb_hour_cachedevery hour while it existsthe mailbox's cached MBsee the credit charges
p2p.relay-trafficper_mb_relayedper use—see the credit charges
p2p.mailbox-trafficper_mb_served_mailboxper use—see the credit charges

Request body (CreateP2pApp):

  • name, string, required — a DNS label: 1-63 of a-z, 0-9 and interior hyphens
  • origins, array of strings — exact web origins or *.domain.tld wildcards, at most 20; [] admits any origin
  • settings, object — the app's limits: each key a positive integer, clamped at its maximum; a key not sent keeps its default
    • max_rooms, integer — rooms open at once; default 500 (1 to 100000)
    • max_bytes_per_sec, integer — signaling bytes a second; default 262144 (1 to 16777216)
    • relay_circuit_duration_sec, integer — seconds one relayed circuit lasts; default 3600 (1 to 86400)
    • message_burst, integer — signaling burst (absent: the node's own limit) (1 to 100000)
    • mailbox_max_message_kb, integer — KB of one mailbox message; default 64 (1 to 10240)
    • mailbox_mint_app_per_min, integer — mailbox credentials the app may mint a minute; default 600 (1 to 100000)
    • max_relay_reservations, integer — relay reservations; default 128 (1 to 100000)
    • max_relay_conns_per_ip, integer — relay connections from one client address; default 20 (1 to 100000)
    • max_room_peers, integer — peers in one room; default 16 (1 to 100000)
    • mailbox_max_mb, integer — MB the mailbox holds; default 256 (1 to 10240)
    • max_conns_per_ip, integer — connections from one client address; default 20 (1 to 100000)
    • mailbox_ttl_hours, integer — hours a mailbox message is kept; default 24 (1 to 2160)
    • max_relay_circuits, integer — relay circuits; default 64 (1 to 100000)
    • relay_circuit_data_mb, integer — MB one relayed circuit carries; default 512 (1 to 1048576)
    • mailbox_mint_ip_per_min, integer — mailbox credentials one client address may mint a minute; default 10 (1 to 100000)
    • max_relay_bytes_per_sec, integer — relayed bytes a second; default 262144 (1 to 16777216)
    • messages_per_sec, integer — signaling messages a second (absent: the node's own limit) (1 to 100000)
  • mailbox_enabled, boolean (default false)

Answer 201 (P2pAppResult): the result

  • app, object, required
    • mailbox_enabled, boolean
    • hostname, string, required
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • settings, object — the server defaults under the customer's limits
    • relay_enabled, boolean
    • billing, object or null — the hourly billing of a tunnel or an app (null when it is not billed)
      • state, string, required — off: not billed; grace: an hourly charge was refused and it still serves until suspend_at; suspended: not served until the hours are paid; if still unpaid after its retention, deleted no sooner than delete_at: the deletion is announced beforehand (72 hours by default) and, by default, happens only once our team approved it (one of off, ok, grace, suspended)
      • paid_through, string or null
      • unpaid_since, string
      • suspend_at, string
      • suspended_at, string
      • delete_at, string
    • id, string, required
    • name, string, required
    • ice_urls, array of strings
    • cached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)
    • updated_at, string
    • domains, array of objects
      • hostname, string, required
      • dns_error, string or null
      • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
        • state, string, required (one of suspended, blocked)
        • reason, string, required (must be "abuse-review")
        • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
        • contact, string — the abuse contact address to write to about it
      • id, string, required
      • dns_cname_target, string or null
      • cert_status, string or null
      • dns_target, string or null
      • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
      • dns_ok, boolean
      • created_at, string
      • last_error, string or null
      • wildcard, boolean
    • relay_peer_id, string or null
    • state, string, required
    • turn_credentials_url, string
    • created_at, string
    • origins, array of strings
    • last_error, string or null — what went wrong last, when anything did
    • mailbox_url, string or null
    • mailbox_open_mint, boolean
    • relay_multiaddrs, array of strings
    • signaling_url, string
    • node, object or null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (with field; also the per-account app limit)
401unauthorizedunauthorized
402insufficient-fundsinsufficient-funds (the credits do not cover the first hour: top up)
403account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); enrolment-required (a session caller whose account has no authenticator: enrol one first) or step-up-required (a session without a recent step-up: POST /auth/step-up, then retry); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
409conflictconflict (the name is taken)
422invalid-totpinvalid-totp (a wrong or replayed authenticator code)
429rate-limitedrate-limited
451hostname-blockedhostname-blocked (the hostname or content was blocked after a review: reason abuse-review; contest it through a support ticket or contact)
502upstream-unavailableupstream-unavailable (try again later)
503capacity-unavailable, charge-not-set, unavailablecapacity-unavailable (no capacity now: try again later), or unavailable (p2p apps are not available now), or charge-not-set (its credit charge is not set yet: nothing was created or charged)

Example

curl -X POST 'https://api.weird.ro/p2p/apps' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<name>"}'

With the CLI (weird p2p create):

$ weird p2p create <name>

MCP: weird_p2p_app_create.

The caller's p2p apps#

GET /p2p/apps · operation listP2pApps

Newest first, deleted ones excluded. Cost (credit charges in GET /credits/charges): the per_request credit charge of p2p.reads is charged for each call that answers successfully, after it has answered (a refused or failed call is not charged); the calls are added up and taken from the credits every hour.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:read
Chargedyes — see the charges below
Retry safetya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again

Credit charges (each a contract of the list of credit charges; the credit charge in force is filled in from the API):

ContractRateWhenTimesCredit charge in force
p2p.readsper_requestafter a successful answer—see the credit charges

Answer 200 (P2pAppList): the result

  • apps, array of objects, required
    • mailbox_enabled, boolean
    • hostname, string, required
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • settings, object — the server defaults under the customer's limits
    • relay_enabled, boolean
    • billing, object or null — the hourly billing of a tunnel or an app (null when it is not billed)
      • state, string, required — off: not billed; grace: an hourly charge was refused and it still serves until suspend_at; suspended: not served until the hours are paid; if still unpaid after its retention, deleted no sooner than delete_at: the deletion is announced beforehand (72 hours by default) and, by default, happens only once our team approved it (one of off, ok, grace, suspended)
      • paid_through, string or null
      • unpaid_since, string
      • suspend_at, string
      • suspended_at, string
      • delete_at, string
    • id, string, required
    • name, string, required
    • ice_urls, array of strings
    • cached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)
    • updated_at, string
    • domains, array of objects
      • hostname, string, required
      • dns_error, string or null
      • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
        • state, string, required (one of suspended, blocked)
        • reason, string, required (must be "abuse-review")
        • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
        • contact, string — the abuse contact address to write to about it
      • id, string, required
      • dns_cname_target, string or null
      • cert_status, string or null
      • dns_target, string or null
      • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
      • dns_ok, boolean
      • created_at, string
      • last_error, string or null
      • wildcard, boolean
    • relay_peer_id, string or null
    • state, string, required
    • turn_credentials_url, string
    • created_at, string
    • origins, array of strings
    • last_error, string or null — what went wrong last, when anything did
    • mailbox_url, string or null
    • mailbox_open_mint, boolean
    • relay_multiaddrs, array of strings
    • signaling_url, string
    • node, object or null
  • count, integer, required

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503unavailableunavailable (try again later)

Example

curl -X GET 'https://api.weird.ro/p2p/apps' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird p2p list, weird p2p delete, weird p2p domains):

$ weird p2p list$ weird p2p delete <app>$ weird p2p domains <app>

MCP: weird_p2p_apps.

One of the caller's p2p apps#

GET /p2p/apps/{id} · operation getP2pApp

The p2p app id (GET /p2p/apps lists them): its name, hostname, origins, settings, mailbox and relay switches and billing. An unknown or another account's app is 404 alike. Changes nothing. Cost (credit charges in GET /credits/charges): the per_request credit charge of p2p.reads is charged for each call that answers successfully, after it has answered (a refused or failed call is not charged); the calls are added up and taken from the credits every hour.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:read
Chargedyes — see the charges below
Retry safetya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again

Credit charges (each a contract of the list of credit charges; the credit charge in force is filled in from the API):

ContractRateWhenTimesCredit charge in force
p2p.readsper_requestafter a successful answer—see the credit charges

Parameters

NameInTypeRequiredDescription
idpathstringyes

Answer 200 (P2pAppResult): the result

  • app, object, required
    • mailbox_enabled, boolean
    • hostname, string, required
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • settings, object — the server defaults under the customer's limits
    • relay_enabled, boolean
    • billing, object or null — the hourly billing of a tunnel or an app (null when it is not billed)
      • state, string, required — off: not billed; grace: an hourly charge was refused and it still serves until suspend_at; suspended: not served until the hours are paid; if still unpaid after its retention, deleted no sooner than delete_at: the deletion is announced beforehand (72 hours by default) and, by default, happens only once our team approved it (one of off, ok, grace, suspended)
      • paid_through, string or null
      • unpaid_since, string
      • suspend_at, string
      • suspended_at, string
      • delete_at, string
    • id, string, required
    • name, string, required
    • ice_urls, array of strings
    • cached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)
    • updated_at, string
    • domains, array of objects
      • hostname, string, required
      • dns_error, string or null
      • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
        • state, string, required (one of suspended, blocked)
        • reason, string, required (must be "abuse-review")
        • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
        • contact, string — the abuse contact address to write to about it
      • id, string, required
      • dns_cname_target, string or null
      • cert_status, string or null
      • dns_target, string or null
      • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
      • dns_ok, boolean
      • created_at, string
      • last_error, string or null
      • wildcard, boolean
    • relay_peer_id, string or null
    • state, string, required
    • turn_credentials_url, string
    • created_at, string
    • origins, array of strings
    • last_error, string or null — what went wrong last, when anything did
    • mailbox_url, string or null
    • mailbox_open_mint, boolean
    • relay_multiaddrs, array of strings
    • signaling_url, string
    • node, object or null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found (an unknown app, another customer's alike)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503unavailableunavailable (try again later)

Example

curl -X GET 'https://api.weird.ro/p2p/apps/{id}' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird p2p get):

$ weird p2p get <app>

MCP: weird_p2p_apps.

Change a p2p app#

PATCH /p2p/apps/{id} · operation updateP2pApp

Each of origins and settings a full replace; relay_enabled, mailbox_enabled and mailbox_open_mint strict booleans; a key left out is untouched; at least one key. Refused while the app is deleting. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body (UpdateP2pApp):

  • origins, array of strings
  • settings, object — the app's limits: each key a positive integer, clamped at its maximum; a key not sent keeps its default
    • max_rooms, integer — rooms open at once; default 500 (1 to 100000)
    • max_bytes_per_sec, integer — signaling bytes a second; default 262144 (1 to 16777216)
    • relay_circuit_duration_sec, integer — seconds one relayed circuit lasts; default 3600 (1 to 86400)
    • message_burst, integer — signaling burst (absent: the node's own limit) (1 to 100000)
    • mailbox_max_message_kb, integer — KB of one mailbox message; default 64 (1 to 10240)
    • mailbox_mint_app_per_min, integer — mailbox credentials the app may mint a minute; default 600 (1 to 100000)
    • max_relay_reservations, integer — relay reservations; default 128 (1 to 100000)
    • max_relay_conns_per_ip, integer — relay connections from one client address; default 20 (1 to 100000)
    • max_room_peers, integer — peers in one room; default 16 (1 to 100000)
    • mailbox_max_mb, integer — MB the mailbox holds; default 256 (1 to 10240)
    • max_conns_per_ip, integer — connections from one client address; default 20 (1 to 100000)
    • mailbox_ttl_hours, integer — hours a mailbox message is kept; default 24 (1 to 2160)
    • max_relay_circuits, integer — relay circuits; default 64 (1 to 100000)
    • relay_circuit_data_mb, integer — MB one relayed circuit carries; default 512 (1 to 1048576)
    • mailbox_mint_ip_per_min, integer — mailbox credentials one client address may mint a minute; default 10 (1 to 100000)
    • max_relay_bytes_per_sec, integer — relayed bytes a second; default 262144 (1 to 16777216)
    • messages_per_sec, integer — signaling messages a second (absent: the node's own limit) (1 to 100000)
  • relay_enabled, boolean
  • mailbox_enabled, boolean
  • mailbox_open_mint, boolean

Answer 200 (P2pAppResult): the result

  • app, object, required
    • mailbox_enabled, boolean
    • hostname, string, required
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • settings, object — the server defaults under the customer's limits
    • relay_enabled, boolean
    • billing, object or null — the hourly billing of a tunnel or an app (null when it is not billed)
      • state, string, required — off: not billed; grace: an hourly charge was refused and it still serves until suspend_at; suspended: not served until the hours are paid; if still unpaid after its retention, deleted no sooner than delete_at: the deletion is announced beforehand (72 hours by default) and, by default, happens only once our team approved it (one of off, ok, grace, suspended)
      • paid_through, string or null
      • unpaid_since, string
      • suspend_at, string
      • suspended_at, string
      • delete_at, string
    • id, string, required
    • name, string, required
    • ice_urls, array of strings
    • cached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)
    • updated_at, string
    • domains, array of objects
      • hostname, string, required
      • dns_error, string or null
      • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
        • state, string, required (one of suspended, blocked)
        • reason, string, required (must be "abuse-review")
        • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
        • contact, string — the abuse contact address to write to about it
      • id, string, required
      • dns_cname_target, string or null
      • cert_status, string or null
      • dns_target, string or null
      • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
      • dns_ok, boolean
      • created_at, string
      • last_error, string or null
      • wildcard, boolean
    • relay_peer_id, string or null
    • state, string, required
    • turn_credentials_url, string
    • created_at, string
    • origins, array of strings
    • last_error, string or null — what went wrong last, when anything did
    • mailbox_url, string or null
    • mailbox_open_mint, boolean
    • relay_multiaddrs, array of strings
    • signaling_url, string
    • node, object or null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (with field)
401unauthorizedunauthorized
403account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
409conflictconflict (deleting)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503unavailableunavailable (try again later)

Example

curl -X PATCH 'https://api.weird.ro/p2p/apps/{id}' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

With the CLI (weird p2p update):

$ weird p2p update <app>

MCP: weird_p2p_app_update.

Delete a p2p app#

DELETE /p2p/apps/{id} · operation deleteP2pApp

The app moves to deleting until it is torn down (only then is its name free again). Safe to repeat while deleting. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Strong authenticationa session needs an authenticator enrolled and a recent proof of it (a step-up in the last 15 minutes, or totp_code / backup_code in the body); an API key is not asked — see authentication
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Answer 200 (P2pAppResult): the result

  • app, object, required
    • mailbox_enabled, boolean
    • hostname, string, required
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • settings, object — the server defaults under the customer's limits
    • relay_enabled, boolean
    • billing, object or null — the hourly billing of a tunnel or an app (null when it is not billed)
      • state, string, required — off: not billed; grace: an hourly charge was refused and it still serves until suspend_at; suspended: not served until the hours are paid; if still unpaid after its retention, deleted no sooner than delete_at: the deletion is announced beforehand (72 hours by default) and, by default, happens only once our team approved it (one of off, ok, grace, suspended)
      • paid_through, string or null
      • unpaid_since, string
      • suspend_at, string
      • suspended_at, string
      • delete_at, string
    • id, string, required
    • name, string, required
    • ice_urls, array of strings
    • cached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)
    • updated_at, string
    • domains, array of objects
      • hostname, string, required
      • dns_error, string or null
      • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
        • state, string, required (one of suspended, blocked)
        • reason, string, required (must be "abuse-review")
        • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
        • contact, string — the abuse contact address to write to about it
      • id, string, required
      • dns_cname_target, string or null
      • cert_status, string or null
      • dns_target, string or null
      • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
      • dns_ok, boolean
      • created_at, string
      • last_error, string or null
      • wildcard, boolean
    • relay_peer_id, string or null
    • state, string, required
    • turn_credentials_url, string
    • created_at, string
    • origins, array of strings
    • last_error, string or null — what went wrong last, when anything did
    • mailbox_url, string or null
    • mailbox_open_mint, boolean
    • relay_multiaddrs, array of strings
    • signaling_url, string
    • node, object or null

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); enrolment-required (a session caller whose account has no authenticator: enrol one first) or step-up-required (a session without a recent step-up: POST /auth/step-up, then retry); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
422invalid-totpinvalid-totp (a wrong or replayed authenticator code)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503unavailableunavailable (try again later)

Example

curl -X DELETE 'https://api.weird.ro/p2p/apps/{id}' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird p2p delete):

$ weird p2p delete <app>

MCP: weird_p2p_app_delete.

Attach one of the caller's own hostnames to a p2p app#

POST /p2p/apps/{id}/domains · operation attachP2pAppDomain

hostname (*.example.com, or wildcard true, for a wildcard: its zone must be hosted for the caller). A hostname under a domain another account registered here is refused 404, and one another product already serves (a tunnel, an IPFS gateway domain, a hostname connected to a VPS instance) 409 conflict. One app per hostname and at most 5 hostnames per app. Point the name at the app (a CNAME to dns_cname_target, or an A at a zone apex to dns_target, no AAAA elsewhere): the domain moves from pending-dns to provisioning once that has resolved for two minutes. Not charged. Detach it with DELETE /p2p/apps/{id}/domains/{domain_id}.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body (AttachP2pAppDomain):

  • hostname, string, required — a fully qualified name; *.name for a wildcard
  • wildcard, boolean

Answer 201 (P2pAppDomainResult): the result

  • domain, object, required
    • hostname, string, required
    • dns_error, string or null
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • id, string, required
    • dns_cname_target, string or null
    • cert_status, string or null
    • dns_target, string or null
    • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
    • dns_ok, boolean
    • created_at, string
    • last_error, string or null
    • wildcard, boolean

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (field hostname or wildcard; the per-app cap)
401unauthorizedunauthorized
403account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found (the app; a hostname under another account's domain)
409conflictconflict (the name is attached or used by another product; the app is deleting)
429rate-limitedrate-limited
451hostname-blockedhostname-blocked (the hostname or content was blocked after a review: reason abuse-review; contest it through a support ticket or contact)
502upstream-unavailableupstream-unavailable (try again later)
503capacity-unavailable, unavailablecapacity-unavailable (the app is being moved: try again later) or unavailable (try again later)

Example

curl -X POST 'https://api.weird.ro/p2p/apps/{id}/domains' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname":"<hostname>"}'

With the CLI (weird p2p domains attach):

$ weird p2p domains attach <app> <hostname>

MCP: weird_p2p_domain_attach.

A p2p app's own domains, oldest first#

GET /p2p/apps/{id}/domains · operation listP2pAppDomains

The domains of the app id attached with POST /p2p/apps/{id}/domains, oldest first, each with its state, the DNS record it needs (dns_target, dns_cname_target) and whether it answers yet (dns_ok). Changes nothing. Cost (credit charges in GET /credits/charges): the per_request credit charge of p2p.reads is charged for each call that answers successfully, after it has answered (a refused or failed call is not charged); the calls are added up and taken from the credits every hour.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:read
Chargedyes — see the charges below
Retry safetya repeat makes a second one and is charged again: each successful call is charged as one request: a repeat after a lost answer is a second request and is charged again

Credit charges (each a contract of the list of credit charges; the credit charge in force is filled in from the API):

ContractRateWhenTimesCredit charge in force
p2p.readsper_requestafter a successful answer—see the credit charges

Parameters

NameInTypeRequiredDescription
idpathstringyes

Answer 200 (P2pAppDomainList): the result

  • domains, array of objects, required
    • hostname, string, required
    • dns_error, string or null
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • id, string, required
    • dns_cname_target, string or null
    • cert_status, string or null
    • dns_target, string or null
    • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
    • dns_ok, boolean
    • created_at, string
    • last_error, string or null
    • wildcard, boolean
  • count, integer, required

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503unavailableunavailable (try again later)

Example

curl -X GET 'https://api.weird.ro/p2p/apps/{id}/domains' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird p2p domains, weird p2p domains detach, weird p2p domains verify):

$ weird p2p domains <app>$ weird p2p domains detach <app> <hostname|id>$ weird p2p domains verify <app> <hostname|id>

MCP: weird_p2p_domains.

Detach an app domain#

DELETE /p2p/apps/{id}/domains/{domain_id} · operation detachP2pAppDomain

A pending-dns domain is removed at once; any other moves to deleting until it is torn down, and only then is the name free. Safe to repeat while deleting. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Strong authenticationa session needs an authenticator enrolled and a recent proof of it (a step-up in the last 15 minutes, or totp_code / backup_code in the body); an API key is not asked — see authentication
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes
domain_idpathstringyes

Answer 200 (P2pAppDomainResult): the result

  • domain, object, required
    • hostname, string, required
    • dns_error, string or null
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • id, string, required
    • dns_cname_target, string or null
    • cert_status, string or null
    • dns_target, string or null
    • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
    • dns_ok, boolean
    • created_at, string
    • last_error, string or null
    • wildcard, boolean

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); enrolment-required (a session caller whose account has no authenticator: enrol one first) or step-up-required (a session without a recent step-up: POST /auth/step-up, then retry); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
422invalid-totpinvalid-totp (a wrong or replayed authenticator code)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503unavailableunavailable (try again later)

Example

curl -X DELETE 'https://api.weird.ro/p2p/apps/{id}/domains/{domain_id}' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird p2p domains detach):

$ weird p2p domains detach <app> <hostname|id>

MCP: weird_p2p_domain_detach.

Re-check an app domain's DNS now#

POST /p2p/apps/{id}/domains/{domain_id}/verify-dns · operation verifyP2pAppDomainDns

Checks the DNS of the app domain domain_id now instead of waiting for the next periodic check: once the hostname points where dns_target or dns_cname_target says, the domain moves on to its certificate. Safe to repeat. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes
domain_idpathstringyes

Answer 200 (P2pAppDomainResult): the result

  • domain, object, required
    • hostname, string, required
    • dns_error, string or null
    • restriction, object — on a resource held after a review: suspended (its account is restricted) or blocked (its content or hostname may not be served); the one reason code is abuse-review
      • state, string, required (one of suspended, blocked)
      • reason, string, required (must be "abuse-review")
      • decision_id, string or null — the decision on your account that put it in place (GET /auth/account/restrictions lists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it is
      • contact, string — the abuse contact address to write to about it
    • id, string, required
    • dns_cname_target, string or null
    • cert_status, string or null
    • dns_target, string or null
    • state, string, required (one of pending-dns, provisioning, active, failed, deleting, deleted)
    • dns_ok, boolean
    • created_at, string
    • last_error, string or null
    • wildcard, boolean

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
401unauthorizedunauthorized
403account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503unavailableunavailable (try again later)

Example

curl -X POST 'https://api.weird.ro/p2p/apps/{id}/domains/{domain_id}/verify-dns' \
  -H "Authorization: Bearer $WEIRD_API_KEY"

With the CLI (weird p2p domains verify):

$ weird p2p domains verify <app> <hostname|id>

MCP: weird_p2p_domain_verify.

Mint a mailbox token for a p2p app#

POST /p2p/apps/{id}/mailbox-credentials · operation mintP2pMailboxCredentials

A mailbox bearer token (token, ttl, expires_at, endpoint); room narrows it to one room (omit for a token for the whole app), ttl_sec as for TURN. Refused 400 while the app's mailbox is off. A token cannot be withdrawn: it expires after its ttl, so keep the lifetime short. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body (MintMailboxCredentials):

  • ttl_sec, integer
  • room, string — omit for an app-scoped token

Answer 200 (P2pMailboxCredentials): the result

  • credentials, object, required
    • token, string (password), required — the mailbox token: keep it out of logs (a secret: shown once, never logged)
    • ttl, integer, required — seconds the token stays valid
    • expires_at, integer, required — when it expires, in Unix seconds
    • endpoint, string, required
    • room, string — present for a room-scoped token

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (field ttl_sec or room; the mailbox is off)
401unauthorizedunauthorized
402insufficient-fundsinsufficient-funds (the app is suspended by its billing: an hourly charge was refused for want of credits and the grace ran out; top up and it resumes)
403account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
409conflictconflict (deleting)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503capacity-unavailable, unavailablecapacity-unavailable (no capacity now: try again later) or unavailable (try again later)

Example

curl -X POST 'https://api.weird.ro/p2p/apps/{id}/mailbox-credentials' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

With the CLI (weird p2p mailbox receive, weird p2p mailbox send, weird p2p mailbox token):

$ weird p2p mailbox receive <app> <room>$ weird p2p mailbox send <app> <room> [file|-]$ weird p2p mailbox token <app>

MCP: weird_p2p_mailbox.

Mint TURN credentials for a p2p app#

POST /p2p/apps/{id}/turn-credentials · operation mintP2pTurnCredentials

Short-lived TURN credentials (username, credential, ttl, urls) for the app's clients; ttl_sec is optional and capped at the longest lifetime offered. Credentials cannot be withdrawn: they expire after their ttl. This call is not charged.

Credentialan API key holding the permission below, or a session (x-weird-auth: key)
Permissionp2p:write
Chargedno

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body (MintTurnCredentials):

  • ttl_sec, integer — optional; capped at the longest lifetime offered

Answer 200 (P2pTurnCredentials): the result

  • credentials, object, required
    • username, string, required
    • credential, string (password), required — the TURN password: keep it out of logs (a secret: shown once, never logged)
    • ttl, integer, required — seconds the credentials stay valid
    • urls, array of strings, required — the TURN and STUN URLs to use

Refusals ({"error": {"code", "message"}}; see errors):

StatusCodesWhen
400invalid-paramsinvalid-params (field ttl_sec)
401unauthorizedunauthorized
402insufficient-fundsinsufficient-funds (the app is suspended by its billing: an hourly charge was refused for want of credits and the grace ran out; top up and it resumes)
403account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-requiredinsufficient-scope (an API key without the scope x-weird-scope names: use a key that holds it) or profile-incomplete (complete the profile first: GET /auth/profile says what is missing); account-suspended (the account is restricted while a report about it is reviewed: reading, support tickets and the copy of its data keep working; contact is the address to write to, GET /auth/account/restrictions says more); terms-acceptance-required (the current terms of service or privacy notice are not accepted yet: required lists them; read them with GET /legal/documents and accept with POST /auth/legal/accept)
404not-foundnot-found
409conflictconflict (deleting)
429rate-limitedrate-limited
502upstream-unavailableupstream-unavailable (try again later)
503capacity-unavailable, unavailablecapacity-unavailable (the app is being moved: try again later) or unavailable (try again later)

Example

curl -X POST 'https://api.weird.ro/p2p/apps/{id}/turn-credentials' \
  -H "Authorization: Bearer $WEIRD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

With the CLI (weird p2p turn):

$ weird p2p turn <app>

This page is generated from the API's public document; it changes when the document does.