GET /v1/projects/:projectId/leased-accounts/requests/:requestId
Poll a lease request until it transitions to assigned, partial, or rejected.
GET
/v1/projects/:projectId/leased-accounts/requests/:requestIdPhase 1stable
- Auth
- Bearer
- Scope
- leased:write
Read the current state of a lease request.
If you'd rather not poll, subscribe to the lease_request.assigned webhook event.
Path
projectIdstringrequiredProject the request was submitted against.requestIdstringrequiredId returned by request-lease.
Example request
curl https://api.layers.com/v1/projects/prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39/leased-accounts/requests/lreq_01HXZR7K8M2P4RSTUV56789AB \
-H "Authorization: Bearer lp_..."const req = await layers.leasedAccounts.getRequest({
projectId: "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
requestId: "lreq_01HXZR7K8M2P4RSTUV56789AB",
});
if (req.status === "assigned" || req.status === "partial") {
const accounts = await layers.leasedAccounts.list({ projectId: req.projectId });
// accounts.items now includes the assigned leased accounts
}req = layers.leased_accounts.get_request(
project_id="prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
request_id="lreq_01HXZR7K8M2P4RSTUV56789AB",
)
if req["status"] in ("assigned", "partial"):
accounts = layers.leased_accounts.list(project_id=req["projectId"])Response
200Still queued
{
"requestId": "lreq_01HXZR7K8M2P4RSTUV56789AB",
"projectId": "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
"status": "requested",
"submittedAt": "2026-04-18T19:24:11Z",
"assignedAt": null,
"assignedSocialAccountIds": [],
"note": null
}200Partially fulfilled - fewer accounts than requested
{
"requestId": "lreq_01HXZR7K8M2P4RSTUV56789AB",
"projectId": "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
"status": "partial",
"submittedAt": "2026-04-18T19:24:11Z",
"assignedAt": "2026-04-20T16:12:02Z",
"assignedSocialAccountIds": [
"sa_9c1e42a0-b7f3-4e5d-a2c1-8b4f5e6c7d8e",
"sa_9c1e42a0-b7f3-4e5d-a2c1-8b4f5e6c7d8e",
"sa_9c1e42a0-b7f3-4e5d-a2c1-8b4f5e6c7d8e"
],
"note": "Assigned 3 of 5 requested - the coffee/US pool is running thin. Will top up next week; open a follow-up request if you need the other 2 sooner."
}Status values
status | Terminal? | Meaning |
|---|---|---|
requested | no | In the queue; not yet being worked. |
assigned | yes | All requested accounts delivered. See assignedSocialAccountIds. |
partial | yes | Some accounts delivered. note explains why not all. |
rejected | yes | Request can't be fulfilled (e.g. niche not supported). note explains why. |
Planned additions: in_review, provisioning, failed. Existing partners don't need to change anything - the current four stay valid.
Errors
| Status | Code | When |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 403 | FORBIDDEN_SCOPE | Key lacks leased:write. |
| 404 | NOT_FOUND | Request not in your organization. |
See also
POST /v1/projects/:id/leased-accounts/request- submit a requestGET /v1/projects/:id/leased-accounts- list assigned accounts