Layers

GET /v1/projects/:projectId/leased-accounts

List assigned leased accounts on a project, with billing and renewal info.

View as Markdown
GET/v1/projects/:projectId/leased-accounts
Phase 1stable
Auth
Bearer
Scope
leased:write

List leased accounts ops has assigned to the project. This is the source of truth for what you're paying for and when the next monthly renewal hits.

Leased accounts also appear in GET /v1/projects/:id/social-accounts with leased: true, which is the right endpoint if you just want a list of "accounts I can publish to" without caring about billing.

Lease provisioning is handled by Layers operations. Assigned accounts land here after ops fulfills a request. If a request just completed and the account isn't showing yet, wait a minute — the assignment and the list view become consistent within about 30 seconds.

Path
  • projectId
    stringrequired
    Project whose leased accounts you want.
Query
  • status
    stringoptional
    Filter. Defaults to assigned only.
    One of: assigned, disconnected

Example request

curl "https://api.layers.com/v1/projects/prj_01HX9Y7K8M2P4RSTUV56789AB/leased-accounts" \
  -H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..."
const { items } = await layers.leasedAccounts.list({
  projectId: "prj_01HX9Y7K8M2P4RSTUV56789AB",
});

const monthlyBurn = items.reduce((sum, a) => sum + a.monthlyPriceCents, 0);
result = layers.leased_accounts.list(project_id="prj_01HX9Y7K8M2P4RSTUV56789AB")
monthly_burn_cents = sum(a["monthlyPriceCents"] for a in result["items"])

Response

200Assigned accounts
{
  "items": [
    {
      "socialAccountId": "sa_01HXZS8N3C5R6STUV7WXYZ9AB",
      "projectId": "prj_01HX9Y7K8M2P4RSTUV56789AB",
      "handle": "coffee.reviews.daily",
      "platform": "tiktok",
      "followers": 12840,
      "status": "assigned",
      "assignedAt": "2026-04-20T16:12:02Z",
      "nextRenewalAt": "2026-05-20T16:12:02Z",
      "monthlyPriceCents": 15000
    },
    {
      "socialAccountId": "sa_01HXZS8N3C5R6STUV7WXYZ9AC",
      "projectId": "prj_01HX9Y7K8M2P4RSTUV56789AB",
      "handle": "brew.at.home",
      "platform": "tiktok",
      "followers": 8412,
      "status": "assigned",
      "assignedAt": "2026-04-20T16:12:02Z",
      "nextRenewalAt": "2026-05-20T16:12:02Z",
      "monthlyPriceCents": 15000
    }
  ]
}

monthlyPriceCents is the amount debited from your partner wallet on nextRenewalAt. To stop the next renewal, release the account before that date.

Errors

StatusCodeWhen
401UNAUTHENTICATEDMissing or invalid key.
403FORBIDDEN_SCOPEKey lacks leased:write.
404NOT_FOUNDprojectId not in your organization.

See also

On this page