# Sender identities

BoldSign allows you to perform various operations on behalf of another user. For example, you can send a document to the signer on behalf of another user. The operations like sending documents, download audit log, revoke, remind, change access code, etc., can be performed on behalf of.

To perform on behalf of operations, the sender identity should be added and approved. Add the user as a sender identity, and then the user will get an email for approval. Once the user approves the request, you can perform operations on behalf of that user.

This section demonstrates how to create a sender identity, update the identity, delete an identity, list all the identities, request for approval, resend the invitation, and fetch an identity details.


## Create identity

{% post /%}
{% path text="/v1/senderIdentities/create " /%}

Creates a new sender identity by taking the name and email address. Multiple sender identities can be created.

## Code snippet

{% codetab %}

cURL

```shell
curl -X 'POST' \
  'https://api.boldsign.com/v1/senderIdentities/create' \
  -H 'accept: */*' \
  -H 'X-API-KEY: {your API key}' \
  -H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
  -d '{
  "Name": "Luther Cooper",
  "Email": "luthercooper@cubeflakes.com",
  "RedirectUrl": "https://boldsign.com",
  "BrandId": "c94d34e9-8f1f-4ab1-926d-daa32095a851",
  "NotificationSettings": {
    "Viewed": true,
    "Sent": false,
    "DeliveryFailedFor": true,
    "Declined": true,
    "Revoked": true,
    "Reassigned": true,
    "Completed": true,
    "Signed": true,
    "Expired": true,
    "AuthenticationFailed": true,
    "Reminders": true,
    "AttachSignedDocument": false
  },
  "MetaData": {
    "TenantId": "xxxxx070-xxxx-xxxx-xxxx-757xxxxxxxxx",
    "AccountPlan": "Free"
  },
  "Locale": "EN"
}'
```

C#

```csharp
var apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");

var senderIdentityClient = new SenderIdentityClient(apiClient);

var senderIdentityRequest = new SenderIdentityRequest("Luther Cooper", "luthercooper@cubeflakes.com", null);
senderIdentityRequest.MetaData = new Dictionary<string, string>()
{
  ["tenantId"] = "xxxxx070-xxxx-xxxx-xxxx-757xxxxxxxxx",
  ["accountPlan"] = "Free"
};

var senderIdentityCreated = senderIdentityClient.CreateSenderIdentity(senderIdentityRequest);
```

Python

```python
import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:
    
    sender_identities_api = boldsign.SenderIdentitiesApi(api_client)
	
    sender_identity_request = boldsign.CreateSenderIdentityRequest(
        name="Luther Cooper",
        email="luthercooper@cubeflakes.com",
    )
    
    sender_identities_api.create_sender_identities(sender_identity_request)
```

PHP

```php
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\SenderIdentitiesApi;
use BoldSign\Model\CreateSenderIdentityRequest;

$config = new Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');

$sender_identities_api = new SenderIdentitiesApi($config);

$sender_identity_request = new CreateSenderIdentityRequest();
$sender_identity_request->setName('Luther Cooper');
$sender_identity_request->setEmail('luthercooper@cubeflakes.com');

$sender_identities_api->createSenderIdentities($sender_identity_request);
```

Java

```java
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
            
SenderIdentitiesApi senderIdentitiesApi = new SenderIdentitiesApi(client);

CreateSenderIdentityRequest senderIdentityRequest = new CreateSenderIdentityRequest();
senderIdentityRequest.setName("Luther Cooper");
senderIdentityRequest.setEmail("luthercooper@cubeflakes.com");

senderIdentitiesApi.createSenderIdentities(senderIdentityRequest);
```

NodeJS

```js
import { SenderIdentitiesApi, CreateSenderIdentityRequest } from "boldsign";


const senderIdentitiesApi = new SenderIdentitiesApi("https://api.boldsign.com");
senderIdentitiesApi.setApiKey("YOUR_API_KEY");

const senderIdentityRequest = new CreateSenderIdentityRequest();
senderIdentityRequest.name = "Luther Cooper";
senderIdentityRequest.email = "luthercooper@cubeflakes.com";

senderIdentitiesApi.createSenderIdentities(senderIdentityRequest);
```

{% /codetab %}

## Request body

{% nestedtable %}

- {% arguments name="Name" /%}{% batch datatype="string" /%}{% required /%}
- Name of the sender identity.

---

- {% arguments name="Email" /%}{% batch datatype="string" /%}{% required /%}
- Email address of the sender identity.

---

- {% arguments name="RedirectUrl" /%}{% batch datatype="string" /%}
-  You can set this property to redirect to a specific URL once the user has either approved or rejected.

---

- {% arguments name="BrandId" /%}{% batch datatype="string" /%}
- You can customize the logo, colors, and other elements of the emails to match your company branding, and the brand logo will appear on the approval page. The ID of the existing brand can be obtained from the branding API or the web app.

---

- {% arguments name="NotificationSettings" /%}{% batch datatype="object" /%}
- Notification Settings of the sender identity.

  {% nestedtable %}

    - {% arguments name="Viewed" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is viewed.

    ---

    - {% arguments name="Sent" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is sent.

    ---

    - {% arguments name="DeliveryFailedFor" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the delivery is failed.

    ---

    - {% arguments name="Declined" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is declined.

    ---

    - {% arguments name="Revoked" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is revoked.

    ---

    - {% arguments name="Reassigned" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is reassigned.

    ---

    - {% arguments name="Completed" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is completed.

    ---

    - {% arguments name="Signed" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is signed.

    ---

    - {% arguments name="Expired" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the document is expired.

    ---

    - {% arguments name="AuthenticationFailed" /%}{% batch datatype="boolean" /%}
    - When it is enabled, an email will be automatically sent to the sender identity email address if the authentication is failed for the document.

    ---

    - {% arguments name="Reminders" /%}{% batch datatype="boolean" /%}
    - When it is enabled, all reminder email will be automatically sent to the sender identity email address.

    ---

    - {% arguments name="AttachSignedDocument" /%}{% batch datatype="boolean" /%}
    - When it is enabled, the email sent to the sender's identity address upon document completion will include the completed document, an audit trail, and a view document link. Note that it is applicable only if the `completed` option is enabled.

    {% /nestedtable %}

---

- {% arguments name="MetaData" /%}{% batch datatype="dictionary" /%}
- Additional information about the sender identity can be provided as key-value pairs. A maximum of 50 key-value pairs may be included. Each key can have a maximum length of 40 characters, while each value can contain up to 500 characters. 

---
- {% arguments name="Locale" /%}{% batch datatype="string" /%}
- Configure the preferred language for your sender identity. This setting ensures that all associated emails and sender identity related pages are displayed in the specified language.

{% /nestedtable %}

## Language support
Sender identity emails and pages can be customized in the following languages
- EN (English)
- FR (French)
- NO (Norwegian)
- DE (German)
- ES (Spanish)
- BG (Bulgarian)
- CS (Czech)
- DA (Danish)
- IT (Italian)
- NL (Dutch)
- PL (Polish)
- PT (Portuguese)
- RO (Romanian)
- RU (Russian)
- SV (Swedish)
- JA (Japanese)
- TH (Thai)
- ZH_CN (Simplified Chinese)
- Zh_TW (Traditional Chinese)
- KO (Korean)

## Example response

***201 Created***

```json
{
    "senderIdentityId": "2e96f9ad-xxxx-xxxx-xxxx-3063e73f04f8"
}
```

## Error response

{% nestedtable %}

- {% arguments name="Error Type" /%}
- {% arguments name="Description" /%}

---

- `AlreadyExistsInAnotherOrganization`
- The specified sender identity email address is already associated with another organization.

---

- `AlreadyExists`
- The specified sender identity email address is already associated with your account.

---

- `LimitReached`
- The sender identity creation limit has been exceeded for your account.

---

- `BouncedEmail`
- The specified sender identity email address has permanently bounced.

---

- `InvalidBrandId`
- The Brand ID provided is invalid. Check that your request are specifying a valid brand ID.

---

- `SelfCreation`
- Cannot create sender identity for yourself.

---

- `NoApiAccess`
- You do not have permission to access this API endpoint.

{% /nestedtable %}

**Best Practice: Use a System Identity for Delegated Actions**

When managing sender identities or sending documents on behalf of others, use a dedicated system identity instead of exposing a user level account. Choosing a neutral address such as `admin@companyname.com` keeps notifications consistent, protects individual privacy, and simplifies credential rotation and audit logging.
