TryzenAPI
Actions

Queue a LinkedIn action (invite, message, profile view, …) for the person's sender

POST
/v1/actions

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

Queues one LinkedIn action and answers 202 with the action queued. The sender's own loop runs it later, under the same gates as a campaign step (working hours, the shared daily quota, warm-up, locks, cooldowns); the outcome arrives by webhook and on GET /v1/actions/{actionId}.

The target (profileUrl, publicIdentifier, profileUrn or leadId) becomes a workspace lead (created with source api when it's new), returned as leadId. A profile URL may carry extra path segments (/in/jane/details/…); only the vanity counts. Prefer profileUrl targets, or the profileUrn our profile lookup returns: a bare URN for a person the workspace knows only by vanity can't be matched to that lead before LinkedIn resolves it.

A message with a conversationId is a reply into that thread (it also needs the inboxReply permission): the thread decides who it goes to, and a target given too must be that same person.

reach lets Tryzen pick the step right before acting, for this sender and this person: message (sent when they are a 1st-degree connection), optional note (the invite's note when they aren't) and whenNoteCreditsOut (without_note (default) | wait | fail: an invite with a note while the account's note credits are out). Tryzen decides from its own records (a connection or a 1:1 thread → the message; this sender's invite pending → nothing), else from ONE relationship read of that person, then sends the message or the invite. action.reach says which step it took (message, invite, none), the relationship that decided it and its source (stored, fresh_read, unavailable: no read was possible, so it invited). A message spends the message quota, an invite the invite quota. A reach to the sender's own profile fails target_is_sender; a person LinkedIn can't find for the sender fails profile_unreachable.

Which sender (one person, one account): omit senderId and Tryzen chooses, in this order:

  1. a message with a conversationId: the thread's own sender, always (refused with 422 sender_not_connected when that sender was removed or disconnected with POST /v1/senders/{senderId}/disconnect);
  2. the lead's owner, the sender that handled its first direct action. Sticky: if that sender lost its session or is stopped the action still queues for it and waits, Tryzen never moves a person to another account by itself. A sender removed or disconnected on purpose (reason disconnected_by_user) owns nobody until it reconnects;
  3. a sender that already knows the person (an open direct action, a pending invite or a connection, a conversation; the most recent wins), which becomes the owner; a removed or deliberately disconnected sender's relationships don't count;
  4. otherwise a healthy (available, no cooldown) connected sender with the most room today for this kind (quota left after warm-up, minus its queued actions; inside its working hours first; ties go to the sender that got a new lead least recently), which becomes the owner.

The answer's action.senderId is the sender chosen. A senderId you give can't override steps 1–3: it must be the thread's sender, the owner, or the sender that already knows the person, else 409 lead_owned_by_other_sender; for a person nobody knows yet it becomes the owner.

Idempotency: idempotencyKey (a UUID) is unique per workspace. Sending the same key with the same body again answers 200 with the action already queued (created: false); the same key with a different body is 409 idempotency_conflict.

expiresAt defaults to 7 days after the action may first run (notBefore, else now) and may be at most 30 days from now; an action that hasn't run by then fails with expired.

Refusals:

  • 404 sender_not_found, 404 lead_not_found (a leadId target), 404 conversation_not_found (not a thread of this workspace, or a private mailbox you can't see)
  • 422 sender_not_connected: the senderId you named isn't connected (reconnect it first), or a reply's thread belongs to a sender that was removed or disconnected
  • 422 target_invalid: not a LinkedIn person profile, a group or sponsored thread, or a target that isn't the thread's participant
  • 422 action_not_supported: inmail isn't supported yet
  • 422 browser_required: view_profile, follow, like_post, withdraw_invite and an invite without a note run only in the browser, and the person's sender has no browser host
  • 422 blacklisted: the person or their company is on the workspace blacklist
  • 422 expires_at_invalid: expiresAt in the past, more than 30 days away, or not after notBefore
  • 409 lead_in_active_campaign: an invite, or a message without conversationId, to a lead a campaign is still working (its campaign lead is pending, in progress or paused in a scheduled, running or paused campaign); stop or remove it there first. Replies into a thread and the other kinds are allowed
  • 422 no_sender_available: no senderId, no owner or relationship, and no healthy connected sender that can run this kind
  • 409 lead_owned_by_other_sender: senderId isn't the thread's sender, the person's owner, or the sender that already knows them; omit it
  • 409 idempotency_conflict
  • 403 forbidden: a message with a conversationId without the inboxReply permission

Authorization

apiKey
headerx-api-key<token>

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

Request Body

application/json
  1. body
senderId?string
Match^[0-9a-f]{24}$
idempotencyKey*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
externalId?string
Length1 <= length <= 200
notBefore?string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
expiresAt?string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
type*string
target*|||
note?string
Length1 <= length <= 300

Response Body

Default Response

application/json
  1. response
action*
created*boolean
Example Request
curl -X POST 'https://api.tryzen.co/v1/actions' \  -H 'Content-Type: application/json' \  -d '{  "idempotencyKey": "0c14c6a6-6f50-4d1e-b0c4-b46ff43ba6a1",  "type": "invite",  "target": {    "profileUrl": "string"  }}'
Example Response
{  "action": {    "id": "string",    "senderId": "string",    "leadId": "string",    "type": "invite",    "target": {      "profileUrl": "string"    },    "params": {      "note": "string",      "text": "string",      "subject": "string",      "conversationId": "string",      "withinDays": -9007199254740991,      "splitParagraphs": true,      "stopIfReplied": true,      "whenNoteCreditsOut": "without_note"    },    "externalId": "string",    "status": "queued",    "requestedAt": "2019-08-24T14:15:22Z",    "notBefore": "2019-08-24T14:15:22Z",    "expiresAt": "2019-08-24T14:15:22Z",    "startedAt": "2019-08-24T14:15:22Z",    "finishedAt": "2019-08-24T14:15:22Z",    "waiting": {      "reason": "turn",      "until": "2019-08-24T14:15:22Z"    },    "result": {      "invitationUrn": "string",      "conversationId": "string",      "messageId": "string",      "connection": "connected",      "skipped": "string"    },    "failure": {      "code": "string",      "message": "string",      "retryable": true    },    "reach": {      "step": "message",      "relationship": "connected",      "source": "stored",      "withNote": true    }  },  "created": true}