POST
/
query

Submit a natural language query about the codebase, get a natural language answer with a list of relevant code references (filepaths, line numbers, etc)

  1. “How does auth work in this codebase?"
  2. "Generate a description for the JIRA ticket with codebase context"
  3. "Rewrite this code snippet using relevant abstractions already in the repo”

Note: Before Greptile can query a repo, it must be indexed. See Index Repository for more information.

Authorizations

Authorization
string
headerrequired

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

X-GitHub-Token
string
headerrequired

Body

application/json
messages
object[]

List of chat messages until now. For a single query, include only one entry in the list with a natural language query.

repositories
object[]

List of repos that Greptile should reference while answering your question.

sessionId
string

Optional, defaults to a new session. Only use this if you intend to need to retrieve chat history later.

stream
boolean

Optional, default false.

genius
boolean

Optional, default false. Genius requests are smarter but 8-10 seconds slower, great for complex usecases like reviewing PR and updating technical docs.

Response

200 - application/json
message
string
sources
object[]