> 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-examwindow.md).

# Create ExamWindow

```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."},"ResourceType":{"type":"string","description":"Identifies the Resource."},"ExamWindow":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["ExamWindow"]},"attributes":{"type":"object","properties":{"createdAt":{"type":"string","readOnly":true},"updatedAt":{"type":"string","readOnly":true},"name":{"type":"string","minLength":1,"maxLength":255},"activateAt":{"type":"string","format":"date-time","description":"When candidates enrolled through this window may start. Independent of the selected test’s own dates."},"deactivateAt":{"type":"string","format":"date-time","nullable":true,"description":"Last start time for this window. Omit for no close."},"relativeCloseTimeInMs":{"type":"integer","minimum":1,"nullable":true,"description":"How long each candidate has once their attempt opens, in milliseconds. An attempt opens with the window, or on enrolment if that is later, and never closes after the window does. Omit for attempts that take the window’s dates."},"isArchived":{"type":"boolean","readOnly":false,"description":"An archived window accepts no new candidates. Existing attempts are unaffected."},"isCancelled":{"type":"boolean","readOnly":false,"description":"A cancelled window accepts no new candidates, and its attempts that have not started are cancelled. Attempts in progress can finish. Cancelling cannot be undone."},"isDraft":{"type":"boolean","readOnly":true,"description":"A draft issues no attempts until it is published through exam-window-publications. Defaults to true; false creates the window published."},"attemptCount":{"type":"integer","readOnly":true,"nullable":true,"description":"How many attempts the window has issued. Null when the caller can't read the exam's attempts."},"candidateCount":{"type":"integer","readOnly":true,"nullable":true,"description":"How many people the window has issued attempts to. Null when the caller can't read the exam's attempts."},"attemptCountsByStatus":{"type":"object","readOnly":true,"nullable":true,"description":"The window's attempts by exam status. Statuses with no attempts are left out. Null when the caller can't read the exam's attempts.","properties":{"enrolled":{"type":"integer"},"notified":{"type":"integer"},"preflight":{"type":"integer"},"started":{"type":"integer"},"submitted":{"type":"integer"},"revoked":{"type":"integer"},"expired":{"type":"integer"},"cancelled":{"type":"integer"}},"additionalProperties":false}}},"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"]}}}}},"test":{"type":"object","description":"The released exam version candidates will sit. Optional for a draft; publication uses the exam’s published version. Changing it after publication affects future enrolments only.","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":["Quiz"]}}}}},"owner":{"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"]}}}}},"subPortal":{"type":"object","description":"Sub-portal staff can only create windows in their own sub-portal. Root staff can choose any sub-portal, or omit it for a root window. It cannot change later.","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":["SubPortal"]}}}}},"selectedUsers":{"type":"object","description":"Candidates picked for the draft, replaced whole on each save. Cleared when the window is published.","readOnly":false,"properties":{"data":{"type":"array","nullable":true,"items":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"allOf":[{"$ref":"#/components/schemas/ResourceType"},{"enum":["User"]}]}}}}}},"selectedUserGroups":{"type":"object","description":"Groups picked for the draft, replaced whole on each save. Their members at publication are issued attempts, and the list is cleared.","readOnly":false,"properties":{"data":{"type":"array","nullable":true,"items":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"allOf":[{"$ref":"#/components/schemas/ResourceType"},{"enum":["UserGroup"]}]}}}}}}}}}},"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-windows":{"post":{"summary":"Create ExamWindow","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":["ExamWindow"]},"attributes":{"type":"object","required":["name","activateAt"],"properties":{"createdAt":{"type":"string","readOnly":true},"updatedAt":{"type":"string","readOnly":true},"name":{"type":"string","minLength":1,"maxLength":255},"activateAt":{"type":"string","format":"date-time","description":"When candidates enrolled through this window may start. Independent of the selected test’s own dates."},"deactivateAt":{"type":"string","format":"date-time","nullable":true,"description":"Last start time for this window. Omit for no close."},"relativeCloseTimeInMs":{"type":"integer","minimum":1,"nullable":true,"description":"How long each candidate has once their attempt opens, in milliseconds. An attempt opens with the window, or on enrolment if that is later, and never closes after the window does. Omit for attempts that take the window’s dates."},"isArchived":{"type":"boolean","readOnly":true,"description":"An archived window accepts no new candidates. Existing attempts are unaffected."},"isCancelled":{"type":"boolean","readOnly":true,"description":"A cancelled window accepts no new candidates, and its attempts that have not started are cancelled. Attempts in progress can finish. Cancelling cannot be undone."},"isDraft":{"type":"boolean","readOnly":false,"description":"A draft issues no attempts until it is published through exam-window-publications. Defaults to true; false creates the window published."},"attemptCount":{"type":"integer","readOnly":true,"nullable":true,"description":"How many attempts the window has issued. Null when the caller can't read the exam's attempts."},"candidateCount":{"type":"integer","readOnly":true,"nullable":true,"description":"How many people the window has issued attempts to. Null when the caller can't read the exam's attempts."},"attemptCountsByStatus":{"type":"object","readOnly":true,"nullable":true,"description":"The window's attempts by exam status. Statuses with no attempts are left out. Null when the caller can't read the exam's attempts.","properties":{"enrolled":{"type":"integer"},"notified":{"type":"integer"},"preflight":{"type":"integer"},"started":{"type":"integer"},"submitted":{"type":"integer"},"revoked":{"type":"integer"},"expired":{"type":"integer"},"cancelled":{"type":"integer"}},"additionalProperties":false}}},"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"]}}}}},"test":{"type":"object","description":"The released exam version candidates will sit. Optional for a draft; publication uses the exam’s published version. Changing it after publication affects future enrolments only.","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":["Quiz"]}}}}},"owner":{"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"]}}}}},"subPortal":{"type":"object","description":"Sub-portal staff can only create windows in their own sub-portal. Root staff can choose any sub-portal, or omit it for a root window. It cannot change later.","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":["SubPortal"]}}}}},"selectedUsers":{"type":"object","description":"Candidates picked for the draft, replaced whole on each save. Cleared when the window is published.","readOnly":true,"properties":{"data":{"type":"array","nullable":true,"items":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"allOf":[{"$ref":"#/components/schemas/ResourceType"},{"enum":["User"]}]}}}}}},"selectedUserGroups":{"type":"object","description":"Groups picked for the draft, replaced whole on each save. Their members at publication are issued attempts, and the list is cleared.","readOnly":true,"properties":{"data":{"type":"array","nullable":true,"items":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"allOf":[{"$ref":"#/components/schemas/ResourceType"},{"enum":["UserGroup"]}]}}}}}}}}}}}}}}},"responses":{"201":{"description":"Created","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ExamWindow"}}}}}},"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"}}}}}}}},"operationId":"examWindows.createExamWindow"}}}}
```


---

# 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-examwindow.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.
