Menu
P2P apps
Signalling, relay, TURN and an offline mailbox for browser and device apps.
| Operation | Method and path |
|---|---|
| Create a p2p app | POST /p2p/apps |
| The caller's p2p apps | GET /p2p/apps |
| One of the caller's p2p apps | GET /p2p/apps/{id} |
| Change a p2p app | PATCH /p2p/apps/{id} |
| Delete a p2p app | DELETE /p2p/apps/{id} |
| Attach one of the caller's own hostnames to a p2p app | POST /p2p/apps/{id}/domains |
| A p2p app's own domains, oldest first | GET /p2p/apps/{id}/domains |
| Detach an app domain | DELETE /p2p/apps/{id}/domains/{domain_id} |
| Re-check an app domain's DNS now | POST /p2p/apps/{id}/domains/{domain_id}/verify-dns |
| Mint a mailbox token for a p2p app | POST /p2p/apps/{id}/mailbox-credentials |
| Mint TURN credentials for a p2p app | POST /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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Strong authentication | a 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 |
| Charged | yes — see the charges below |
| Retry safety | a 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):
| Contract | Rate | When | Times | Credit charge in force |
|---|---|---|---|---|
recurring.p2p-app-hourly | per_hour | every hour while it exists | — | see the credit charges |
recurring.p2p-app-hourly | per_mb_hour_cached | every hour while it exists | the mailbox's cached MB | see the credit charges |
p2p.relay-traffic | per_mb_relayed | per use | — | see the credit charges |
p2p.mailbox-traffic | per_mb_served_mailbox | per use | — | see the credit charges |
Request body (CreateP2pApp):
name, string, required — a DNS label: 1-63 of a-z, 0-9 and interior hyphensorigins, array of strings — exact web origins or *.domain.tld wildcards, at most 20; [] admits any originsettings, object — the app's limits: each key a positive integer, clamped at its maximum; a key not sent keeps its defaultmax_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 (defaultfalse)
Answer 201 (P2pAppResult): the result
app, object, requiredmailbox_enabled, booleanhostname, string, requiredrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
settings, object — the server defaults under the customer's limitsrelay_enabled, booleanbilling, 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 ofoff,ok,grace,suspended)paid_through, string or nullunpaid_since, stringsuspend_at, stringsuspended_at, stringdelete_at, string
id, string, requiredname, string, requiredice_urls, array of stringscached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)updated_at, stringdomains, array of objectshostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
relay_peer_id, string or nullstate, string, requiredturn_credentials_url, stringcreated_at, stringorigins, array of stringslast_error, string or null — what went wrong last, when anything didmailbox_url, string or nullmailbox_open_mint, booleanrelay_multiaddrs, array of stringssignaling_url, stringnode, object or null
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 400 | invalid-params | invalid-params (with field; also the per-account app limit) |
| 401 | unauthorized | unauthorized |
| 402 | insufficient-funds | insufficient-funds (the credits do not cover the first hour: top up) |
| 403 | account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-required | insufficient-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) |
| 409 | conflict | conflict (the name is taken) |
| 422 | invalid-totp | invalid-totp (a wrong or replayed authenticator code) |
| 429 | rate-limited | rate-limited |
| 451 | hostname-blocked | hostname-blocked (the hostname or content was blocked after a review: reason abuse-review; contest it through a support ticket or contact) |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | capacity-unavailable, charge-not-set, unavailable | capacity-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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:read |
| Charged | yes — see the charges below |
| Retry safety | a 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):
| Contract | Rate | When | Times | Credit charge in force |
|---|---|---|---|---|
p2p.reads | per_request | after a successful answer | — | see the credit charges |
Answer 200 (P2pAppList): the result
apps, array of objects, requiredmailbox_enabled, booleanhostname, string, requiredrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
settings, object — the server defaults under the customer's limitsrelay_enabled, booleanbilling, 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 ofoff,ok,grace,suspended)paid_through, string or nullunpaid_since, stringsuspend_at, stringsuspended_at, stringdelete_at, string
id, string, requiredname, string, requiredice_urls, array of stringscached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)updated_at, stringdomains, array of objectshostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
relay_peer_id, string or nullstate, string, requiredturn_credentials_url, stringcreated_at, stringorigins, array of stringslast_error, string or null — what went wrong last, when anything didmailbox_url, string or nullmailbox_open_mint, booleanrelay_multiaddrs, array of stringssignaling_url, stringnode, object or null
count, integer, required
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 401 | unauthorized | unauthorized |
| 403 | insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | unavailable | unavailable (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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:read |
| Charged | yes — see the charges below |
| Retry safety | a 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):
| Contract | Rate | When | Times | Credit charge in force |
|---|---|---|---|---|
p2p.reads | per_request | after a successful answer | — | see the credit charges |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Answer 200 (P2pAppResult): the result
app, object, requiredmailbox_enabled, booleanhostname, string, requiredrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
settings, object — the server defaults under the customer's limitsrelay_enabled, booleanbilling, 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 ofoff,ok,grace,suspended)paid_through, string or nullunpaid_since, stringsuspend_at, stringsuspended_at, stringdelete_at, string
id, string, requiredname, string, requiredice_urls, array of stringscached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)updated_at, stringdomains, array of objectshostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
relay_peer_id, string or nullstate, string, requiredturn_credentials_url, stringcreated_at, stringorigins, array of stringslast_error, string or null — what went wrong last, when anything didmailbox_url, string or nullmailbox_open_mint, booleanrelay_multiaddrs, array of stringssignaling_url, stringnode, object or null
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 401 | unauthorized | unauthorized |
| 403 | insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found (an unknown app, another customer's alike) |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | unavailable | unavailable (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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Charged | no |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body (UpdateP2pApp):
origins, array of stringssettings, object — the app's limits: each key a positive integer, clamped at its maximum; a key not sent keeps its defaultmax_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, booleanmailbox_enabled, booleanmailbox_open_mint, boolean
Answer 200 (P2pAppResult): the result
app, object, requiredmailbox_enabled, booleanhostname, string, requiredrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
settings, object — the server defaults under the customer's limitsrelay_enabled, booleanbilling, 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 ofoff,ok,grace,suspended)paid_through, string or nullunpaid_since, stringsuspend_at, stringsuspended_at, stringdelete_at, string
id, string, requiredname, string, requiredice_urls, array of stringscached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)updated_at, stringdomains, array of objectshostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
relay_peer_id, string or nullstate, string, requiredturn_credentials_url, stringcreated_at, stringorigins, array of stringslast_error, string or null — what went wrong last, when anything didmailbox_url, string or nullmailbox_open_mint, booleanrelay_multiaddrs, array of stringssignaling_url, stringnode, object or null
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 400 | invalid-params | invalid-params (with field) |
| 401 | unauthorized | unauthorized |
| 403 | account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found |
| 409 | conflict | conflict (deleting) |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | unavailable | unavailable (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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Strong authentication | a 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 |
| Charged | no |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Answer 200 (P2pAppResult): the result
app, object, requiredmailbox_enabled, booleanhostname, string, requiredrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
settings, object — the server defaults under the customer's limitsrelay_enabled, booleanbilling, 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 ofoff,ok,grace,suspended)paid_through, string or nullunpaid_since, stringsuspend_at, stringsuspended_at, stringdelete_at, string
id, string, requiredname, string, requiredice_urls, array of stringscached_mb, string or null — the mailbox's cached ciphertext, MiB (a decimal string)updated_at, stringdomains, array of objectshostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
relay_peer_id, string or nullstate, string, requiredturn_credentials_url, stringcreated_at, stringorigins, array of stringslast_error, string or null — what went wrong last, when anything didmailbox_url, string or nullmailbox_open_mint, booleanrelay_multiaddrs, array of stringssignaling_url, stringnode, object or null
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 401 | unauthorized | unauthorized |
| 403 | account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found |
| 422 | invalid-totp | invalid-totp (a wrong or replayed authenticator code) |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | unavailable | unavailable (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}.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Charged | no |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body (AttachP2pAppDomain):
hostname, string, required — a fully qualified name;*.namefor a wildcardwildcard, boolean
Answer 201 (P2pAppDomainResult): the result
domain, object, requiredhostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 400 | invalid-params | invalid-params (field hostname or wildcard; the per-app cap) |
| 401 | unauthorized | unauthorized |
| 403 | account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found (the app; a hostname under another account's domain) |
| 409 | conflict | conflict (the name is attached or used by another product; the app is deleting) |
| 429 | rate-limited | rate-limited |
| 451 | hostname-blocked | hostname-blocked (the hostname or content was blocked after a review: reason abuse-review; contest it through a support ticket or contact) |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | capacity-unavailable, unavailable | capacity-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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:read |
| Charged | yes — see the charges below |
| Retry safety | a 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):
| Contract | Rate | When | Times | Credit charge in force |
|---|---|---|---|---|
p2p.reads | per_request | after a successful answer | — | see the credit charges |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Answer 200 (P2pAppDomainList): the result
domains, array of objects, requiredhostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
count, integer, required
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 401 | unauthorized | unauthorized |
| 403 | insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | unavailable | unavailable (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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Strong authentication | a 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 |
| Charged | no |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
domain_id | path | string | yes |
Answer 200 (P2pAppDomainResult): the result
domain, object, requiredhostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 401 | unauthorized | unauthorized |
| 403 | account-suspended, enrolment-required, insufficient-scope, profile-incomplete, step-up-required, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found |
| 422 | invalid-totp | invalid-totp (a wrong or replayed authenticator code) |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | unavailable | unavailable (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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Charged | no |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
domain_id | path | string | yes |
Answer 200 (P2pAppDomainResult): the result
domain, object, requiredhostname, string, requireddns_error, string or nullrestriction, object — on a resource held after a review:suspended(its account is restricted) orblocked(its content or hostname may not be served); the one reason code isabuse-reviewstate, string, required (one ofsuspended,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/restrictionslists it; contest it with a support ticket naming it); null when it cannot be told which of your decisions it iscontact, string — the abuse contact address to write to about it
id, string, requireddns_cname_target, string or nullcert_status, string or nulldns_target, string or nullstate, string, required (one ofpending-dns,provisioning,active,failed,deleting,deleted)dns_ok, booleancreated_at, stringlast_error, string or nullwildcard, boolean
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 401 | unauthorized | unauthorized |
| 403 | account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | unavailable | unavailable (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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Charged | no |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body (MintMailboxCredentials):
ttl_sec, integerroom, string — omit for an app-scoped token
Answer 200 (P2pMailboxCredentials): the result
credentials, object, requiredtoken, string (password), required — the mailbox token: keep it out of logs (a secret: shown once, never logged)ttl, integer, required — seconds the token stays validexpires_at, integer, required — when it expires, in Unix secondsendpoint, string, requiredroom, string — present for a room-scoped token
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 400 | invalid-params | invalid-params (field ttl_sec or room; the mailbox is off) |
| 401 | unauthorized | unauthorized |
| 402 | insufficient-funds | insufficient-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) |
| 403 | account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found |
| 409 | conflict | conflict (deleting) |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | capacity-unavailable, unavailable | capacity-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.
| Credential | an API key holding the permission below, or a session (x-weird-auth: key) |
| Permission | p2p:write |
| Charged | no |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body (MintTurnCredentials):
ttl_sec, integer — optional; capped at the longest lifetime offered
Answer 200 (P2pTurnCredentials): the result
credentials, object, requiredusername, string, requiredcredential, string (password), required — the TURN password: keep it out of logs (a secret: shown once, never logged)ttl, integer, required — seconds the credentials stay validurls, array of strings, required — the TURN and STUN URLs to use
Refusals ({"error": {"code", "message"}}; see errors):
| Status | Codes | When |
|---|---|---|
| 400 | invalid-params | invalid-params (field ttl_sec) |
| 401 | unauthorized | unauthorized |
| 402 | insufficient-funds | insufficient-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) |
| 403 | account-suspended, insufficient-scope, profile-incomplete, terms-acceptance-required | insufficient-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) |
| 404 | not-found | not-found |
| 409 | conflict | conflict (deleting) |
| 429 | rate-limited | rate-limited |
| 502 | upstream-unavailable | upstream-unavailable (try again later) |
| 503 | capacity-unavailable, unavailable | capacity-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.