Layers

POST /v1/projects/:projectId/leased-accounts/request

Submit a request for warmed-up TikTok accounts in a specific niche. Layers fulfills manually.

View as Markdown
POST/v1/projects/:projectId/leased-accounts/request
Phase 1stableidempotent
Auth
Bearer
Scope
leased:write

Ask for warmed TikTok accounts in a niche. This endpoint writes to an ops queue — Layers operations picks up the request, allocates accounts from the warmed pool, and attaches them to your project.

Lease provisioning is handled by Layers — permanently. Requests are accepted via this API; accounts appear in GET /v1/leased-accounts once Layers assigns them. We warm accounts in specific niches by hand so the pool stays healthy.

Leased accounts are billed at $150/account/month, charged to the partner wallet on assignment — not on request. If ops fulfills a request partially (say you asked for 5 and we could only assign 3), the status comes back as partial and you're only billed for the 3.

Path
  • projectId
    stringrequired
    Project that will own the assigned accounts.
Headers
  • Idempotency-Key
    string (UUID)optional
    Recommended. Same key + same body replays for 24 hours — prevents double-queueing the same request if your side retries.
Body
  • projectId
    stringrequired
    Must match the path :projectId. Included in the body so the server can reject mismatched retries.
  • count
    integerrequired
    How many accounts to lease. 1–50 per request.
  • niche
    Nicherequired
    What kind of account you want. See the Niche shape below.
  • target
    stringoptional
    Free-form description of what content will run on these accounts. Helps ops pick the right pool.
  • note
    stringoptional
    Any extra context for ops. 2000 chars max.
  • requestId
    stringoptional
    Partner-created request id. If omitted, server generates one.
Niche
  • vertical
    stringrequired
    Broad category — coffee, fitness, mobile games, etc. Ops matches against the pool's tag set.
  • audience
    stringoptional
    Target audience description.
  • language
    stringoptional
    BCP-47 language tag. Determines which language pools we search.
  • geo
    string[]optional
    ISO country codes. Ops prefers accounts with followers in these regions.

Example request

curl https://api.layers.com/v1/projects/prj_01HX9Y7K8M2P4RSTUV56789AB/leased-accounts/request \
  -H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..." \
  -H "Idempotency-Key: 9a2f1e44-6b3c-4d19-9e8a-f2d7c1b5e777" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "prj_01HX9Y7K8M2P4RSTUV56789AB",
    "count": 5,
    "niche": {
      "vertical": "coffee",
      "audience": "home baristas 25–40",
      "language": "en",
      "geo": ["US", "CA", "GB"]
    },
    "target": "Short-form brew tutorials; paid UGC-style creative for ads."
  }'
const { requestId } = await layers.leasedAccounts.request(
  {
    projectId: "prj_01HX9Y7K8M2P4RSTUV56789AB",
    count: 5,
    niche: {
      vertical: "coffee",
      audience: "home baristas 25–40",
      language: "en",
      geo: ["US", "CA", "GB"],
    },
    target: "Short-form brew tutorials; paid UGC-style creative for ads.",
  },
  { idempotencyKey: crypto.randomUUID() },
);

// poll requestId via getLeaseRequest
result = layers.leased_accounts.request(
    project_id="prj_01HX9Y7K8M2P4RSTUV56789AB",
    count=5,
    niche={
        "vertical": "coffee",
        "audience": "home baristas 25–40",
        "language": "en",
        "geo": ["US", "CA", "GB"],
    },
    target="Short-form brew tutorials; paid UGC-style creative for ads.",
    idempotency_key=str(uuid.uuid4()),
)

Response

202Request accepted into the ops queue
{
  "requestId": "lreq_01HXZR7K8M2P4RSTUV56789AB",
  "status": "requested",
  "submittedAt": "2026-04-18T19:24:11Z"
}

Poll GET /v1/leased-accounts/requests/:id for progress. Typical turnaround is under 48 hours during business days in SF — longer for unusual niches. If something's holding up your request, ops will leave a note on the request row.

Errors

StatusCodeWhen
422VALIDATIONcount out of range, niche.vertical missing, geo contains a non-ISO code.
401UNAUTHENTICATEDMissing or invalid key.
402BILLING_EXHAUSTEDPartner wallet wouldn't cover even one assignment. Request is not queued.
403FORBIDDEN_SCOPEKey lacks leased:write.
404NOT_FOUNDProject not in your organization.
409CONFLICTSame Idempotency-Key replayed with a different body.
429RATE_LIMITEDWrite budget exhausted.

See also

On this page