# InvitesResource

Canonical page: https://docs.ovok.com/java-sdk/reference/invites-resource

```java
public final class InvitesResource
```

Creates and accepts invites. Get it from [`Ovok.invites()`](/java-sdk/reference/ovok#invites).

## Methods [#methods]

### recordShares [#recordshares]

```java
public InvitesResource.Flow recordShares()
```

Returns the record-share invite routes (`/v1/invites/record-share`).

**Returns:** the record-share invite routes

### care [#care]

```java
public InvitesResource.Flow care()
```

Returns the care invite routes (`/v1/invites/care`).

**Returns:** the care invite routes

### practitioners [#practitioners]

```java
public InvitesResource.Flow practitioners()
```

Returns the practitioner-invite routes (`/v1/invites/practitioner`).

**Deprecated:** Deprecated route; use [`recordShares()`](#recordshares) for practitioner shares.

**Returns:** the practitioner-invite routes

### patients [#patients]

```java
public InvitesResource.Flow patients()
```

Returns the patient-invite routes (`/v1/invites/patient`).

**Deprecated:** Deprecated route; use [`care()`](#care).

**Returns:** the patient-invite routes

## InvitesResource.Flow [#invitesresourceflow]

```java
public static final class Flow
```

Creates and accepts invites of one kind.

### Flow.create [#flowcreate]

```java
public JsonNode create(Object body, RequestOptions options) throws IOException, InterruptedException
```

Creates an invite (`POST /v1/invites/{kind}`).

**Parameters:**

- `body`: the invite request
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### Flow.accept [#flowaccept]

```java
public JsonNode accept(Object body, RequestOptions options) throws IOException, InterruptedException
```

Accepts an invite (`POST /v1/invites/{kind}/accept`).

**Parameters:**

- `body`: the accept request
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response
