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

Required nonblank compact package, repository, or explicit site:host[/scope] target. Forwarded unchanged.

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[]

Source-only raw file-type labels; at most 64, trimmed and lowercased. Empty means no filter.

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

Source-only file-purpose inclusion union; at most 64 values. Empty means 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[]

Source-only language labels; at most 64, trimmed and lowercased. Empty means no filter.

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

Logical entries per page, 1 through 500, default 100. No total count is implied.

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

Literal/glob union of at most 1000 selectors, each nonblank and at most 2048 UTF-8 bytes. Omit or use [] for root. Explicit sites remove one leading slash; root alone is allowed.

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

Source or empty-site preparation wait, 0 through 210000 milliseconds, default 0. Transport time is added; timeout does not mean preparation stopped.

Required range: 0 <= x <= 210000

Response

One source or hosted-site inventory page with exact actions and readiness evidence

One bounded inventory page with exact follow-up actions and readiness evidence.

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 site 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

Hosted coverage explanation, when available.

coverage_state
null | enum<string>
required

Hosted inventory coverage; empty entries alone do not establish completion.

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

Latest hosted-site crawl state, or null.

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

Ordered entries on this bounded page; no total count is implied.

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.

preparation
null | object
required

Hosted-site admission, active work and bounded wait evidence, or null.

requested_target
string
required

Normalized target bound to this page and continuation.

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.