> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.withpersona.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.withpersona.com/_mcp/server.

# Create Authorization

POST https://api.withpersona.com/api/v1/oauth/authorize
Content-Type: application/x-www-form-urlencoded

Authorizes another Organization to access your Inquiry, Verifications, or other Persona resources.

Reference: https://docs.withpersona.com/api-reference/oauth/create-authorization

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `Key-Inflection` (enum, optional) — Determines casing for the API response.
  - Allowed values: `camel`, `kebab`, `snake`
- `Idempotency-Key` (string, optional) — Ensures the request is idempotent.
- `Persona-Version` (enum, optional) — Server API version. More info on versioning can be found [here](https://docs.withpersona.com/versioning).
  - Allowed values: `2025-12-08`, `2025-10-27`, `2023-01-05`, `2022-09-01`, `2021-08-18`, `2021-07-05`, `2021-02-21`, `2020-05-18`

### Body (application/x-www-form-urlencoded)

This endpoint expects an object.

- `client-id` (string, required) — Organization (`org_`) to authorize
- `response-type` (string, required, default: code) — Must be set to 'code'
- `scope` (string, required) — Space-separated list of 'permission:object' combinations (i.e. `inquiry.read:inq_uX7kRTiBxsJ1sZqPLAsjdP9j verification.read:ver_ynYuWdrjwwjiHJ2rgHfSoHeT`

## Response

### 201

This endpoint returns an Authorization Code.

- `code` (string, required) — Authorization Code that is only usable by the Organization specified by the client-id
- `expires-in` (integer, required, default: 0) — Number of seconds until the authorization code expires.

## Errors

### 400 Bad Request Error

The request was unacceptable, often due to invalid parameters.

- `errors` (list of OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 401 Unauthorized Error

An invalid API key was provided.

- `errors` (list of OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 403 Forbidden Error

The given API key doesn’t have permissions to perform the request or a quota has been exceeded.

- `errors` (list of OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 404 Not Found Error

The requested resource doesn’t exist.

- `errors` (list of OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 409 Conflict Error

The request conflicts with another request, often due to attempting to create a duplicate resource.

- `errors` (list of OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 422 Unprocessable Entity Error

The request modifies the resource in an unacceptable way, often due to an invalid action or parameter.

- `errors` (list of OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems, optional)

### 429 Too Many Requests Error

Your organization’s rate limit has been exceeded. We recommend an exponential backoff on requests.

- `errors` (list of OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems, optional)

## Types

### OauthAuthorizePostResponsesContentApplicationJsonSchemaErrorsItems

- `title` (string, optional)
- `details` (string, optional)

## Examples

**Request**

```json
{
  "client-id": "string",
  "response-type": "code",
  "scope": "string"
}
```

**Response**

```json
{
  "code": "8qaA6Q9GQnPjqiWB8BPed9MC6twE",
  "expires-in": 599
}
```

**SDK Code**

```python Created
import requests

url = "https://api.withpersona.com/api/v1/oauth/authorize"

payload = ""
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/x-www-form-urlencoded"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Created
const url = 'https://api.withpersona.com/api/v1/oauth/authorize';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Created
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.withpersona.com/api/v1/oauth/authorize"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Created
require 'uri'
require 'net/http'

url = URI("https://api.withpersona.com/api/v1/oauth/authorize")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.withpersona.com/api/v1/oauth/authorize")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.withpersona.com/api/v1/oauth/authorize', [
  'form_params' => null,
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

echo $response->getBody();
```

```csharp Created
using RestSharp;

var client = new RestClient("https://api.withpersona.com/api/v1/oauth/authorize");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift Created
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/x-www-form-urlencoded"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.withpersona.com/api/v1/oauth/authorize")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```