> 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`). > - 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. > **Note:** You can only create a sender for a *verified* email address. --- ## REST API ### Schema ``` Method: createSenderDetails Description: Creates a sender. > **Note:** You can only create a sender for a *verified* email address. 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 | required: true - name: fromName | type: string | description: Sender name. This name appears in the email as "from:" name. | required: true - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address. > **Note:** An email address must be verified using 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. | required: true - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender details. - 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). Return type: CreateSenderDetailsResponse - name: senderDetails | type: SenderDetails | description: The created sender details. - name: id | type: string | description: Sender details GUID. - name: createdDate | type: string | description: Date and time the sender details were created. - name: updatedDate | type: string | description: Date and time the sender details were last updated. - name: fromName | type: string | description: Sender name. This name appears in the email as "from:" name. - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address. > **Note:** An email address must be verified using 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. - name: default | type: boolean | description: Whether the sender is default. - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender details. - 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). Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: OVER_QUOTA | Description: Number of sender details exceeds the server's limit. ``` ### Examples ### CreateSenderDetails ```curl ~~~cURL curl -X POST 'https://www.wixapis.com/sender-details/v1/sender-details' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "senderDetails": { "fromName": "John Doe", "fromEmailAddress": "john.doe@example.com", } }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.emails.SenderDetailsService.createSenderDetails(senderDetails) Description: Creates a sender. > **Note:** You can only create a sender for a *verified* email address. # 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 | required: true - name: fromName | type: string | description: Sender name. This name appears in the email as "from:" name. | required: true - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address. > **Note:** An email address must be verified using 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. | required: true - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender details. - 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). Return type: PROMISE - name: _id | type: string | description: Sender details GUID. - name: _createdDate | type: Date | description: Date and time the sender details were created. - name: _updatedDate | type: Date | description: Date and time the sender details were last updated. - name: fromName | type: string | description: Sender name. This name appears in the email as "from:" name. - name: fromEmailAddress | type: string | description: Sender email address. Recipients can also reply to this email address. > **Note:** An email address must be verified using 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. - name: default | type: boolean | description: Whether the sender is default. - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender details. - 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). Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: OVER_QUOTA | Description: Number of sender details exceeds the server's limit. ``` ### Examples ### createSenderDetails ```javascript import { senderDetails } from '@wix/sender-details'; async function createSenderDetails(senderDetails) { const response = await senderDetails.createSenderDetails(senderDetails); }; ``` ### createSenderDetails (with elevated permissions) ```javascript import { senderDetails } from '@wix/sender-details'; import { auth } from '@wix/essentials'; async function myCreateSenderDetailsMethod(senderDetails) { const elevatedCreateSenderDetails = auth.elevate(senderDetails.createSenderDetails); const response = await elevatedCreateSenderDetails(senderDetails); } ``` ### createSenderDetails (self-hosted) Self-hosted 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); }; ``` ---