List plans
const url = 'https://app.commitly.com/api/plans/';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.commitly.com/api/plans/ \ --header 'Authorization: Bearer <token>'Returns the plans of the company as a plain JSON array. Not paginated.
The id is used as plan_id for plan budgets and as scenario_id for
scenario budgets. type distinguishes regular plans, the forecast and
scenarios.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”List of plans.
object
object
REGULAR plan, the FORECAST, or a SCENARIO.
Budgets of a committed plan cannot be updated or deleted.
IN_PROGRESS while the plan is being recalculated, otherwise READY.
ID of the parent plan.
Example
[ { "id": 2001, "author": { "id": "19", "username": "jane.doe@example.com", "full_name": "Jane Doe" }, "date_created": "2020-12-03T12:40:16.187671Z", "date_updated": "2021-09-03T18:32:19.682824Z", "name": "Forecast", "first_year": 2020, "last_year": 2023, "type": "FORECAST", "is_active": true, "is_committed": false, "update_status": "READY", "use_transactions": true, "use_invoices": false, "update_forecast": true, "parent": null, "comment_count": 0 }]The access token is invalid or has expired. Request a new token. The message is
localized (see Accept-Language).
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "Invalid token."}Headers
Section titled “Headers”Authentication scheme, Bearer.
Example
BearerNo access token was sent, or the credentials are not allowed to call this
endpoint. If the company’s COMMITLY edition does not include the requested
function, the body additionally contains
"code": "billing_plan_permission_denied".
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "User must be authenticated to access this resource."}
