Skip to content
GitmoapAPIBeta
Organizecontributions
GET/service-accounts/{sa_id}/contributions

A service account's contribution heatmap.

get_sa_contributions

The account's contributions per UTC day, with totals and streaks. Anyone signed in who can see the service account may read it (Reporters and above on a private home group or repository). The range defaults to the trailing 365 days; pass year for a calendar year, or from and to (at most 366 days).

Parameters

Path
  • sa_idServiceAccountId (string · uuid)Service account ID
Query
  • yearinteger · int32optionalConvenience: whole calendar year. Exclusive with from/to.
  • fromstringoptionalInclusive range start (YYYY-MM-DD).
  • tostringoptionalInclusive range end (YYYY-MM-DD).

Responses

200Contribution heatmapapplication/json
  • cellsarray of ContributionCellSparse, ascending by date. Only days with activity.
  • current_streakinteger · int64Consecutive active days ending at to.
  • fromstringResolved inclusive range start, YYYY-MM-DD.
  • longest_streakinteger · int64Longest run of consecutive active days within the range.
  • max_per_dayinteger · int64Largest single-day count (frontend color-scale denominator).
  • principal_idstringThe subject user or service account id.
  • principal_typestringuser or service_account.
  • tostringResolved inclusive range end, YYYY-MM-DD.
  • totalinteger · int64Sum of count across all cells in range.
200 exampleSynthesized example
{
"cells": [
{
"by_type": {
"commits": 52,
"issues": 74,
"mrs": 27,
"releases": 28,
"reviews": 49
},
"count": 4,
"date": "date-7a5d"
},
{
"by_type": {
"commits": 24,
"issues": 18,
"mrs": 36,
"releases": 22,
"reviews": 65
},
"count": 5,
"date": "date-cf26"
}
],
"current_streak": 13,
"from": "from-3a92",
"longest_streak": 85,
"max_per_day": 73,
"principal_id": "3d0ece41-79b8-4f24-8b0a-5d3834f9cbdd",
"principal_type": "principal-type-664c",
"to": "to-25c8",
"total": 1
}
400Invalid queryapplication/json
Error codes
  • BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-45e1",
"message": "Label every synthesized example"
}
}
401Unauthenticatedapplication/json
Error codes
  • UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-e1ab",
"message": "Stream pipeline status into the run header"
}
}
403Forbiddenapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names it
  • PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-66e3",
"message": "Inline scalar newtypes but keep their brand"
}
}
404Service account not foundapplication/json
Error codes
  • NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-0ea2",
"message": "Pin a page's payload to the build that rendered it"
}
}

CLI

gitmoap contributions get-sa-contributions

  • --sa-ididService account ID
  • --fromstringoptionalInclusive range start (YYYY-MM-DD).
  • --tostringoptionalInclusive range end (YYYY-MM-DD).
  • --yearnumberoptionalConvenience: whole calendar year. Exclusive with from/to.

Used in these guides