Organizecontributions
GET/users/{user_id}/contributions
Any user's public contribution heatmap.
get_user_contributions
user:read
A token needs theuser:readscope: Read user profilesGranted bymcp_agent,mcp_agent_write,read_api,write_api.Every operation this scope unlocks
The person's contributions per UTC day, counted only in the groups and repositories the caller
can see — public ones alone without signing in — so private work never shows up as a number.
The range defaults to the trailing 365 days; pass year for a calendar year, or from and to
(at most 366 days). An unknown user is not found.
Parameters
Path
- user_idUserId (string · uuid)User 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.- The ContributionCell schema
by_typeContributionByType
- The ContributionByType schema
- commitsinteger · int64
- issuesinteger · int64
- mrsinteger · int64
- releasesinteger · int64
- reviewsinteger · int64
- countinteger · int64
- datestringThe UTC calendar day,
YYYY-MM-DD.
- 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_typestring
userorservice_account. - tostringResolved inclusive range end,
YYYY-MM-DD. - totalinteger · int64Sum of
countacross all cells in range.
200 exampleSynthesized example
{
"cells": [
{
"by_type": {
"commits": 2,
"issues": 14,
"mrs": 15,
"releases": 74,
"reviews": 26
},
"count": 0,
"date": "date-249d"
}
],
"current_streak": 88,
"from": "from-db8d",
"longest_streak": 68,
"max_per_day": 73,
"principal_id": "90e6288f-873b-46cc-868e-99b56d42771c",
"principal_type": "principal-type-4c07",
"to": "to-f3c7",
"total": 0
}
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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-da64",
"message": "Label every synthesized example"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-c3b6",
"message": "Inline scalar newtypes but keep their brand"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
- FORBIDDENYou are signed in but may not do this here;
reasonnames the permission or the rule that refused it - INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs;
required_scopenames 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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-157f",
"message": "Stream pipeline status into the run header"
}
}
404User 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
reasonorcode. - fieldstring or nulloptionalOn a
400that 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 oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): 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-ae92",
"message": "Pin a page's payload to the build that rendered it"
}
}
CLI
gitmoap contributions get-user-contributions
- --user-ididUser ID
- --fromstringoptionalInclusive range start (YYYY-MM-DD).
- --tostringoptionalInclusive range end (YYYY-MM-DD).
- --yearnumberoptionalConvenience: whole calendar year. Exclusive with from/to.