Scorecards
Account-wide metrics tables broken down by responsible user, location, or workroom (a reporting view, not contact scoring). Metric values are computed in the background, so a new or edited scorecard shows calculation_status: "pending" until the next calculation run.
Metrics computed from other metrics rather than from a query. Same records listCustomMetrics returns with filter[kind]=formula; this route is the formula-only view.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Page size. Default 25, max 100.
25Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442A page of formula metrics.
GET /v3/scorecards/formulas HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
A page of formula metrics.
{
"object": "list",
"data": [
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}
],
"has_more": true,
"next_cursor": "text"
}Defines a metric as an arithmetic expression over other metrics, referenced in braces:
({New Contacts} / {Total Contacts}) * 100 with suffix "%"
round({New Leads} / {Total Leads}, 2)A {reference} resolves against three things, in the order the calculator tries them: a built-in metric name, one of the account's own custom metrics, then a workroom attribute key. listScorecardMetrics returns the first two.
Every reference is checked at write time, because nothing checks it later. The calculator substitutes each reference for its value and evaluates the result inside a catch-all that yields 0 on any error, and an unresolvable reference itself resolves to 0. So a formula with a mistyped metric name does not fail β ({New Contactz} / {Total Contacts}) * 100 computes (0 / 5000) * 100 and reports 0%, which looks like a real answer. The dashboard's own save path performs none of these checks.
Also rejected: a formula with no references (that is a constant), self-reference, unbalanced braces or parentheses, and anything the calculator's sanitiser would strip β only + - * / . ( ) ,, digits and the functions round, ceil, floor survive outside a reference, so a formula containing more than that would be stored and then silently evaluated as something else.
prefix and suffix are display-only, e.g. suffix: "%".
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Unique per account (case-insensitive); scorecards and other formulas reference metrics by this name.
Arithmetic over other metrics, each referenced in braces. Outside a reference only digits, + - * / . ( ) , and the functions round, ceil, floor are permitted β anything else is stripped by the calculator and is rejected here rather than stored.
({New Contacts} / {Total Contacts}) * 100Display prefix, e.g. "$".
Display suffix, e.g. "%".
The created formula metric.
cmt_6520f7e8a17700005f006059Unique per account. This is what a scorecard's metrics[] stores.
segment counts contacts matching a query and is writable here. formula computes from other metrics and is writable via /scorecards/formulas.
Which date field constrains the metric to the scorecard's window. "" means no date constraint. Null means the field is absent, which the calculator treats as add_date.
Whether this metric's name contains only characters supported in formula references.
Warning messages, e.g. when the metric name contains hyphens or symbols and cannot be referenced from formulas.
Present for formula metrics. References other metrics in braces.
({New Contacts} / {Total Contacts}) * 100Display prefix for a formula metric.
Display suffix for a formula metric
POST /v3/scorecards/formulas HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 101
{
"name": "text",
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}The created formula metric.
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}The expression and its display prefix/suffix.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442The formula metric.
cmt_6520f7e8a17700005f006059Unique per account. This is what a scorecard's metrics[] stores.
segment counts contacts matching a query and is writable here. formula computes from other metrics and is writable via /scorecards/formulas.
Which date field constrains the metric to the scorecard's window. "" means no date constraint. Null means the field is absent, which the calculator treats as add_date.
Whether this metric's name contains only characters supported in formula references.
Warning messages, e.g. when the metric name contains hyphens or symbols and cannot be referenced from formulas.
Present for formula metrics. References other metrics in braces.
({New Contacts} / {Total Contacts}) * 100Display prefix for a formula metric.
Display suffix for a formula metric
GET /v3/scorecards/formulas/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
The formula metric.
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}Patches name, formula, prefix or suffix. Omitted fields are left unchanged. A changed formula is re-validated in full.
Renaming cascades, exactly as it does for segment metrics: scorecards holding the old name in metrics[]/metrics_columns[] are rewritten, and any other formula metric referencing {old name} is rewritten too. Affected scorecards are queued for recalculation. Without that they would keep the old name and silently resolve it to 0.
A segment-based custom metric is rejected here; use updateCustomMetric.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Unique per account (case-insensitive); scorecards and other formulas reference metrics by this name.
Arithmetic over other metrics, each referenced in braces. Outside a reference only digits, + - * / . ( ) , and the functions round, ceil, floor are permitted β anything else is stripped by the calculator and is rejected here rather than stored.
({New Contacts} / {Total Contacts}) * 100Display prefix, e.g. "$".
Display suffix, e.g. "%".
The updated formula metric.
cmt_6520f7e8a17700005f006059Unique per account. This is what a scorecard's metrics[] stores.
segment counts contacts matching a query and is writable here. formula computes from other metrics and is writable via /scorecards/formulas.
Which date field constrains the metric to the scorecard's window. "" means no date constraint. Null means the field is absent, which the calculator treats as add_date.
Whether this metric's name contains only characters supported in formula references.
Warning messages, e.g. when the metric name contains hyphens or symbols and cannot be referenced from formulas.
Present for formula metrics. References other metrics in braces.
({New Contacts} / {Total Contacts}) * 100Display prefix for a formula metric.
Display suffix for a formula metric
PATCH /v3/scorecards/formulas/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 101
{
"name": "text",
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}The updated formula metric.
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}Removes the formula permanently. Refused with 409 metric_in_use while a scorecard still references it by name.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Deleted.
No content
Still referenced by one or more scorecards.
DELETE /v3/scorecards/formulas/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Account-defined metrics that a scorecard can reference. Two kinds share this listing, told apart by kind:
segmentβ counts the contacts matchingquery.segment_users, the same condition DSL segments use, within the windowmetric_dateselects. Writable through these endpoints.formulaβ computed from other metrics, e.g.({New Contacts} / {Total Contacts}) * 100. Writable through/scorecards/formulas.
Filter with filter[kind]=segment|formula and filter[name]=<prefix>.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Page size. Default 25, max 100.
25Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442A page of custom metrics.
GET /v3/scorecards/custom_metrics HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
A page of custom metrics.
{
"object": "list",
"data": [
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}
],
"has_more": true,
"next_cursor": "text"
}Defines a metric as a named query: it counts the contacts matching query.segment_users, within the window metric_date selects.
name must be unique on the account β case-insensitively. "Total Visits" and "total visits" are the same metric for this check, because scorecard matching is case-sensitive and a case-only twin would silently make one of them unreachable. A collision is a 422 naming the existing metric.
A name containing characters the formula parser cannot match β hyphens, %, # β is still accepted, because such a metric works fine on a scorecard. It comes back with is_formula_referenceable: false and a not_formula_referenceable: entry in warnings[], telling you it cannot be referenced from a formula metric.
metric_date decides what the number actually counts, and has three distinct states worth knowing apart:
a field name, e.g.
memberships.start_dateβ the metric counts matches whose date falls in the scorecard's reporting window""β no date constraint; counts every match regardless of periodomitted β defaults to
add_date, matching the dashboard's own calculator
query takes the same shape as a segment's: segment_users[] plus optional with_or_segment_users[] for OR groups. Call describeSegmentSchema for the categories, attributes and operators available on the workroom.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Unique per account (case-insensitive); scorecards reference metrics by this name. Names should contain only letters, numbers, spaces, dots, or underscores to be referenceable in formula expressions.
Which date field constrains the metric to the reporting window. "" is a real choice meaning no date constraint. Omitted on create, defaults to add_date.
The created metric.
cmt_6520f7e8a17700005f006059Unique per account. This is what a scorecard's metrics[] stores.
segment counts contacts matching a query and is writable here. formula computes from other metrics and is writable via /scorecards/formulas.
Which date field constrains the metric to the scorecard's window. "" means no date constraint. Null means the field is absent, which the calculator treats as add_date.
Whether this metric's name contains only characters supported in formula references.
Warning messages, e.g. when the metric name contains hyphens or symbols and cannot be referenced from formulas.
Present for formula metrics. References other metrics in braces.
({New Contacts} / {Total Contacts}) * 100Display prefix for a formula metric.
Display suffix for a formula metric
POST /v3/scorecards/custom_metrics HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 100
{
"name": "text",
"metric_date": "add_date",
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
}
}The created metric.
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}The metric's definition. A formula metric returns its expression and display affixes; a segment metric returns its query.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
cmt_6520f7e8a17700005f006059Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442The metric.
cmt_6520f7e8a17700005f006059Unique per account. This is what a scorecard's metrics[] stores.
segment counts contacts matching a query and is writable here. formula computes from other metrics and is writable via /scorecards/formulas.
Which date field constrains the metric to the scorecard's window. "" means no date constraint. Null means the field is absent, which the calculator treats as add_date.
Whether this metric's name contains only characters supported in formula references.
Warning messages, e.g. when the metric name contains hyphens or symbols and cannot be referenced from formulas.
Present for formula metrics. References other metrics in braces.
({New Contacts} / {Total Contacts}) * 100Display prefix for a formula metric.
Display suffix for a formula metric
GET /v3/scorecards/custom_metrics/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
The metric.
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}Patches name, metric_date or query. Omitted fields are left unchanged.
Renaming cascades. Every scorecard whose metrics[] or metrics_columns[] holds the old name is rewritten to the new one, and every formula metric whose expression references {old name} is rewritten too. Those scorecards are then queued for recalculation (calculation_status reverts to pending), because their stored values are still keyed by the old name. Nothing is left rendering an empty tile. Delete is the operation that is refused outright while references exist (409 metric_in_use); rename is safe.
Formula metrics are rejected here: they are a different shape with their own endpoints β POST /scorecards/formulas and PATCH /scorecards/formulas/{id}.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Unique per account (case-insensitive); scorecards reference metrics by this name. Names should contain only letters, numbers, spaces, dots, or underscores to be referenceable in formula expressions.
Which date field constrains the metric to the reporting window. "" is a real choice meaning no date constraint. Omitted on create, defaults to add_date.
The updated metric.
cmt_6520f7e8a17700005f006059Unique per account. This is what a scorecard's metrics[] stores.
segment counts contacts matching a query and is writable here. formula computes from other metrics and is writable via /scorecards/formulas.
Which date field constrains the metric to the scorecard's window. "" means no date constraint. Null means the field is absent, which the calculator treats as add_date.
Whether this metric's name contains only characters supported in formula references.
Warning messages, e.g. when the metric name contains hyphens or symbols and cannot be referenced from formulas.
Present for formula metrics. References other metrics in braces.
({New Contacts} / {Total Contacts}) * 100Display prefix for a formula metric.
Display suffix for a formula metric
PATCH /v3/scorecards/custom_metrics/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 100
{
"name": "text",
"metric_date": "add_date",
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
}
}The updated metric.
{
"object": "custom_metric",
"id": "cmt_6520f7e8a17700005f006059",
"name": "text",
"kind": "segment",
"metric_date": "text",
"is_formula_referenceable": true,
"warnings": [
"text"
],
"query": {
"segment_users": [
{}
],
"with_or_segment_users": [
{}
]
},
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "text"
}Removes the definition permanently.
Refused with 409 metric_in_use while any scorecard still references the metric by name, and the error names those scorecards. Without that check the scorecard would keep the name and render an empty tile with no error anywhere.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Deleted.
No content
Still referenced by one or more scorecards.
DELETE /v3/scorecards/custom_metrics/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Every metric name valid on this account: the built-in metrics grouped by category, plus the account's own custom and formula metrics.
A scorecard's metrics[] stores these names verbatim and matches them exactly. A name that is not in this catalog is rejected on create and update; before that check existed, it saved cleanly and rendered as an empty tile.
Three groups come back:
builtinβ the fixed metrics, keyed by category (Contacts, Customers, Sales, User Activity, Contacts Activity, Business Metrics).custom_metricsβ account-defined metrics that count the contacts matching a saved query.formula_metricsβ metrics computed from other metrics, with the expression and its display prefix/suffix. The expression references other metrics in braces, e.g.({New Contacts} / {Total Contacts}) * 100.
all_names is the flat union, which is what metrics[] is validated against.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442The metric catalog for this account.
The metric names a scorecard may reference on this account.
Flat union of every valid name. This is what metrics[] is checked against.
Metric names that exist and can be placed on a scorecard, but cannot be referenced inside formulas because of special characters (e.g. %, #, -).
Advisory note indicating that scorecard metrics must match all_names exactly and unknown names are rejected with 422.
GET /v3/scorecards/metrics HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
The metric catalog for this account.
{
"object": "metric_catalog",
"builtin": {
"Contacts": [
"New Contacts",
"Total Contacts",
"Contacts Engaged"
]
},
"custom_metrics": [
{
"name": "text",
"has_criteria": true
}
],
"formula_metrics": [
{
"name": "text",
"formula": "({New Contacts} / {Total Contacts}) * 100",
"prefix": "text",
"suffix": "%"
}
],
"all_names": [
"text"
],
"not_referenceable": [
"text"
],
"note": "text"
}Account-wide β not scoped by workroom (see the Scorecards tag description and workroom_scoped on each item). Filters: ?filter[breakdown]=..., ?filter[type]=..., ?filter[name]=... (case-insensitive prefix). Sortable fields: created_at (default, descending), name.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.
Page size. Default 25, max 100.
25Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.
Comma-separated list of fields to sort by. Leading - reverses. Default -created_at. Sortable fields vary per resource; unsortable fields return 400 invalid_sort_field.
-created_at,emailWhether to include metrics_values in each scorecard item. Defaults to false to keep response size manageable. Set to true to include full calculated metric values.
falseMinor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1OK
True if additional records exist beyond this page.
Opaque cursor for the next page. Null on the last page.
Cursor for the previous page. Supported on listContacts and listSegmentContacts: pass it back as ?before=... to page backward; null on the first page. On every other list endpoint paging is forward-only and this is always null.
Rate limited.
GET /v3/scorecards HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "text",
"data": [
{
"id": "text",
"object": "scorecard",
"name": "text",
"type": "text",
"breakdown": "text",
"metrics": [
"text"
],
"pipeline_ids": [
"text"
],
"total_rollup": true,
"responsible_user_role": "text",
"responsible_user_ids": [
"text"
],
"location_type": "text",
"location_ids": [
"text"
],
"workroom_type": "text",
"workroom_ids": [
"text"
],
"workroom_scoped": true,
"scope_note": "text",
"calculation_status": "pending",
"calculation_error": "text",
"metrics_calculated_at": "2026-05-27T14:23:11.482Z",
"metrics_values": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"inactive": true,
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z"
}
],
"has_more": true,
"next_cursor": "text",
"prev_cursor": "text"
}Writes only the scorecard definition β metric values are computed asynchronously by the existing periodic dashboard cron (Cron::calculateScorecards()), the same job that has always computed them for dashboard-created scorecards; this endpoint does not trigger it synchronously. Returns 202, not 201: the response body is the full definition with calculation_status: "pending", not yet-computed values. Poll GET /scorecards/{id} for calculation_status to flip to completed.
Requires the name and what it measures. Optional fields fall back to a server-side default when omitted. That includes the workroom: an omitted workroom resolves to the account default, and a record created in the wrong workroom is invisible where it was expected. Half-specified records are created successfully and then have to be hunted down and fixed by hand.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1Case-insensitive; stored canonical. Any other value is a 422. See the Scorecard schema.
Case-insensitive; stored canonical. Any other value is a 422, as is None with type Table. See the Scorecard schema.
Non-empty array of metric names. Every element must be a non-empty string.
falseRequired (defaults to All) when breakdown is Responsible User. Use Specific Users with responsible_user_ids to restrict.
Only used when responsible_user_role is Specific Users. Accepts usr_-prefixed or raw ids; stored raw.
Required (defaults to All) when breakdown is Location. Use Specific Locations with location_ids to restrict.
Only used when location_type is Specific Locations.
Report-breakdown dimension only β see the Scorecard schema. Required (defaults to All) when breakdown is Workroom. Use Specific Workrooms with workroom_ids to restrict.
Only used when workroom_type is Specific Workrooms. Accepts wrm_-prefixed or raw ids; stored raw.
Scorecard definition created; metric calculation is pending.
Account-wide metrics table. Shaped identically regardless of whether the underlying doc was created by this API or by the legacy dashboard (Apps::ajaxSaveScorecard()) β both write the same fields to the same scorecards collection.
^scr_[0-9a-f]{24}$Chart/display type β one of Table, Metric, Line, Bar, Trend (the values the dashboard renders; Trend is legacy and charted like Line). Writes accept these case-insensitively (also # Metric, bar_chart, ...) and store the canonical spelling; anything else is a 422. Scorecards saved before this check may still carry another value.
How rows are sliced β one of None (aggregate only), Source, Location, Workroom, Responsible User. Writes accept these case-insensitively (also responsible_user, staff, aggregate) and store the canonical spelling; anything else is a 422. None is not available with type Table (as in the dashboard). Only Responsible User, Location, and Workroom have corresponding *_type/*_ids side fields (see below); None and Source leave all three side-field groups null.
Metric names to track (e.g. "New Contacts", "Total Contacts"). Every element must be a non-empty string β an object or other non-string element is rejected with a 400/422, not silently coerced.
Optional. Restricts pipeline-related metrics to these pipelines.
Add a combined total-rollup row across all breakdown groups.
Only populated when breakdown is Responsible User. Dashboard UI offers All, Admin, WorkroomAdmin, Marketing, Sales, Analyst, Specific Users.
Raw staff-record ids (not usr_-prefixed) β only populated when responsible_user_role is Specific Users.
Only populated when breakdown is Location. Dashboard UI offers All, Specific Locations.
Raw location values β only populated when location_type is Specific Locations.
Report-breakdown dimension only β unrelated to the Gleantap-Workroom request-scoping header/query. Only populated when breakdown is Workroom. Dashboard UI offers All, Specific Workrooms.
Raw workroom ids β only populated when workroom_type is Specific Workrooms.
Always false. The underlying scorecards collection has no app_id/workroom field at all, so this resource is account-wide regardless of any Gleantap-Workroom header/?workroom= hint on the request β see scope_note.
Plain-English restatement of workroom_scoped, always present so a caller does not have to infer scoping behavior from testing.
Derived from the same fields the existing periodic Cron::calculateScorecards() sweep reads/writes on this same doc β this endpoint never computes metric values itself. A fresh scorecard reads pending until that sweep's next pass. Editing a scorecard (PATCH) clears its last calculation time, so it reads pending until the sweep recalculates it. A scorecard that completed calculation but produced no metric values reads error with an explanation in calculation_error. The sweep runs overnight (01:06β09:45 UTC); until then the dashboard shows the previous values, and its refresh button recalculates on demand.
Explanation when calculation_status is error (e.g. calculation failed or produced no metric values).
RFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRequest could not be parsed or failed validation.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
Rate limited.
POST /v3/scorecards HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 146
{
"name": "Rep Performance",
"type": "Table",
"breakdown": "Responsible User",
"responsible_user_role": "All",
"metrics": [
"New Contacts",
"Total Contacts"
]
}{
"id": "text",
"object": "scorecard",
"name": "text",
"type": "text",
"breakdown": "text",
"metrics": [
"text"
],
"pipeline_ids": [
"text"
],
"total_rollup": true,
"responsible_user_role": "text",
"responsible_user_ids": [
"text"
],
"location_type": "text",
"location_ids": [
"text"
],
"workroom_type": "text",
"workroom_ids": [
"text"
],
"workroom_scoped": true,
"scope_note": "text",
"calculation_status": "pending",
"calculation_error": "text",
"metrics_calculated_at": "2026-05-27T14:23:11.482Z",
"metrics_values": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"inactive": true,
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z"
}A scorecard's definition and its current metric values.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
^scr_[0-9a-f]{24}$Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1OK
Account-wide metrics table. Shaped identically regardless of whether the underlying doc was created by this API or by the legacy dashboard (Apps::ajaxSaveScorecard()) β both write the same fields to the same scorecards collection.
^scr_[0-9a-f]{24}$Chart/display type β one of Table, Metric, Line, Bar, Trend (the values the dashboard renders; Trend is legacy and charted like Line). Writes accept these case-insensitively (also # Metric, bar_chart, ...) and store the canonical spelling; anything else is a 422. Scorecards saved before this check may still carry another value.
How rows are sliced β one of None (aggregate only), Source, Location, Workroom, Responsible User. Writes accept these case-insensitively (also responsible_user, staff, aggregate) and store the canonical spelling; anything else is a 422. None is not available with type Table (as in the dashboard). Only Responsible User, Location, and Workroom have corresponding *_type/*_ids side fields (see below); None and Source leave all three side-field groups null.
Metric names to track (e.g. "New Contacts", "Total Contacts"). Every element must be a non-empty string β an object or other non-string element is rejected with a 400/422, not silently coerced.
Optional. Restricts pipeline-related metrics to these pipelines.
Add a combined total-rollup row across all breakdown groups.
Only populated when breakdown is Responsible User. Dashboard UI offers All, Admin, WorkroomAdmin, Marketing, Sales, Analyst, Specific Users.
Raw staff-record ids (not usr_-prefixed) β only populated when responsible_user_role is Specific Users.
Only populated when breakdown is Location. Dashboard UI offers All, Specific Locations.
Raw location values β only populated when location_type is Specific Locations.
Report-breakdown dimension only β unrelated to the Gleantap-Workroom request-scoping header/query. Only populated when breakdown is Workroom. Dashboard UI offers All, Specific Workrooms.
Raw workroom ids β only populated when workroom_type is Specific Workrooms.
Always false. The underlying scorecards collection has no app_id/workroom field at all, so this resource is account-wide regardless of any Gleantap-Workroom header/?workroom= hint on the request β see scope_note.
Plain-English restatement of workroom_scoped, always present so a caller does not have to infer scoping behavior from testing.
Derived from the same fields the existing periodic Cron::calculateScorecards() sweep reads/writes on this same doc β this endpoint never computes metric values itself. A fresh scorecard reads pending until that sweep's next pass. Editing a scorecard (PATCH) clears its last calculation time, so it reads pending until the sweep recalculates it. A scorecard that completed calculation but produced no metric values reads error with an explanation in calculation_error. The sweep runs overnight (01:06β09:45 UTC); until then the dashboard shows the previous values, and its refresh button recalculates on demand.
Explanation when calculation_status is error (e.g. calculation failed or produced no metric values).
RFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZThe resource doesn't exist or isn't visible to this caller.
GET /v3/scorecards/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "text",
"object": "scorecard",
"name": "text",
"type": "text",
"breakdown": "text",
"metrics": [
"text"
],
"pipeline_ids": [
"text"
],
"total_rollup": true,
"responsible_user_role": "text",
"responsible_user_ids": [
"text"
],
"location_type": "text",
"location_ids": [
"text"
],
"workroom_type": "text",
"workroom_ids": [
"text"
],
"workroom_scoped": true,
"scope_note": "text",
"calculation_status": "pending",
"calculation_error": "text",
"metrics_calculated_at": "2026-05-27T14:23:11.482Z",
"metrics_values": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"inactive": true,
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z"
}Partial update β only send the fields you want to change. Per update_for_account(), any successful update unconditionally queues the scorecard for recalculation (calculation_status reverts to pending) regardless of which fields changed β there is no field-level diffing that skips recalculation for a cosmetic-only change (e.g. renaming). This matches the legacy dashboard's own full-form save behavior. Changing breakdown recomputes all three breakdown side-field groups (responsible_user_*, location_*, workroom_*) from this same request body β the other two groups are cleared.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
^scr_[0-9a-f]{24}$Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1Fields to update on a scorecard. All fields are optional.
Case-insensitive; stored canonical. Any other value is a 422. See the Scorecard schema.
Case-insensitive; stored canonical. Any other value is a 422, as is None with type Table. See the Scorecard schema.
Non-empty array of metric names. Every element must be a non-empty string.
falseUsed when breakdown is Responsible User. Use Specific Users with responsible_user_ids to restrict.
Only used when responsible_user_role is Specific Users. Accepts usr_-prefixed or raw ids; stored raw.
Used when breakdown is Location. Use Specific Locations with location_ids to restrict.
Only used when location_type is Specific Locations.
Report-breakdown dimension only β see the Scorecard schema. Used when breakdown is Workroom. Use Specific Workrooms with workroom_ids to restrict.
Only used when workroom_type is Specific Workrooms. Accepts wrm_-prefixed or raw ids; stored raw.
OK β definition updated synchronously; recalculation is still async (see calculation_status).
Account-wide metrics table. Shaped identically regardless of whether the underlying doc was created by this API or by the legacy dashboard (Apps::ajaxSaveScorecard()) β both write the same fields to the same scorecards collection.
^scr_[0-9a-f]{24}$Chart/display type β one of Table, Metric, Line, Bar, Trend (the values the dashboard renders; Trend is legacy and charted like Line). Writes accept these case-insensitively (also # Metric, bar_chart, ...) and store the canonical spelling; anything else is a 422. Scorecards saved before this check may still carry another value.
How rows are sliced β one of None (aggregate only), Source, Location, Workroom, Responsible User. Writes accept these case-insensitively (also responsible_user, staff, aggregate) and store the canonical spelling; anything else is a 422. None is not available with type Table (as in the dashboard). Only Responsible User, Location, and Workroom have corresponding *_type/*_ids side fields (see below); None and Source leave all three side-field groups null.
Metric names to track (e.g. "New Contacts", "Total Contacts"). Every element must be a non-empty string β an object or other non-string element is rejected with a 400/422, not silently coerced.
Optional. Restricts pipeline-related metrics to these pipelines.
Add a combined total-rollup row across all breakdown groups.
Only populated when breakdown is Responsible User. Dashboard UI offers All, Admin, WorkroomAdmin, Marketing, Sales, Analyst, Specific Users.
Raw staff-record ids (not usr_-prefixed) β only populated when responsible_user_role is Specific Users.
Only populated when breakdown is Location. Dashboard UI offers All, Specific Locations.
Raw location values β only populated when location_type is Specific Locations.
Report-breakdown dimension only β unrelated to the Gleantap-Workroom request-scoping header/query. Only populated when breakdown is Workroom. Dashboard UI offers All, Specific Workrooms.
Raw workroom ids β only populated when workroom_type is Specific Workrooms.
Always false. The underlying scorecards collection has no app_id/workroom field at all, so this resource is account-wide regardless of any Gleantap-Workroom header/?workroom= hint on the request β see scope_note.
Plain-English restatement of workroom_scoped, always present so a caller does not have to infer scoping behavior from testing.
Derived from the same fields the existing periodic Cron::calculateScorecards() sweep reads/writes on this same doc β this endpoint never computes metric values itself. A fresh scorecard reads pending until that sweep's next pass. Editing a scorecard (PATCH) clears its last calculation time, so it reads pending until the sweep recalculates it. A scorecard that completed calculation but produced no metric values reads error with an explanation in calculation_error. The sweep runs overnight (01:06β09:45 UTC); until then the dashboard shows the previous values, and its refresh button recalculates on demand.
Explanation when calculation_status is error (e.g. calculation failed or produced no metric values).
RFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRFC 3339 timestamp, always UTC, millisecond precision.
2026-05-27T14:23:11.482ZRequest could not be parsed or failed validation.
The resource doesn't exist or isn't visible to this caller.
Semantic validation failed β the request is well-formed but references an object in the wrong state (e.g., sending to an opted-out contact).
PATCH /v3/scorecards/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 270
{
"name": "text",
"type": "Table",
"breakdown": "None",
"metrics": [
"text"
],
"pipeline_ids": [
"text"
],
"total_rollup": false,
"responsible_user_role": "text",
"responsible_user_ids": [
"text"
],
"location_type": "text",
"location_ids": [
"text"
],
"workroom_type": "text",
"workroom_ids": [
"text"
]
}{
"id": "text",
"object": "scorecard",
"name": "text",
"type": "text",
"breakdown": "text",
"metrics": [
"text"
],
"pipeline_ids": [
"text"
],
"total_rollup": true,
"responsible_user_role": "text",
"responsible_user_ids": [
"text"
],
"location_type": "text",
"location_ids": [
"text"
],
"workroom_type": "text",
"workroom_ids": [
"text"
],
"workroom_scoped": true,
"scope_note": "text",
"calculation_status": "pending",
"calculation_error": "text",
"metrics_calculated_at": "2026-05-27T14:23:11.482Z",
"metrics_values": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"inactive": true,
"created_at": "2026-05-27T14:23:11.482Z",
"updated_at": "2026-05-27T14:23:11.482Z"
}'No reference-counting or force needed β a scorecard is a read-only report over other entities; nothing else in the data model references a scorecard by id.'
Permanent. There is no undo and no trash to restore from. Anything that references the deleted record is affected too.
The API Secret from the Gleantap dashboard under Settings β API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.
Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.
For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.
^scr_[0-9a-f]{24}$Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.
2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.
A staff token MUST name an account on every request β there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β list IDs with GET /v3/accounts.
Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.
acc_59fca1e3d2a57d28a10b0442Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.
On any write, ask the user which workroom β do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.
The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β if it returns a single row, use it; if it returns several, ask which one before writing.
Reads are scoped too. Omitting a workroom on a read does not span the account β it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.
Also settable via ?workroom= or a workroom body field (POST/PATCH only) β query wins over header wins over body.
G Test1Deleted.
No content
The resource doesn't exist or isn't visible to this caller.
DELETE /v3/scorecards/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content