Offer letters
API version
Select a version to change the base URI
in syntax and code examples. Learn about versions:
in syntax and code examples. Learn about versions
Represents a list of offer letters.
/api/v10/applications/ID/offers/ID/lettersLetterheads
Letterheads are document templates used to generate attachments for offers. The generation workflow includes the following steps:
DreamApply creates a letter from the letterhead. This letter represents a generated, potentially user-customized document where each template marker is replaced with actual applicant data. The letterhead can be accessed using offer letters.
To attach the letter to an offer, DreamApply converts it to a PDF file. The PDF file is attached to the offer as a regular uploaded PDF.
The DreamApply UI automatically manages this process, while the API explicitly exposes the complete underlying data model.
Fetching a list of offer letters is usually not useful for API consumers. The GET requests are provided only for the sake of completeness.
The primary request is generating a new offer letter. For convenience, such letters get automatically attached to the specified offer. For details, see Generate an offer letter.
GET List offer letters
List all offer letters generated from letterheads.
GET /api/v10/applications/123/offers/321/letters
Host: apply.example.edu
Authorization: DREAM apikey="..."Example request
curl \
-X GET \
-H "Authorization: DREAM apikey=\"YOUR-API-KEY\"" \
"https://apply.example.edu/api/v10/applications/123/offers/321/letters"Response headers
| Header | Value | Description |
|---|---|---|
Content-Type | application/json | The media type of the resource |
Content-Length | 1456 | The size of the response body in bytes |
X-Count | 1 | The number of letters for this offer |
Response codes
| Response code | Description |
|---|---|
200 OK | The list of offer letters was successfully returned |
Example response
{
"1": {
"id": 1,
"rendered": "2025-01-02T15:44:09+00:00",
"letterhead": "/api/v10/letterheads/1",
"administrator": null
}
}POST Generate an offer letter
Generate a new offer letter (attachment) from a letterhead.
The process includes the following steps:
- A letter is generated from a letterhead.
- The letter is converted to PDF.
- The PDF file is attached to the offer.
By its semantics, the POST request is intended to perform the first step of the process — creating a letter. However, a standalone letter is rarely useful. For convenience, this request also renders the letter as a PDF file and attaches it to the specified offer.
This API request is equivalent to the one-click attach feature in the offer settings. The same limitations apply:
A letter generated from this letterhead must not already exist. Otherwise, this API request can overwrite existing user customisation beyond the letterhead template. Keep in mind that the letterhead template can (and often is) edited when generating (and attaching) a letter.
The markers in the letterhead template must be resolvable. For example, if a letterhead contains a marker for the applicant’s phone number, the request will fail if the phone number field is not properly filled in the application. That is, this API request only allows for the “happy path”. It does not offer ways to recover from errors or substitute missing information.
POST /api/v10/applications/123/offers/321/letters
Host: apply.example.edu
Authorization: DREAM apikey="..."Parameters
| Name | Required/Optional | Description |
|---|---|---|
letterhead | Required | The letterhead ID to use as the template for generating the letter |
Example request
curl \
-X POST \
-H "Authorization: DREAM apikey=\"YOUR-API-KEY\"" \
"https://apply.example.edu/api/v10/applications/123/offers/321/letters?letterhead=3"Response headers
| Header | Value | Description |
|---|---|---|
Content-Type | application/json | The media type of the resource |
Content-Length | 0 | The size of the response body in bytes |
Location | /api/applications/123/offers/321/letters/1001 | The URI of the generated attachment |
Response codes
| Response code | Description |
|---|---|
201 Created | A new letter was created, rendered to PDF and attached to the offer |
400 Bad Request | The letterhead ID was not provided as a parameter |
404 Not Found | The letterhead was not found |
400 Bad Request | There is already a pre-existing letter generated from this letterhead |
400 Bad Request | Errors or warnings were encountered when filling the letterhead markers |