List projects and deployments
Every workspace an account owns, then every app actually running, as two CouchDB view reads.
"Projects" and "deployments" answer two different questions. A project is a workspace on the
account, the thing you would see in the project switcher, whether or not anything inside it has
ever gone live. A deployment is one app that is actually running somewhere, is_deployment: true
on its own document. Listing an account usually means both: the workspaces first, then what each
one has running.
Methods
Get Account Projects
Returns the projects owned by the account (or all projects for superuser and support accounts) from the user_projects master view.
Get Account Deployments
Returns the deployments associated with the account from the user_deployments master view.
Walkthrough
List the account's projects
No fields beyond your key: both methods key the CouchDB view off the uid your credential already resolves to.
2. List what is actually deployed
Same shape, a different view: user_deployments only emits a document when is_deployment is
true, so this list is a subset of every app the account has ever created, the ones with a live
access URL.
The response
Both methods pass a CouchDB view result straight through, unwrapped: code is 871 (the fixed
success code get_couch_view always returns, not the usual 1), and data is the raw nano view
answer, total_rows, offset and a rows array of { id, key, value }. id is the project's
(or deployment's) _id, the value you pass as app_id to every other call in this section.
get_account_deployments rows carry the same fields plus app_hosting_server, app_datacenter_id,
app_hosting and is_deployment: true, since user_deployments emits those on top of the shared
set. app_status_code < 4 is the only status this view or user_projects will ever show you: both
map functions filter out anything at 4 or above, so a deleted project simply stops appearing rather
than showing up with a status to check.
get_account_projects stamps main_profile_name onto the account's own workspace row when that
workspace has a named profile, so the row you show as "your" project can read differently from its
stored app_name. Prefer main_profile_name when present.
Errors
Both methods only ever fail the way every call can: a missing or unauthorized api_key (-401,
see Errors). Neither one branches on app_id or any other input, since neither
takes one, an empty rows array is a real, successful answer for an account with nothing in that
list yet, not an error.