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 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.

Assigned accounts appear here after Layers fulfills a request. If a request just completed and the account isn't showing yet, poll again before treating it as missing.

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_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39/leased-accounts" \
  -H "Authorization: Bearer lp_..."
const { items } = await layers.leasedAccounts.list({
  projectId: "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
});

const monthlyBurn = items.reduce((sum, a) => sum + a.monthlyPriceCents, 0);
result = layers.leased_accounts.list(project_id="prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39")
monthly_burn_cents = sum(a["monthlyPriceCents"] for a in result["items"])

Response

200Assigned accounts
{
  "items": [
    {
      "socialAccountId": "sa_9c1e42a0-b7f3-4e5d-a2c1-8b4f5e6c7d8e",
      "projectId": "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
      "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_9c1e42a0-b7f3-4e5d-a2c1-8b4f5e6c7d8e",
      "projectId": "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
      "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