> For the complete documentation index, see [llms.txt](https://synap.ac/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://synap.ac/docs/api/reference/exams/create-examemail.md).

# Create ExamEmail

Creates a draft email on an exam: a subject and body with text variables, an optional preview line and reply-to, and a recipient filter over the exam's attempts. Nothing is sent. Requires the send-message grant on the exam. Not available (501) unless exam emails are enabled for the portal.

```json
{"openapi":"3.0.1","info":{"title":"Synap API","version":"3.0.0"},"tags":[{"name":"Exams","description":"Endpoints related to Exam creation and management."}],"servers":[{"url":"https://api.synap.ac/v3","description":"Production"},{"url":"https://api-stage.synap.ac/v3","description":"Staging"}],"security":[{"SessionAuth":[]},{"PATAuth":[]},{"AutomationAuth":[]},{"LegacySessionAuth":[]}],"components":{"securitySchemes":{"SessionAuth":{"type":"http","scheme":"bearer","description":"Authorize the request using a Session Token.","bearerFormat":"r:<token>"},"PATAuth":{"type":"http","scheme":"bearer","description":"Authorise the request using a personal access token.","bearerFormat":"p:"},"AutomationAuth":{"type":"http","scheme":"bearer","description":"Authorise the request with a short-lived token signed by the automations engine on behalf of a workflow owner.","bearerFormat":"a:<token>"},"LegacySessionAuth":{"type":"apiKey","description":"[Legacy] Authorize the request using a Session Token.","in":"header","name":"X-Syn-Session-Token"}},"schemas":{"ObjectId":{"type":"string","description":"The primary key for each resource."},"ExamEmail":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["ExamEmail"]},"attributes":{"type":"object","properties":{"subject":{"type":"string","minLength":1},"previewText":{"type":"string","nullable":true,"description":"The inbox preview line. Text variables apply, as in the subject and body."},"body":{"type":"string","description":"HTML, with text variables in double braces: `user.*`, `portal.*`, `sender.*`, `exam.name` and `attempt.*`. Empty on a new draft when omitted."},"replyTo":{"type":"string","format":"email","nullable":true,"description":"Where replies go. The sender is always the portal’s configured address."},"recipientFilter":{"type":"object","properties":{"attemptIds":{"type":"array","items":{"type":"string"}},"filter":{"type":"object","properties":{"propertyFilters":{"type":"array","description":"Candidate attribute filters. Each attribute may appear only once.","items":{"type":"object","required":["attribute","value"],"properties":{"attribute":{"type":"string","pattern":"^filter\\.attr\\.[a-z0-9_-]+$"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]},"operator":{"type":"string","enum":["$eq","$ne","$exists","$gt","$gte","$lt","$lte","$in","$nin","$or"]}}}},"examStatus":{"type":"array","items":{"type":"string","enum":["enrolled","notified","preflight","started","submitted","revoked","expired","cancelled"]}},"markingStatus":{"type":"array","items":{"type":"string","enum":["notStarted","inProgress","readyToFinalise","finalised","completed"]}},"gradeStatus":{"type":"array","items":{"type":"string","enum":["passed","failed"]}},"proctorStatus":{"type":"array","items":{"type":"string","enum":["disabled","enabled","readyForReview","reviewNotRequired","autoApproved","inReview","passed","failed","error"]}},"resultStatus":{"type":"array","items":{"type":"string","enum":["pending","finalised","released"]}},"lockStatus":{"type":"array","items":{"type":"string","enum":["locked","unlocked","none"]}},"systemsCheckStatus":{"type":"array","items":{"type":"string","enum":["notRun","inProgress","passed","attention"]}},"subPortals":{"type":"array","items":{"type":"string"}},"testVersions":{"type":"array","items":{"type":"string"}},"isArchived":{"type":"boolean"},"isCompleted":{"type":"boolean"}}},"search":{"type":"string"}},"description":"Which of the exam’s attempts receive the email, in the shape the attempt list and the candidate export take: a filter, a search, or explicit attempt ids. Resolved when the email is sent, one email per candidate. Empty means every attempt on the exam."},"status":{"type":"string","readOnly":true,"enum":["draft","scheduled","sending","sent","failed"],"description":"Draft until sent or scheduled. A sent email may still count failed recipients; failed means the send itself did not run."},"scheduledFor":{"type":"string","format":"date-time","nullable":true,"description":"Set a future time to schedule the send: the email moves to `scheduled` and goes out within a minute of that time, resolving its recipients then. Set null to cancel, back to `draft`. Scheduling again moves the time. Only a draft or scheduled email can be scheduled."},"sentAt":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"counts":{"type":"object","readOnly":true,"nullable":true,"description":"Recipients by outcome. Null until a send runs.","required":["recipients","sent","notSent","failed"],"properties":{"recipients":{"type":"integer"},"sent":{"type":"integer"},"notSent":{"type":"integer"},"failed":{"type":"integer"}}},"reason":{"type":"string","readOnly":true,"nullable":true,"description":"Why a send failed."},"lastTestAt":{"type":"string","format":"date-time","readOnly":true,"nullable":true,"description":"When a test of this email was last sent."},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"relationships":{"type":"object","properties":{"exam":{"type":"object","description":"This is a resource linkage for a to-one relationship. It is like a Parse Pointer.","readOnly":false,"properties":{"data":{"type":"object","required":["id","type"],"nullable":true,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["Exam-V-2"]}}}}},"createdBy":{"type":"object","description":"This is a resource linkage for a to-one relationship. It is like a Parse Pointer.","readOnly":true,"properties":{"data":{"type":"object","required":["id","type"],"nullable":true,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["User"]}}}}},"sentBy":{"type":"object","description":"This is a resource linkage for a to-one relationship. It is like a Parse Pointer.","readOnly":true,"properties":{"data":{"type":"object","required":["id","type"],"nullable":true,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["User"]}}}}},"backgroundJob":{"type":"object","description":"The send in progress or just finished; poll `GET /v3/background-jobs/{id}` for progress.","readOnly":true,"properties":{"data":{"type":"object","required":["id","type"],"nullable":true,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["BackgroundJob"]}}}}}}}}},"BackgroundJob":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["BackgroundJob"]},"attributes":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"createdAt":{"type":"string","readOnly":true},"timeStarted":{"type":"string","readOnly":true},"timeCompleted":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":true},"status":{"type":"string","enum":["queued","delayed","started","stalled","successful","failed","panic"],"readOnly":true},"progress":{"type":"number","readOnly":true},"message":{"type":"string","readOnly":true},"data":{"type":"array","readOnly":true,"items":{"type":"array","readOnly":true,"items":{"oneOf":[{"type":"string"},{"type":"object"}],"maxItems":2}}},"params":{"type":"object","readOnly":true},"error":{"type":"string","readOnly":true},"result":{"type":"object","readOnly":true,"nullable":true}}},"relationships":{"type":"object","properties":{}}}},"BadRequestApiError":{"type":"object","description":"The request was invalid.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}},"UnauthorizedApiError":{"type":"object","description":"Unauthorized request.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}},"ForbiddenApiError":{"type":"object","description":"Forbidden request.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}},"NotFoundApiError":{"type":"object","description":"The request resource could not be found.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}},"ApiError":{"type":"object","description":"This is an error response structure. The id, status, code, title and detail will vary based on the error situation.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}}}},"paths":{"/exam-emails":{"post":{"summary":"Create ExamEmail","description":"Creates a draft email on an exam: a subject and body with text variables, an optional preview line and reply-to, and a recipient filter over the exam's attempts. Nothing is sent. Requires the send-message grant on the exam. Not available (501) unless exam emails are enabled for the portal.","tags":["Exams"],"parameters":[],"requestBody":{"required":true,"content":{"application/vnd.api+json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["type","attributes","relationships"],"properties":{"type":{"type":"string","description":"Identifies the Resource.","enum":["ExamEmail"]},"attributes":{"type":"object","required":["subject"],"properties":{"subject":{"type":"string","minLength":1},"previewText":{"type":"string","nullable":true,"description":"The inbox preview line. Text variables apply, as in the subject and body."},"body":{"type":"string","description":"HTML, with text variables in double braces: `user.*`, `portal.*`, `sender.*`, `exam.name` and `attempt.*`. Empty on a new draft when omitted."},"replyTo":{"type":"string","format":"email","nullable":true,"description":"Where replies go. The sender is always the portal’s configured address."},"recipientFilter":{"type":"object","properties":{"attemptIds":{"type":"array","items":{"type":"string"}},"filter":{"type":"object","properties":{"propertyFilters":{"type":"array","description":"Candidate attribute filters. Each attribute may appear only once.","items":{"type":"object","required":["attribute","value"],"properties":{"attribute":{"type":"string","pattern":"^filter\\.attr\\.[a-z0-9_-]+$"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]},"operator":{"type":"string","enum":["$eq","$ne","$exists","$gt","$gte","$lt","$lte","$in","$nin","$or"]}}}},"examStatus":{"type":"array","items":{"type":"string","enum":["enrolled","notified","preflight","started","submitted","revoked","expired","cancelled"]}},"markingStatus":{"type":"array","items":{"type":"string","enum":["notStarted","inProgress","readyToFinalise","finalised","completed"]}},"gradeStatus":{"type":"array","items":{"type":"string","enum":["passed","failed"]}},"proctorStatus":{"type":"array","items":{"type":"string","enum":["disabled","enabled","readyForReview","reviewNotRequired","autoApproved","inReview","passed","failed","error"]}},"resultStatus":{"type":"array","items":{"type":"string","enum":["pending","finalised","released"]}},"lockStatus":{"type":"array","items":{"type":"string","enum":["locked","unlocked","none"]}},"systemsCheckStatus":{"type":"array","items":{"type":"string","enum":["notRun","inProgress","passed","attention"]}},"subPortals":{"type":"array","items":{"type":"string"}},"testVersions":{"type":"array","items":{"type":"string"}},"isArchived":{"type":"boolean"},"isCompleted":{"type":"boolean"}}},"search":{"type":"string"}},"description":"Which of the exam’s attempts receive the email, in the shape the attempt list and the candidate export take: a filter, a search, or explicit attempt ids. Resolved when the email is sent, one email per candidate. Empty means every attempt on the exam."}}},"relationships":{"type":"object","required":["exam"],"properties":{"exam":{"type":"object","description":"This is a resource linkage for a to-one relationship. It is like a Parse Pointer.","readOnly":false,"properties":{"data":{"type":"object","required":["id","type"],"nullable":true,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["Exam-V-2"]}}}}}}}}}}}}}},"responses":{"201":{"description":"Created","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ExamEmail"}}}}}},"202":{"description":"Accepted","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BackgroundJob"}}}}}},"400":{"description":"Bad Request","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BadRequestApiError"}}}}}}},"401":{"description":"Unauthorized","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/UnauthorizedApiError"}}}}}}},"403":{"description":"Forbidden","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ForbiddenApiError"}}}}}}},"404":{"description":"Not Found","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/NotFoundApiError"}}}}}}},"409":{"description":"Conflict","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ApiError"}}}}}}},"501":{"description":"Not enabled for this portal","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"operationId":"examEmails.createExamEmail"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://synap.ac/docs/api/reference/exams/create-examemail.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
