# Create api key connection.

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

POST

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

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/virtual-users/example/connections/example';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"api_key":"example-api-key"}'
};


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 \
  --header 'Content-Type: application/json' \
  --data '{ "api_key": "example-api-key" }'
```

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

## Parameters

### Path Parameters

**identity\_id**

required

string

**provider**

required

string

## Request Bodyrequired

Media typeapplication/json

Request body for API-key connection creation (plugin-based providers). Accepts api\_key plus any additional form fields as extra\_fields.

object

**api\_key**

required

Provider API key, encrypted before storage.

string

##### Example

```plaintext
example-api-key
```

***key***

additional properties

Additional provider-specific form fields (e.g. org\_slug for Deno personal tokens).

## Responses

### 201

Success

Media typeapplication/json

Connection info returned in API responses (never includes token)

object

**connected\_at**

required

Time the grant was created.

string format: date-time

**connection\_type**

required

Credential mechanism used by this connection.

string

**provider**

required

Stable provider identifier.

string

**provider\_username**

Display name on the provider.

string | null

**scopes**

Provider scopes granted to this account.

string | null

##### Example

```json
{
  "connected_at": "2026-09-29T12:00:00Z",
  "connection_type": "oauth",
  "provider": "github",
  "provider_username": "octocat",
  "scopes": "read:user"
}
```

### 401

Authentication required

### 403

Permission denied

### 404

Virtual user not found