# OAuth Connections
> When a user authorizes your OAuth application, an OAuth Connection object is created. Learn more about OAuth [here](https://increase.com/documentation/oauth).

## The OAuth Connection object
### Example
```json
{
  "created_at": "2020-01-31T23:59:59Z",
  "deleted_at": null,
  "group_id": "group_1g4mhziu6kvrs3vz35um",
  "id": "connection_dauknoksyr4wilz4e6my",
  "oauth_application_id": "application_gj9ufmpgh5i56k4vyriy",
  "status": "active",
  "type": "oauth_connection"
}
```
### Attributes
- `created_at` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp when the OAuth Connection was created.

- `deleted_at` (string, nullable)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp when the OAuth Connection was deleted.

- `group_id` (string)
  The identifier of the Group that has authorized your OAuth application.

- `id` (string)
  The OAuth Connection's identifier.

- `oauth_application_id` (string)
  The identifier of the OAuth application this connection is for.

- `status` (enum)
  Whether the connection is active.
  Cases:
  * `active` (The OAuth connection is active.)
  * `inactive` (The OAuth connection is permanently deactivated.)

- `type` (string)
  A constant representing the object's type. For this resource it will always be `oauth_connection`.

## List OAuth Connections
GET /oauth_connections

### Example
```curl
curl \
  --url "${INCREASE_URL}/oauth_connections" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```

### Query Parameters
- `cursor` (string, optional)
  Return the page of entries after this one.

- `limit` (integer, optional)
  Limit the size of the list that is returned. The default (and maximum) is 100 objects.

- `status.in` (array of enums, optional)
  Filter to OAuth Connections by their status. By default, return only the `active` ones. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `active` (The OAuth connection is active.)
  * `inactive` (The OAuth connection is permanently deactivated.)

- `oauth_application_id` (string, optional)
  Filter results to only include OAuth Connections for a specific OAuth Application.

### Returns a OAuth Connection List object:
```json
{
  "data": [
    {
      "created_at": "2020-01-31T23:59:59Z",
      "deleted_at": null,
      "group_id": "group_1g4mhziu6kvrs3vz35um",
      "id": "connection_dauknoksyr4wilz4e6my",
      "oauth_application_id": "application_gj9ufmpgh5i56k4vyriy",
      "status": "active",
      "type": "oauth_connection"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Retrieve an OAuth Connection
GET /oauth_connections/{oauth_connection_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/oauth_connections/connection_dauknoksyr4wilz4e6my" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `oauth_connection_id` (string, required)
  The identifier of the OAuth Connection.