Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-GitHits-Client-Name
string

Optional client attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.

X-GitHits-Client-Version
string

Optional client-version attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.

X-GitHits-Agent
string

Optional agent attribution: trimmed printable ASCII, at most 160 bytes. Invalid optional values are dropped.

X-GitHits-Session-ID
string

Optional caller-defined session ID: one to 64 ASCII letters, digits, underscores or hyphens, preserved exactly. Supply the header at most once. Invalid supplied IDs return 400 INVALID_SESSION_ID; no session is created.

Required string length: 1 - 64
Pattern: ^[A-Za-z0-9_-]{1,64}$

Body

application/json

Selection for a source or hosted-site inventory page. Unknown and null controls are rejected.

target
string
required

Package, repository, or documentation site to browse, such as npm:express@5.2.1, github:expressjs/express, or site:expressjs.com/en. Must not be blank.

Minimum string length: 1
after
string

Opaque continuation. Blank starts page one; preserve a nonblank cursor unchanged and repeat the same selection.

file_types
string[]

File-type labels for source files, such as config. Up to 64 values; surrounding whitespace is removed and case is ignored. Omit or use [] for no filter. For extensions, use a paths glob.

Maximum array length: 64
intents
enum<string>[]

Include source files with any listed purpose, such as production or test. Up to 64 values; omit or use [] for no filter.

Maximum array length: 64

Purpose of a source file; inclusion values form a union.

Available options:
production,
test,
benchmark,
example,
generated,
fixture,
build,
vendor
languages
string[]

Language labels for source files, such as JavaScript. Up to 64 values; surrounding whitespace is removed and case is ignored. Omit or use [] for no filter.

Maximum array length: 64
limit
integer<int32>
default:100

Maximum entries on this page, 1 through 500; default 100. The response does not report a total across pages.

Required range: 1 <= x <= 500
paths
string[]

Paths or globs relative to the target; entries matching any selector are included. Omit or use [] for the root. Up to 1000 nonblank selectors of 2048 UTF-8 bytes each. On sites, / alone selects the root; a leading / on another selector is optional.

Maximum array length: 1000
recursive
boolean
default:false

Default false lists immediate directory children. True expands selected directories to leaves; glob depth is independent.

wait_timeout_ms
integer<int32>
default:0

Time to wait for source indexing or an empty site to become available, 0 through 210000 milliseconds; default 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after the wait ends.

Required range: 0 <= x <= 210000

Response

One page of paths with read and browse actions and content availability

One page of paths, with actions for reading entries or browsing directories and information about content availability.

available_versions
object[] | null
required

Indexed package versions or repository refs for immediate retry; null for sites.

canonical_target
string | null
required

Resolved package version, repository commit, or stable site domain root; a sole redirect may retain its scope. Null while unavailable.

code_index_state
null | enum<string>
required

Source freshness or preparation state; null for sites.

Available options:
current,
stale,
provisional,
indexing,
pending,
failed,
not_found,
unresolvable
coverage_reason
string | null
required

Explanation of site coverage, when available for a single documentation collection; otherwise null.

coverage_state
null | enum<string>
required

Coverage of a single documentation collection; null for combined collections or source files. An empty entries list does not prove complete coverage.

Available options:
none,
partial,
capped,
complete
crawl_status
null | enum<string>
required

Latest crawl state when the selection has a single documentation collection; null for combined collections or source files.

Available options:
idle,
running,
complete,
failed
entries
object[]
required

Files, pages, and directories on this page, in listing order.

has_more
boolean
required

Whether another inventory page is available.

indexed_version
string | null
required

Served source ref; null for sites or unprepared source.

indexing_estimate
null | object
required

Source preparation estimate, when known.

indexing_ref
string | null
required

Opaque active source preparation reference, or null.

indexing_status
null | enum<string>
required

Source indexing lifecycle; prefer code_index_state for freshness.

Available options:
indexed,
indexing,
pending,
failed,
not_found,
unresolvable
inventory_kind
enum<string>
required

Inventory being browsed: source files or hosted documentation.

Available options:
source,
site
inventory_state
null | enum<string>
required

Whether the hosted site has active pages; null for source inventories.

Available options:
available,
empty
next_cursor
string | null
required

Opaque continuation; repeat the same request with this value as after. Site entries can change between requests.

preparation
null | object
required

Site preparation counts, active jobs, and wait results; null when not applicable.

requested_target
string
required

Target selected for this page. Keep the original request target when continuing.

resolution
null | object
required

Source snapshot resolution; null when not applicable or known.

target_resolution
null | object
required

Requested, resolved and served source provenance, including retry candidates.