---
title: "Get authorization code via redirect"
url: "https://docs.signnow.com/docs/oauth2/operations/get-oauth2-userauth"
type: "endpoint"
section: "oauth2"
slug: "oauth2/operations/get-oauth2-userauth"
method: "GET"
path: "/oauth2/userauth"
operation_id: "get-oauth2-userauth"
authorization: "bearer"
---

# Get authorization code via redirect

`GET /oauth2/userauth`

This endpoint allows API users to obtain an authorization code via an application redirect link. The code can then be used to generate an access token (bearer token) to make API requests on behalf of the user — without using their SignNow credentials. 

For more information, see [Generate access token](/docs/oauth2/operations/post__oauth2_token).

## Authorization

bearer

## Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `response_type` | string | Yes | Must be equal to `code`. |
| `redirect_uri` | string | Yes | URL to which the user is redirected after authorizing your app. The authorization code is sent to this URL. |
| `client_id` | string | Yes | Your application’s client ID, found in the [API Dashboard](https://app.signnow.com/webapp/api-dashboard/keys). |
| `access_token` | string | Yes | An application-level access token. Used to request the user authorization page, which contains a link to obtain the authorization code. |

## Responses

### 200

Returns an HTML page that contains a link with the authorization code.

**Example** (`text/html`)

```json
"<!DOCTYPE html> <html>\n<head> <meta charset=\"UTF-8\" /> <meta http-equiv=\"refresh\" content=\"0;url='https://www.example.com?code={{authorization_code}}'\" />\n<title>Redirecting to https://www.example.com?code={{authorization_code}} </title> </head>\n<body> Redirecting to <a href=\"https://www.example.com?code={{authorization_code}}\">https://www.example.com?code={{authorization_code}}</a>. </body>\n</html>"
```

### 400

* Incorrect `client_id`.
* `access_token` is missing.
* `client_id` is missing.
* `response_type` is missing.
* `redirect_url` is missing.

**Example** (`Example 1`)

```json
{
  "code": 65536,
  "error": "internal api error"
}
```

**Example** (`Missing parameter`)

```json
{
  "code": 1537,
  "error": "invalid_request"
}
```

**Example** (`Incorrect client_id`)

```json
{
  "code": 65536,
  "error": "internal api error"
}
```

## Code Examples

> Replace `$SIGNNOW_ACCESS_TOKEN` and any `{placeholder}` values before running.

### cURL

```bash
curl -X GET \
  "https://api.signnow.com/oauth2/userauth" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN"
```

---
*Full reference: https://docs.signnow.com/docs/oauth2/operations/get-oauth2-userauth*
