# IntraFi Account Enrollments
> IntraFi is a [network of financial institutions](https://www.intrafi.com/network-banks) that allows Increase users to sweep funds to multiple banks. This enables accounts to become eligible for additional Federal Deposit Insurance Corporation (FDIC) insurance. An IntraFi Account Enrollment object represents the status of an account in the network. Sweeping an account to IntraFi doesn't affect funds availability.

[Events](https://increase.com/documentation/events.md) will be generated for this resource. The possible event categories are: `intrafi_account_enrollment.created` and `intrafi_account_enrollment.updated`.

## The IntraFi Account Enrollment object
### Example
```json
{
  "account_id": "account_in71c4amph0vgo2qllky",
  "created_at": "2020-01-31T23:59:59Z",
  "email_address": null,
  "id": "intrafi_account_enrollment_w8l97znzreopkwf2tg75",
  "idempotency_key": null,
  "intrafi_id": "01234abcd",
  "status": "pending_enrolling",
  "type": "intrafi_account_enrollment"
}
```
### Attributes
- `account_id` (string)
  The identifier of the Increase Account being swept into the network.

- `created_at` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the enrollment was created.

- `email_address` (string, nullable)
  The contact email for the account owner, to be shared with IntraFi.

- `id` (string)
  The identifier of this enrollment at IntraFi.

- `idempotency_key` (string, nullable)
  The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

- `intrafi_id` (string)
  The identifier of the account in IntraFi's system. This identifier will be printed on any IntraFi statements or documents.

- `status` (enum)
  The status of the account in the network. An account takes about one business day to go from `pending_enrolling` to `enrolled`.
  Cases:
  * `pending_enrolling` (The account is being added to the IntraFi network.)
  * `enrolled` (The account has been enrolled with IntraFi.)
  * `pending_unenrolling` (The account is being unenrolled from IntraFi's deposit sweep.)
  * `unenrolled` (The account was once enrolled, but is no longer enrolled at IntraFi.)
  * `requires_attention` (Something unexpected happened with this account. Contact Increase support.)

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

## List IntraFi Account Enrollments
GET /intrafi_account_enrollments

### Example
```curl
curl \
  --url "${INCREASE_URL}/intrafi_account_enrollments?account_id=account_in71c4amph0vgo2qllky" \
  -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.

- `account_id` (string, optional)
  Filter IntraFi Account Enrollments to the one belonging to an account.

- `status.in` (array of enums, optional)
  Filter IntraFi Account Enrollments for those with the specified status or statuses. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `pending_enrolling` (The account is being added to the IntraFi network.)
  * `enrolled` (The account has been enrolled with IntraFi.)
  * `pending_unenrolling` (The account is being unenrolled from IntraFi's deposit sweep.)
  * `unenrolled` (The account was once enrolled, but is no longer enrolled at IntraFi.)
  * `requires_attention` (Something unexpected happened with this account. Contact Increase support.)

- `idempotency_key` (string, optional)
  Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

### Returns a IntraFi Account Enrollment List object:
```json
{
  "data": [
    {
      "account_id": "account_in71c4amph0vgo2qllky",
      "created_at": "2020-01-31T23:59:59Z",
      "email_address": null,
      "id": "intrafi_account_enrollment_w8l97znzreopkwf2tg75",
      "idempotency_key": null,
      "intrafi_id": "01234abcd",
      "status": "pending_enrolling",
      "type": "intrafi_account_enrollment"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Enroll an account in the IntraFi deposit sweep network
POST /intrafi_account_enrollments

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/intrafi_account_enrollments" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "account_id": "account_in71c4amph0vgo2qllky",
    "email_address": "user@example.com"
  }'
```

### Body Parameters
- `account_id` (string, required)
  The identifier for the account to be added to IntraFi.

- `email_address` (string, required)
  The contact email for the account owner, to be shared with IntraFi.

## Get an IntraFi Account Enrollment
GET /intrafi_account_enrollments/{intrafi_account_enrollment_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/intrafi_account_enrollments/intrafi_account_enrollment_w8l97znzreopkwf2tg75" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `intrafi_account_enrollment_id` (string, required)
  The identifier of the IntraFi Account Enrollment to retrieve.

## Unenroll an account from IntraFi
POST /intrafi_account_enrollments/{intrafi_account_enrollment_id}/unenroll

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/intrafi_account_enrollments/intrafi_account_enrollment_w8l97znzreopkwf2tg75/unenroll" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `intrafi_account_enrollment_id` (string, required)
  The Identifier of the IntraFi Account Enrollment to remove from IntraFi.