# Developer SDK Reference Hub

The `SDOC.DocumentSDK` class provides static methods to generate and manage documents programmatically.

{% hint style="info" icon="memo-pad" %}
Developer Note: All methods are Synchronous and should be wrapped in `try/catch` blocks to handle `SDOC.Exceptions.GenerationException`. For Trigger-based logic, use an `@future` or `Queueable` wrapper.
{% endhint %}

### Core Generation Methods

| **Method**                                                   | **Signature**                                | **Best For...**                                        |
| ------------------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------ |
| [`generateDocument`](https://www.google.com/search?q=%23)    | `(Id, Id, GenerationOptions)`                | Modern PDF. Returns JSON metadata (ID, Name, Date).    |
| [`generateDoc`](https://www.google.com/search?q=%23)         | `(Id, Id, Boolean)`                          | Legacy/MSX. Returns the S-Doc record as a JSON string. |
| [`generateDocsInBatch`](https://www.google.com/search?q=%23) | `(List<Id>, Set<Id>, Integer, List<Action>)` | Bulk/Combined. Returns an `AsyncApexJob` ID.           |

### Email & Content Methods

| **Method**                                                   | **Signature**            | **Best For...**                                             |
| ------------------------------------------------------------ | ------------------------ | ----------------------------------------------------------- |
| [`generateEmail`](https://www.google.com/search?q=%23)       | `(Id, Id, EmailOptions)` | Compiling HTML bodies or full `SingleEmailMessage` objects. |
| [`combineDocuments`](https://www.google.com/search?q=%23)    | `(List<String>, String)` | Merging existing S-Doc PDFs into a new combined file.       |
| [`refreshDocumentData`](https://www.google.com/search?q=%23) | `(Id, Boolean)`          | Updating S-Doc metadata when base record data changes.      |

***

### Helper Classes & Objects

Click below to view the property maps for SDK input objects:

* [`SDOC.GenerationOptions`](https://www.google.com/search?q=%23): Main configuration object for `generateDocument`.
* [`SDOC.EmailOptions`](https://www.google.com/search?q=%23): Routing details (To, CC, BCC) and attachments.
* [`SDOC.UserInput`](https://www.google.com/search?q=%23): Mapping runtime data to Template Merge Fields.


---

# 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://help.sdocs.com/developer-hub/references/software-development-kit-sdk/developer-sdk-reference-hub.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.
