Offer letters

Represents a list of offer letters.

URI
/api/v10/applications/ID/offers/ID/letters

Letterheads

Letterheads are document templates used to generate attachments for offers. The generation workflow includes the following steps:

  1. 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.

  2. 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.

Syntax
GET /api/v10/applications/123/offers/321/letters
Host: apply.example.edu
Authorization: DREAM apikey="..."

Example request

Request
curl
curl \
  -X GET \
  -H "Authorization: DREAM apikey=\"YOUR-API-KEY\"" \
  "https://apply.example.edu/api/v10/applications/123/offers/321/letters"

Response headers

HeaderValueDescription
Content-Typeapplication/jsonThe media type of the resource
Content-Length1456The size of the response body in bytes
X-Count1The number of letters for this offer

Response codes

Response codeDescription
200 OKThe list of offer letters was successfully returned

Example response

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:

  1. A letter is generated from a letterhead.
  2. The letter is converted to PDF.
  3. 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.

Syntax
POST /api/v10/applications/123/offers/321/letters
Host: apply.example.edu
Authorization: DREAM apikey="..."

Parameters

NameRequired/OptionalDescription
letterheadRequiredThe letterhead ID to use as the template for generating the letter

Example request

Request
curl
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

HeaderValueDescription
Content-Typeapplication/jsonThe media type of the resource
Content-Length0The size of the response body in bytes
Location/api/applications/123/offers/321/letters/1001The URI of the generated attachment

Response codes

Response codeDescription
201 CreatedA new letter was created, rendered to PDF and attached to the offer
400 Bad RequestThe letterhead ID was not provided as a parameter
404 Not FoundThe letterhead was not found
400 Bad RequestThere is already a pre-existing letter generated from this letterhead
400 Bad RequestErrors or warnings were encountered when filling the letterhead markers