Sourcegraph
Code search and intelligence across all repositories
Managed auth
Authentication
Methods your end users can connect with. Credentials are stored encrypted, and secret values are never shown again or returned by the API.
API key
Your users enter
- Your Sourcegraph URLOptionalHTTPS URL
- Access tokenSecretRequired
Where to find them
- In Sourcegraph open your profile → “Settings” → “Access tokens” and click “Generate new token”.
- Copy the token (it starts with sgp_): it is shown only once.
Tools (2)
Sourcegraph API request
SOURCEGRAPH_SEND_REQUESTAuthenticated call to the Sourcegraph API ({url}/.api). Any endpoint of the API is allowed. Examples: POST /graphql {"query": "{ search(query: \"repo:… lang:go func main\", version: V3) { results { matchCount } } }"} (better with SOURCEGRAPH_SEND_GRAPHQL_REQUEST), GET /search/stream?q=… (streaming results), POST /graphql with repositories(first: 20).
Required scopes
No scopes required
Input
Sourcegraph API request input Name Type Description methodstringHTTP methodOne of: GET,POST,PUT,PATCH,DELETEDefault:"GET"pathrequiredstringPath relative to the API base URL, or a full URL on the same API (e.g. a next-page link) queryobjectQuery string parameters bodyunknownJSON body formobjectBody as application/x-www-form-urlencoded instead of JSON body_base64stringBinary body, base64 (at most 960000 characters) content_typestringContent-Type of body_base64 headersobjectExtra headers such as Accept. Authentication is added automatically. Sourcegraph GraphQL request
SOURCEGRAPH_SEND_GRAPHQL_REQUESTRuns a GraphQL query or mutation against the Sourcegraph API and returns its data and errors.
Required scopes
No scopes required
Input
Sourcegraph GraphQL request input Name Type Description queryrequiredstringGraphQL query or mutation variablesobjectGraphQL variables

