> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CreateSenderDetails

# Package: emails

# Namespace: SenderDetailsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-details/create-sender-details.md

## Permission Scopes:
Access Verticals by Automations: SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS

## Introduction

Creates a sender.

You can only create a sender for a verified email address. The `fromName` can't contain an email address other than `fromEmailAddress`.

The first sender created on a site is automatically the default sender. Creating additional senders requires a plan that supports multiple senders.

To change the default sender, call [Mark Sender Details as Default](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-details/mark-sender-details-as-default.md).

---

## REST API

### Schema

```
 Method: createSenderDetails
 Description: Creates a sender.  You can only create a sender for a verified email address. The `fromName` can't contain an email address other than `fromEmailAddress`.  The first sender created on a site is automatically the default sender. Creating additional senders requires a plan that supports multiple senders.  To change the default sender, call [Mark Sender Details as Default](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-details/mark-sender-details-as-default.md).
 URL: https://www.wixapis.com/sender-details/v1/sender-details
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  senderDetails, senderDetails.fromName, senderDetails.fromEmailAddress
 Method parameters: 
   param name: senderDetails | type: SenderDetails | description: Sender details define the name and email address that recipients see as the sender of an email campaign. Recipients can also reply to the sender's email address. | required: true 
        - name: fromName | type: string | description: Sender name. This name appears in the email as the "from:" name.  Can't contain an email address other than `fromEmailAddress`. | required: true | validation: minLength 1, maxLength 100
        - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address.  > **Note:** An email address must be verified using the [Sender Emails API](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-emails/introduction.md#sender-email-verification-flow) before it can be used to create a sender or to change a sender's email address. | required: true | validation: minLength 6, maxLength 254, format EMAIL
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the sender details object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
 Return type: CreateSenderDetailsResponse
  - name: senderDetails | type: SenderDetails | description: Created sender details.  
     - name: id | type: string | description: Sender details GUID.  | read-only: true | validation: format GUID
     - name: createdDate | type: string | description: Date and time the sender details were created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the sender details were last updated.  | read-only: true | validation: format date-time
     - name: fromName | type: string | description: Sender name. This name appears in the email as the "from:" name.  Can't contain an email address other than `fromEmailAddress`.  | validation: minLength 1, maxLength 100
     - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address.  > **Note:** An email address must be verified using the [Sender Emails API](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-emails/introduction.md#sender-email-verification-flow) before it can be used to create a sender or to change a sender's email address.  | validation: minLength 6, maxLength 254, format EMAIL
     - name: default | type: boolean | description: Whether this is the default sender. The default sender is used to send emails when no other sender is specified.  The first sender created on a site is automatically the default. Only 1 sender at a time can be the default.  | read-only: true 
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the sender details object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_FROM_NAME | Description: `fromName` contains an email address other than the sender's `fromEmailAddress`. Remove the other email address from `fromName`.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: DUPLICATE | Description: There is already a sender with this name and email address.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SENDER_EMAIL_UNVERIFIED | Description: The sender's email address hasn't been verified. Verify it using the [Sender Emails API](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-emails/introduction.md#sender-email-verification-flow) first.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: OVER_QUOTA | Description: The site's plan doesn't support multiple senders. Upgrade the plan to create additional senders.


```

### Examples

### Create sender details
Creates a sender for a verified email address.

```curl
curl -X POST \
'https://www.wixapis.com/sender-details/v1/sender-details' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "senderDetails": {
    "fromName": "John Doe",
    "fromEmailAddress": "john.doe@example.com"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.senderDetails.senderDetails.createSenderDetails(senderDetails)
 Description: Creates a sender.  You can only create a sender for a verified email address. The `fromName` can't contain an email address other than `fromEmailAddress`.  The first sender created on a site is automatically the default sender. Creating additional senders requires a plan that supports multiple senders.  To change the default sender, call [Mark Sender Details as Default](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-details/mark-sender-details-as-default.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  senderDetails, senderDetails.fromName, senderDetails.fromEmailAddress
 Method parameters: 
   param name: senderDetails | type: SenderDetails | description: Sender details define the name and email address that recipients see as the sender of an email campaign. Recipients can also reply to the sender's email address. | required: true 
        - name: fromName | type: string | description: Sender name. This name appears in the email as the "from:" name.  Can't contain an email address other than `fromEmailAddress`. | required: true | validation: minLength 1, maxLength 100
        - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address.  > **Note:** An email address must be verified using the [Sender Emails API](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-emails/introduction.md#sender-email-verification-flow) before it can be used to create a sender or to change a sender's email address. | required: true | validation: minLength 6, maxLength 254, format EMAIL
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the sender details object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
 Return type: PROMISE<SenderDetails>
  - name: _id | type: string | description: Sender details GUID.  | read-only: true | validation: format GUID
  - name: _createdDate | type: Date | description: Date and time the sender details were created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the sender details were last updated.  | read-only: true 
  - name: fromName | type: string | description: Sender name. This name appears in the email as the "from:" name.  Can't contain an email address other than `fromEmailAddress`.  | validation: minLength 1, maxLength 100
  - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address.  > **Note:** An email address must be verified using the [Sender Emails API](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-emails/introduction.md#sender-email-verification-flow) before it can be used to create a sender or to change a sender's email address.  | validation: minLength 6, maxLength 254, format EMAIL
  - name: default | type: boolean | description: Whether this is the default sender. The default sender is used to send emails when no other sender is specified.  The first sender created on a site is automatically the default. Only 1 sender at a time can be the default.  | read-only: true 
  - name: extendedFields | type: ExtendedFields | description: Custom field data for the sender details object.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
     - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_FROM_NAME | Description: `fromName` contains an email address other than the sender's `fromEmailAddress`. Remove the other email address from `fromName`.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: DUPLICATE | Description: There is already a sender with this name and email address.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SENDER_EMAIL_UNVERIFIED | Description: The sender's email address hasn't been verified. Verify it using the [Sender Emails API](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-emails/introduction.md#sender-email-verification-flow) first.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: OVER_QUOTA | Description: The site's plan doesn't support multiple senders. Upgrade the plan to create additional senders.


```

### Examples

### Create sender details
Creates a sender for a verified email address. The first sender created becomes the default.

```javascript
import { senderDetails } from "@wix/sender-details";

async function createSenderDetails() {
  const response = await senderDetails.createSenderDetails({
    fromName: "John Doe",
    fromEmailAddress: "john.doe@example.com",
  });
}

```

### createSenderDetails (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { senderDetails } from '@wix/sender-details';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { senderDetails },
  // Include the auth strategy and host as relevant
});


async function createSenderDetails(senderDetails) {
  const response = await myWixClient.senderDetails.createSenderDetails(senderDetails);
};
```

---