TryzenAPI
Senders

Run one ambient session soon

POST
/v1/senders/{senderId}/ambient/sessions

Access: an API key (or an org-wide key naming the workspace) with manage on senders.

Adds one session 5-30 minutes from now when that is inside the sender's working hours, else at the next window start, under all the usual gates (the sender must be idle). startsAt is when it is planned (null while the workflow hasn't planned it yet; read GET for it). Send a requestId (UUID) to retry safely: a known id is ignored. 409 ambient_unavailable without a browser host, for a disconnected or stopped sender, or with ambient disabled; 429 ambient_extra_limit after 3 requests in a sender-local day.

Authorization

apiKey
headerx-api-key<token>

Workspace API key (nrk_…), shown once when created

Path Parameters

senderId*string
Match^[0-9a-f]{24}$

Request Body

application/json
  1. body
requestId?string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Response Body

Default Response

application/json
  1. response
requestId*string
startsAt*|null
ambient*
Example Request
curl -X POST 'https://api.tryzen.co/v1/senders/string/ambient/sessions' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "requestId": "string",  "startsAt": "2019-08-24T14:15:22Z",  "ambient": {    "settings": {      "enabled": true,      "likesPerDay": {        "min": 0,        "max": 0      },      "sessionsPerWorkday": {        "min": 0,        "max": 0      },      "sessionsPerOffDay": {        "min": 0,        "max": 0      }    },    "available": true,    "pausedReason": "string",    "today": {      "date": "string",      "sessionsPlanned": 0,      "sessionsDone": 0,      "likes": 0,      "extraSessionsRequested": 0,      "nextSessionAt": "2019-08-24T14:15:22Z"    },    "lastSession": {      "at": "2019-08-24T14:15:22Z",      "outcome": "completed"    }  }}

Change a sender's ambient settings PATCH

**Access:** an API key (or an org-wide key naming the workspace) with manage on `senders`. Any subset of `enabled`, `likesPerDay` (0-2), `sessionsPerWorkday` ({min,max} within 0-6) and `sessionsPerOffDay` (within 0-3); a range is replaced whole. Today's plan is not redrawn (the next day uses the new ranges), except `enabled: false`, which stops new sessions at once (a running one finishes).

Start connecting a sender: cookies, or a one-time token for the extension POST

**Access:** an API key (or an org-wide key naming the workspace) with manage on `senders`. The cookies are encrypted before they leave this request and are never returned. A sender without a proxy claims a free, healthy proxy in `proxyCountry`; when the workspace has none, the answer is 422 `no_proxy_in_country` (never a proxy of another country, never a direct connection). `senderId` reconnects that sender and keeps its id. An API key reconnecting a sender that holds no seat (disconnected in Tryzen, or an inactive seat) gets 409 `seat_requires_person`: a person reconnects it in the app. `proxy` brings your own proxy for a NEW sender instead of a pool claim: it is checked through itself first and must exit in `proxyCountry` (no fallback to the pool or another country), else 422 with the failure code (`unreachable`, `auth_failed`, `timeout`, `echo_failed`, `country_mismatch`) and nothing is created; 409 `proxy_in_use` when it is already registered. The password is write-only. With `senderId` it is a 400: change an existing sender's proxy with `PUT /v1/senders/{senderId}/proxy`.