# `DocuSign.Api.Authorizations`
[🔗](https://github.com/neilberkman/docusign_elixir/blob/v3.4.0/lib/docusign/api/authorizations.ex#L5)

API calls for all endpoints tagged `Authorizations`.

# `user_agent_authorizations_get_agent_user_authorizations`

```elixir
@spec user_agent_authorizations_get_agent_user_authorizations(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, DocuSign.Model.UserAuthorizations.t()} | {:error, Req.Response.t()}
```

Returns the authorizations for which the specified user is the agent user.
Returns the user authorizations for which the user specified by `userId` is the agent user.  If the calling user is an account administrator, the full results will be returned. Otherwise, only authorizations for which the calling user is the principal user will be returned.

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `user_id` (String.t): The user who is acting as the agent.
- `opts` (keyword): Optional parameters
  - `:active_only` (String.t): When **true,** only active users are returned. The default value is **false.**
  - `:count` (String.t): The maximum number of results to return.
  - `:email_substring` (String.t): Filters returned user records by full email address or a substring of email address.
  - `:include_closed_users` (String.t): When **true,** returns active and scheduled authorizations of closed users. The default value is **true.** This value is only applied when `active_only` is **false.**
  - `:permissions` (String.t): 
  - `:start_position` (String.t): The position within the total result set from which to start returning values. The value **thumbnail** may be used to return the page image.
  - `:user_name_substring` (String.t): Filters results based on a full or partial user name.  **Note:** When you enter a partial user name, you do not use a wildcard character.

### Returns

- `{:ok, DocuSign.Model.UserAuthorizations.t}` on success
- `{:error, Req.Response.t}` on failure

# `user_authorization_create_user_authorization`

```elixir
@spec user_authorization_create_user_authorization(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, DocuSign.Model.UserAuthorization.t()} | {:error, Req.Response.t()}
```

Creates a user authorization.
Creates an authorization allowing one user to send and/or manage envelopes on behalf of another user.  The _agent_ user acts on behalf of the _principal_ user. The principal user is specified by the `userId` path parameter. The agent user is specified in the request body. Each principal user can only share signing permission with one agent user.  Specify in the request the level of access to share with the agent user. If you share signing access, the agent user will receive an email notification.  To call this endpoint: * You must be an account administrator or you must be the principal user. * The agent user and principal user must belong to the same account. * At least one of the following account settings must be enabled: `AllowDelegatedSigning`, `AllowManagingEnvelopesOnBehalfOfOthers`, `AllowEditingEnvelopesOnBehalfOfOthers`, `AllowSendingEnvelopesOnBehalfOfOthers`. These settings correspond to the level of access you can set for the authorization.

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `user_id` (String.t): The ID of the principal user.
- `opts` (keyword): Optional parameters
  - `:body` (UserAuthorizationCreateRequest): 

### Returns

- `{:ok, DocuSign.Model.UserAuthorization.t}` on success
- `{:error, Req.Response.t}` on failure

# `user_authorization_delete_user_authorization`

```elixir
@spec user_authorization_delete_user_authorization(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, nil} | {:error, Req.Response.t()}
```

Deletes the user authorization. 
Deletes the user authorization specified by the `authorizationId`.  To call this endpoint, you must be an account administrator or you must be the principal user for the specified authorization.

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `authorization_id` (String.t): The ID of the user authorization.
- `user_id` (String.t): The ID of the principal user.
- `opts` (keyword): Optional parameters

### Returns

- `{:ok, nil}` on success
- `{:error, Req.Response.t}` on failure

# `user_authorization_get_user_authorization`

```elixir
@spec user_authorization_get_user_authorization(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, DocuSign.Model.UserAuthorization.t()} | {:error, Req.Response.t()}
```

Returns the user authorization for a given authorization ID. 
Returns the details for the user authorization specified by the `authorizationId`.  To call this endpoint, you must be an account administrator or you must be the principal user for the specified authorization.

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `authorization_id` (String.t): The ID of the user authorization.
- `user_id` (String.t): The ID of the principal user.
- `opts` (keyword): Optional parameters

### Returns

- `{:ok, DocuSign.Model.UserAuthorization.t}` on success
- `{:error, Req.Response.t}` on failure

# `user_authorization_update_user_authorization`

```elixir
@spec user_authorization_update_user_authorization(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, DocuSign.Model.UserAuthorization.t()} | {:error, Req.Response.t()}
```

Updates the start or end date for a user authorization.
Updates the start and/or end date for a given user authorization. Specify the user authorization and principal user with the path parameters.  To call this endpoint, you must be an account administrator or you must be the principal user for the specified authorization.

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `authorization_id` (String.t): The ID of the user authorization.
- `user_id` (String.t): The ID of the principal user.
- `opts` (keyword): Optional parameters
  - `:body` (UserAuthorizationUpdateRequest): 

### Returns

- `{:ok, DocuSign.Model.UserAuthorization.t}` on success
- `{:error, Req.Response.t}` on failure

# `user_authorizations_delete_user_authorizations`

```elixir
@spec user_authorizations_delete_user_authorizations(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, DocuSign.Model.UserAuthorizationsDeleteResponse.t()}
  | {:error, Req.Response.t()}
```

Delete multiple user authorizations.
Delete one or more user authorizations for a given principal user. The principal user is specified by the `userId` path parameter.  To call this endpoint, you must be an account administrator or you must be the principal user for the specified authorizations.

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `user_id` (String.t): The ID of the principal user.
- `opts` (keyword): Optional parameters
  - `:body` (UserAuthorizationsDeleteRequest): 

### Returns

- `{:ok, DocuSign.Model.UserAuthorizationsDeleteResponse.t}` on success
- `{:error, Req.Response.t}` on failure

# `user_authorizations_get_principal_user_authorizations`

```elixir
@spec user_authorizations_get_principal_user_authorizations(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, DocuSign.Model.UserAuthorizations.t()} | {:error, Req.Response.t()}
```

Returns the authorizations for which the specified user is the principal user.
Returns the user authorizations for which the user specified by `userId` is the principal user.  To call this endpoint, you must be an account administrator or you must be the specified principal user.

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `user_id` (String.t): The ID of the principal user.
- `opts` (keyword): Optional parameters
  - `:active_only` (String.t): When **true,** return only active authorizations. The default value is **true.**
  - `:count` (String.t): The maximum number of results to return.
  - `:email_substring` (String.t): Filters returned user records by full email address or a substring of email address.
  - `:include_closed_users` (String.t): When **true,** returns active and scheduled authorizations of closed users. The default value is **true.** This value is only applied when `active_only` is **false.**
  - `:permissions` (String.t): Filters results by authorization permission. Valid values: * `Send` * `Manage` * `Sign`
  - `:start_position` (String.t): The position within the total result set from which to start returning values. The value **thumbnail** may be used to return the page image.
  - `:user_name_substring` (String.t): Filters results based on a full or partial user name.  **Note:** When you enter a partial user name, you do not use a wildcard character.

### Returns

- `{:ok, DocuSign.Model.UserAuthorizations.t}` on success
- `{:error, Req.Response.t}` on failure

# `user_authorizations_post_user_authorizations`

```elixir
@spec user_authorizations_post_user_authorizations(
  DocuSign.Connection.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, DocuSign.Model.UserAuthorizationsResponse.t()}
  | {:error, Req.Response.t()}
```

Create or update multiple user authorizations.
Create or update multiple user authorizations in a single request. The body of the request is a list of userAuthorizationSomething objects. To create a new authorization, specify the `agentUser` and `permission` fields, with the optional `startDate` and `endDate` fields. To update an existing authorization, specify the `authorizationId` field and the `startDate` and/or `endDate` fields.  For example, to create a new authorization and update the end date of an existing authorization, your request body might look like this:  ``` {   "authorizations": [     {       "agentUser": {         "userId": "1470ff66-xxxx-xxxx-xxxx-8c46f140da37",         "accountId": "230546a7-xxxx-xxxx-xxxx-af205d5494ad"       },       "permission": "manage"     },     {       "authorizationId": "b73ac983-xxxx-xxxx-xxxx-b3c0ea5b09d3",       "endDate": "2023-05-09T21:36:27.0000000+00:00"     }   ] } ```  The principal user is specified by the `userId` path parameter. To call this endpoint, you must be an account administrator or the principal user.  **Note:** To create an authorization with signing permission, the `AllowDelegationSigning` setting must be enabled on the account. If you share signing access, the agent user will receive an email notification. Each principal user can only share signing permission with one agent user. 

### Parameters

- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `user_id` (String.t): The ID of the principal user.
- `opts` (keyword): Optional parameters
  - `:body` (UserAuthorizationsRequest): 

### Returns

- `{:ok, DocuSign.Model.UserAuthorizationsResponse.t}` on success
- `{:error, Req.Response.t}` on failure

---

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