# Create a target-bound provider setup URL.

Source: <https://everruns.com/docs/api/operations/start_target_connection/>

POST

/v1/virtual-users/{identity\_id}/connections/{provider}/authorize

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/virtual-users/example/connections/example/authorize';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"agent_id":"example","mode":"virtual_user","popup":false,"return_to":"/settings/connections","session_id":"example"}'
};


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

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/virtual-users/example/connections/example/authorize \
  --header 'Content-Type: application/json' \
  --data '{ "agent_id": "example", "mode": "virtual_user", "popup": false, "return_to": "/settings/connections", "session_id": "example" }'
```

* Production APIapp.everruns.com/api/v1/virtual-users/{identity\_id}/connections/{provider}/authorize

## Parameters

### Path Parameters

**identity\_id**

required

string

**provider**

required

string

## Request Bodyrequired

Media typeapplication/json

Browser setup options. The canonical target is selected by the authorized resource path.

object

**agent\_id**

Required when `mode = identity`: the agent whose service grant this is. The grant is owned by the agent’s identity, not by the admin who authorizes it (EVE-1030). Optional legacy service agent target.

string | null

**mode**

Legacy setup mode; canonical resource paths capture the target.

string | null

##### Example

```plaintext
virtual_user
```

**popup**

Whether setup completes in a popup.

boolean | null

##### Example

```json
false
```

**return\_to**

Same-origin return path after setup.

string | null

##### Example

```plaintext
/settings/connections
```

**session\_id**

Optional session grant destination for legacy setup.

string | null

## Responses

### 200

Browser setup created

Media typeapplication/json

Browser URL returned to a bearer-authenticated consumer before navigation.

object

**authorization\_url**

required

Navigate the browser to this provider authorization URL.

string

##### Example

```json
{
  "authorization_url": "https://provider.example/authorize?state=opaque"
}
```

### 403

Setup not authorized