Part3 Developers

Project document aggregate

GET /organization/{orgId}/project/{projectId}/aggregates/documents

Count and measure a project's documents

GET
/organization/{orgId}/project/{projectId}/aggregates/documents
AuthorizationBearer <token>

In: header

Path Parameters

orgId*string
projectId*string

Query Parameters

population?string

Which documents to count, by a named rule from the code (open, overdue, returned, wentLate …). Default all.

Default"all"
Value in"all" | "draft" | "open" | "done" | "cancelled" | "awaitingCloseOut" | "overdue" | "returned" | "wentLate" | "onTime" | "firstSubmission" | "resubmission" | "pendingChange" | "approvedChange" | "cashAllowance"
versions?string

latest counts each document once, at its current version. all counts every version.

Default"latest"
Value in"latest" | "all"
drafts?string

Whether a review verdict saved and not yet submitted counts. exclude (the default) leaves such drafts out while the submittal is open, so its review status, answered responses and review time read submitted verdicts only. include counts every saved verdict, as the web app stores the outcome. On a done or cancelled submittal every saved verdict counts either way.

Default"exclude"
Value in"exclude" | "include"
filter.type?string

Document type: a comma list; write a comma or a backslash inside a value as , or \. type in the list. Values: Bulletin, CA, CD, Certificate, CO, minute, PC, Quote, report, RFI, SI, Submittal.

Lengthlength <= 500
filter.format?string

Format: a comma list; write a comma or a backslash inside a value as , or \. format in the list. Values: bulletin, certificate, change, instruction, quote, rfi, submittal.

Lengthlength <= 500
filter.status?string

Status: a comma list; write a comma or a backslash inside a value as , or \. status in the list. Values: accepted, approved, cancelled, closed, draft, issued, locked, needs-work, payApp-approved, payApp-consultant-review, payApp-creator-draft, payApp-creator-revise, pending, resubmitted, returned, revision, submitted, with-consultants.

Lengthlength <= 500
filter.reviewStatus?string

Review outcome: a comma list; write a comma or a backslash inside a value as , or \. The review outcome (the reviewStatus dimension, read under drafts) in the list. Values: rejected, revise-and-resubmit, revise-and-resubmit-for-record, reviewed-as-noted-partial-resubmit, reviewed-as-noted, reviewed, not-required-for-review, not-reviewed, for-record-only, under-review, pending.

Lengthlength <= 500
filter.specDivision?string

Spec division: a comma list; write a comma or a backslash inside a value as , or \. normalized_division_code in the list.

Lengthlength <= 500
filter.discipline?string

Discipline: a comma list; write a comma or a backslash inside a value as , or \. A consultant in one of the disciplines reviews the document, through a section or a step response, any case.

Lengthlength <= 500
filter.company?string

Company: a comma list; write a comma or a backslash inside a value as , or \. A consultant in one of the companies reviews the document, through a section or a step response.

Lengthlength <= 500
filter.assigneeId?string

Assignee: a comma list; write a comma or a backslash inside a value as , or \. A live assignment to one of the users.

Lengthlength <= 500
filter.creatorId?string

Created by: a comma list; write a comma or a backslash inside a value as , or \. created_by is one of the users.

Lengthlength <= 500
filter.reason?string

Change reason: a comma list; write a comma or a backslash inside a value as , or \. document_change.reason in the list, change documents only (instructions and bulletins share the column).

Lengthlength <= 500
filter.createdAt?string

Created: from,to as YYYY-MM-DD, either side may be empty, both inclusive. Created between the two days, either side open.

Match^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?,(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?$
filter.receivedAt?string

Received: from,to as YYYY-MM-DD, either side may be empty, both inclusive. Received between the two days.

Match^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?,(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?$
filter.dueDate?string

Due: from,to as YYYY-MM-DD, either side may be empty, both inclusive. Due between the two days.

Match^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?,(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?$
filter.returnedAt?string

Returned: from,to as YYYY-MM-DD, either side may be empty, both inclusive. Returned between the two days; returned documents only.

Match^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?,(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?$
filter.issuedAt?string

Issued: from,to as YYYY-MM-DD, either side may be empty, both inclusive. Issued between the two days.

Match^(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?,(\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))?$
group?string

The first breakdown. One row per value, in the dimension's order.

Value in"type" | "format" | "status" | "statusClass" | "reviewStatus" | "specDivision" | "discipline" | "company" | "assignee" | "creator" | "dueWindow" | "overdueAge" | "version" | "onTime" | "reason" | "changeStage" | "ballInCourt" | "party" | "holderWhenLate"
split?string

A second breakdown inside each group (a stacked bar). At most two of group, split and bucketDate.

Value in"type" | "format" | "status" | "statusClass" | "reviewStatus" | "specDivision" | "discipline" | "company" | "assignee" | "creator" | "dueWindow" | "overdueAge" | "version" | "onTime" | "reason" | "changeStage" | "ballInCourt" | "party" | "holderWhenLate"
path?string

A flow, for a Sankey (P3-8551): 2 to 4 single-valued dimensions, comma separated, in stage order. The response carries flow (stages, nodes, links) and an empty rows. Not with group, split, bucketDate or order. Measures must add up (count, sum). top caps each stage with no fixed values (default 8). A row with no value at a stage leaves the flow there; includeNull makes that a None node instead.

Match^[A-Za-z]+(,[A-Za-z]+)*$
Lengthlength <= 200
bucketDate?string

A time axis: which date to bucket on. Every bucket in the window is returned, empty ones included. Only dueDate buckets run past today.

Value in"createdAt" | "receivedAt" | "dueDate" | "returnedAt" | "issuedAt" | "submittedAt"
bucketInterval?string

Bucket size. Most buckets per request: day 365, week 52, month 24, quarter 12.

Default"month"
Value in"day" | "week" | "month" | "quarter"
from?string

First day of the time axis, YYYY-MM-DD, in the response's zone. With bucketDate only. Default: 12 buckets ending with the current one; for dueDate, 12 buckets starting 3 before the current one.

Formatdate
to?string

Last day of the time axis, inclusive. With bucketDate only. Clamped to today for every date but dueDate.

Formatdate
includeNull?boolean

Adds a "No due date" bucket or a "None" group for rows without a value.

Defaultfalse
measure?string

1 to 4 measure tokens, comma separated, as fn[.field][:population]: count, countDistinct.project, countDistinct.assignee, countDistinct.company, avg.turnaroundDays, median.turnaroundDays, p90.turnaroundDays, median.daysOverdue, avg.daysLate, median.daysLate, median.ageDays, median.quoteDays, median.issueDays, avg.submissions, share.onTime, share.wentLate, share.resubmission, sum.value, sum.daysAdded, attr.contractValue, countPerContractMillion, ofContract.value, count.receivedAt, count.returnedAt, level.inReview, level.overdue, or one narrowed to a population such as count:open. A :population narrows that measure only.

Default"count"
Match^[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)?(:[a-zA-Z]+)?(,[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)?(:[a-zA-Z]+)?){0,3}$
Lengthlength <= 200
order?string

The group's order; needs group. Default: fixed where the dimension has a natural order (stage, due window), else value, largest first.

Value in"value" | "label" | "fixed"
top?integer

Keep the N largest groups by the first measure. Without top, a group with no fixed set of values (assignee, project …) keeps as many as fit the cell limit, at most 50, plus "Other". A top whose grid would pass the cell limit is a 400.

Range1 <= value <= 50
other?boolean

Fold the values cut by top, or by the default cap, into one "Other" value, so the totals still add up.

Defaulttrue
compare?string

How each figure moved against an earlier period (P3-9085): sets the request's window (its time axis, or its one date filter with a from day; a from day alone ends today) against an earlier one, and the answer is in comparison. previous: the same number of days, ending the day before the window. week, month, quarter, year: the same days one step earlier (a whole month moves back as a whole month); a median, average, percentile or share over this week, month, quarter or year so far compares with the whole one before. A level.* measure on a time axis compares its value at each end. Refused (400): with since; with path; with no window, two windows, or one that ends after today; with includeNull on a time axis; a step shorter than the window (the periods would overlap: use previous); any measure that cannot take it (definition.measures[].compares says which can). Never run two requests and subtract.

Value in"previous" | "week" | "month" | "quarter" | "year"
since?string

How each figure moved since the start of this day, YYYY-MM-DD (P3-9085); the figure itself is unchanged and the answer is in comparison. A count or sum: its rows dated before the day (a row with no date counts as before) against today's figure, on the population's date (returned: returnedAt) or sinceDate. A count or sum of open or overdue work: the count as it stood at the end of the day before, rebuilt from each document's dates as they are now. A median or share takes compare instead. Refused (400): with compare, bucketDate or path; a count or sum with no date to count from (name sinceDate); open or overdue work with a filter that reads today's value (status, reviewStatus, assigneeId, dueDate), an axis that reads today's value and leaves documents out (ballInCourt, party, holderWhenLate, onTime, changeStage; reviewStatus, assignee or overdueAge without includeNull=true; any of them with top and other=false), or at org scope; any measure that cannot take it.

Formatdate
sinceDate?string

With since only: the date a count or sum is counted from, when its population, its measure and the date filters name none (all documents filtered by status, say). A date a row can have by today.

Value in"createdAt" | "receivedAt" | "returnedAt" | "issuedAt" | "submittedAt"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.part3.io/v1/organization/string/project/string/aggregates/documents"
{
  "entity": "documents",
  "scope": {
    "orgId": "string",
    "projectId": "string",
    "projects": 0,
    "tz": "string"
  },
  "request": "string",
  "definition": {
    "rowUnit": "documents",
    "population": {
      "name": "string",
      "label": "string",
      "rule": "string"
    },
    "versions": "latest",
    "drafts": "exclude",
    "filters": [
      {
        "field": "string",
        "label": "string",
        "op": "in",
        "values": [
          "string"
        ]
      }
    ],
    "group": {
      "name": "string",
      "label": "string",
      "multiplicity": "one"
    },
    "split": {
      "name": "string",
      "label": "string",
      "multiplicity": "one"
    },
    "bucket": {
      "date": "string",
      "label": "string",
      "interval": "day",
      "from": "2019-08-24",
      "to": "2019-08-24"
    },
    "path": [
      {
        "name": "string",
        "label": "string"
      }
    ],
    "measures": [
      {
        "token": "string",
        "label": "string",
        "unit": "documents",
        "rule": "string",
        "compares": {
          "kind": "total",
          "steps": [
            "previous"
          ],
          "since": true,
          "sinceDate": "string",
          "why": "string"
        }
      }
    ],
    "text": "string"
  },
  "axes": {
    "group": [
      {
        "key": "string",
        "label": "string"
      }
    ],
    "split": [
      {
        "key": "string",
        "label": "string"
      }
    ],
    "bucket": [
      {
        "key": "string",
        "label": "string",
        "start": "2019-08-24",
        "end": "2019-08-24"
      }
    ]
  },
  "rows": [
    {
      "group": "string",
      "split": "string",
      "bucket": "string",
      "values": {
        "property1": 0,
        "property2": 0
      },
      "n": {
        "property1": 0,
        "property2": 0
      }
    }
  ],
  "flow": {
    "stages": [
      {
        "dimension": "string",
        "label": "string",
        "values": [
          {
            "key": "string",
            "label": "string"
          }
        ]
      }
    ],
    "nodes": [
      {
        "stage": 0,
        "key": "string",
        "values": {
          "property1": 0,
          "property2": 0
        },
        "n": {
          "property1": 0,
          "property2": 0
        }
      }
    ],
    "links": [
      {
        "from": {
          "stage": 0,
          "key": "string"
        },
        "to": {
          "stage": 0,
          "key": "string"
        },
        "values": {
          "property1": 0,
          "property2": 0
        },
        "n": {
          "property1": 0,
          "property2": 0
        }
      }
    ]
  },
  "totals": {
    "values": {
      "property1": 0,
      "property2": 0
    },
    "n": {
      "property1": 0,
      "property2": 0
    },
    "distinct": 0
  },
  "truncated": true,
  "comparison": {
    "asked": {
      "compare": "previous",
      "since": "2019-08-24",
      "sinceDate": "string"
    },
    "figures": [
      {
        "measure": "string",
        "kind": "total",
        "basis": "daysBefore",
        "date": "string",
        "current": {
          "from": "2019-08-24",
          "to": "2019-08-24",
          "value": 0,
          "n": 0
        },
        "earlier": {
          "from": "2019-08-24",
          "to": "2019-08-24",
          "value": 0,
          "n": 0
        },
        "change": 0,
        "changePercent": 0,
        "direction": "up",
        "reads": "better",
        "reason": "noRows",
        "text": "string"
      }
    ]
  },
  "generatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Insufficient permissions"
}
{
  "error": "Insufficient permissions"
}
{
  "error": "Insufficient permissions"
}
{
  "error": "Insufficient permissions"
}
{
  "error": "Insufficient permissions"
}