# API Documentation

The API endpoints listed here are for reference purposes only. sgID users are strongly recommended to use the SDK(s) provided which sends these requests for you.

If there are no SDKs provided for your programming language, please refer to [Custom Integration](/integrations-with-sgid/custom-integration.md) on how to set up your own integration.

## Endpoints

{% hint style="danger" %}
**Do not reuse the example code challenge and code verifier provided in the API examples**, as this would expose your API requests to PKCE guessing attacks by malicious users. Refer to the example code under the [SDKs section](/integrations-with-sgid/typescript-javascript.md) on how to generate valid `<code_verifier, code_challenge>` pairs.
{% endhint %}

{% openapi src="/files/TiLKj6vwQvKur3SMjuU9" path="/v2/oauth/authorize" method="get" %}
[openapi.yaml](https://2214909052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBW92htBuXTrDYoKovQ2%2Fuploads%2Fm4QxYNN4G7ohsReTJGlB%2Fopenapi.yaml?alt=media\&token=180d598a-142c-42f2-b72b-20c55cc0bcae)
{% endopenapi %}

{% openapi src="/files/TiLKj6vwQvKur3SMjuU9" path="/v2/oauth/token" method="post" %}
[openapi.yaml](https://2214909052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBW92htBuXTrDYoKovQ2%2Fuploads%2Fm4QxYNN4G7ohsReTJGlB%2Fopenapi.yaml?alt=media\&token=180d598a-142c-42f2-b72b-20c55cc0bcae)
{% endopenapi %}

{% openapi src="/files/TiLKj6vwQvKur3SMjuU9" path="/v2/oauth/userinfo" method="get" %}
[openapi.yaml](https://2214909052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBW92htBuXTrDYoKovQ2%2Fuploads%2Fm4QxYNN4G7ohsReTJGlB%2Fopenapi.yaml?alt=media\&token=180d598a-142c-42f2-b72b-20c55cc0bcae)
{% endopenapi %}

{% openapi src="/files/TiLKj6vwQvKur3SMjuU9" path="/v2/.well-known/jwks.json" method="get" %}
[openapi.yaml](https://2214909052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBW92htBuXTrDYoKovQ2%2Fuploads%2Fm4QxYNN4G7ohsReTJGlB%2Fopenapi.yaml?alt=media\&token=180d598a-142c-42f2-b72b-20c55cc0bcae)
{% endopenapi %}

{% openapi src="/files/TiLKj6vwQvKur3SMjuU9" path="/v2/.well-known/openid-configuration" method="get" %}
[openapi.yaml](https://2214909052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBW92htBuXTrDYoKovQ2%2Fuploads%2Fm4QxYNN4G7ohsReTJGlB%2Fopenapi.yaml?alt=media\&token=180d598a-142c-42f2-b72b-20c55cc0bcae)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.id.gov.sg/integrations-with-sgid/api-documentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
