# `Ory.Api.Relationship`

API calls for all endpoints tagged `Relationship`.

# `check_opl_syntax`

```elixir
@spec check_opl_syntax(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.ErrorGeneric.t()}
  | {:ok, Ory.Model.CheckOplSyntaxResult.t()}
  | {:error, Tesla.Env.t()}
```

Check the syntax of an OPL file
The OPL file is expected in the body of the request.

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:body` (String.t): 

### Returns

- `{:ok, Ory.Model.CheckOplSyntaxResult.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `create_relationship`

```elixir
@spec create_relationship(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.ErrorGeneric.t()}
  | {:ok, Ory.Model.Relationship.t()}
  | {:error, Tesla.Env.t()}
```

Create a Relationship
Use this endpoint to create a relationship.

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:body` (CreateRelationshipBody): 

### Returns

- `{:ok, Ory.Model.Relationship.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `delete_relationships`

```elixir
@spec delete_relationships(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:ok, Ory.Model.ErrorGeneric.t()} | {:error, Tesla.Env.t()}
```

Delete Relationships
Use this endpoint to delete relationships

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:namespace` (String.t): Namespace of the Relationship
  - `:object` (String.t): Object of the Relationship
  - `:relation` (String.t): Relation of the Relationship
  - `:subject_id` (String.t): SubjectID of the Relationship
  - `:"subject_set.namespace"` (String.t): Namespace of the Subject Set
  - `:"subject_set.object"` (String.t): Object of the Subject Set
  - `:"subject_set.relation"` (String.t): Relation of the Subject Set

### Returns

- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure

# `get_relationships`

```elixir
@spec get_relationships(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.ErrorGeneric.t()}
  | {:ok, Ory.Model.Relationships.t()}
  | {:error, Tesla.Env.t()}
```

Query relationships
Get all relationships that match the query. Only the namespace field is required.

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:page_size` (integer()): Items per Page  This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.com/docs/ecosystem/api-design#pagination).
  - `:page_token` (String.t): Next Page Token  The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.com/docs/ecosystem/api-design#pagination).
  - `:namespace` (String.t): Namespace of the Relationship
  - `:object` (String.t): Object of the Relationship
  - `:relation` (String.t): Relation of the Relationship
  - `:subject_id` (String.t): SubjectID of the Relationship
  - `:"subject_set.namespace"` (String.t): Namespace of the Subject Set
  - `:"subject_set.object"` (String.t): Object of the Subject Set
  - `:"subject_set.relation"` (String.t): Relation of the Subject Set

### Returns

- `{:ok, Ory.Model.Relationships.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `list_relationship_namespaces`

```elixir
@spec list_relationship_namespaces(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.ErrorGeneric.t()}
  | {:ok, Ory.Model.RelationshipNamespaces.t()}
  | {:error, Tesla.Env.t()}
```

Query namespaces
Get all namespaces

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters

### Returns

- `{:ok, Ory.Model.RelationshipNamespaces.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `patch_relationships`

```elixir
@spec patch_relationships(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:ok, Ory.Model.ErrorGeneric.t()} | {:error, Tesla.Env.t()}
```

Patch Multiple Relationships
Use this endpoint to patch one or more relationships.

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:body` ([Ory.Model.RelationshipPatch.t]): 

### Returns

- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure

---

*Consult [api-reference.md](api-reference.md) for complete listing*
