# SendEmail

## Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

### Headers

```
GET /api/ss/email HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Query

**to (string | object)**

Send email To. Must be either an email as a string or an object with one field "user\_id"

Example:

```
{
   "to": [
      "support@attackforge.com",
      {
        "user_id": "6698cbabba716055c969a658"
      }
    ]
}
```

**cc (string | object)**

CC email to. Must be either an email as a string or an object with one field "user\_id"

Example:

```
{
   "cc": [
      "support@attackforge.com",
      {
        "user_id": "6698cbabba716055c969a658"
      }
    ]
}
```

**bcc (string | object)**

BCC email to. Must be either an email as a string or an object with one field "user\_id"

Example:

```
{
   "bcc": [
      "support@attackforge.com",
      {
        "user_id": "6698cbabba716055c969a658"
      }
    ]
}
```

**subject**

Email subject

Example:

```
{
   "subject": "EMAIL SUBJECT"
}
```

**text**

Email body in plaintext

Example:

```
{
   "text": "EMAIL BODY IN PLAINTEXT"
}
```

**html**

Email body in html

Example:

```
{
   "html": "<p style=\"border: 3px solid green;\"><b>EMAIL BODY</b></p>"
}
```

## Example

The following example is a cURL request to send daily project commencement email to project team.

### Request

Include API Token instead of stars in 'X-SSAPI-KEY: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*' parameter.

{% code overflow="wrap" %}

```
curl --request POST \
	--url https://localhost:3000/api/ss/email \
	--header 'content-type: application/json' \
	--header 'x-ssapi-key: ***************************************' \
	--data '{"to":["support@attackforge.com",{"user_id":"6698cbabba716055c969a658"}],"cc":["support@attackforge.com",{"user_id":"6698cbabba716055c969a658"}],"bcc":["support@attackforge.com",{"user_id":"6698cbabba716055c969a658"}],"subject":"EMAIL SUBJECT","text":"EMAIL BODY","html":"<p style=\"border: 3px solid green;\"><b>EMAIL BODY</b></p>"}'
```

{% endcode %}

### Response

Response contains a status.

```
{
   "status": "Accepted"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.attackforge.com/attackforge-enterprise/modules/self-service-restful-api/sendemail.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
