Documents

Represents a list of documents attached to a task.

URI
/api/v10/applications/ID/tasks/ID/documents

GET List documents

List all documents attached to a task.

To retrieve the binary data of the document, you can use GET /api/v10/applications/ID/tasks/ID/documents/ID.

Syntax
GET /api/v10/applications/123/tasks/321/documents
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/tasks/321/documents"

Response headers

HeaderValueDescription
Content-Typeapplication/jsonThe media type of the resource
Content-Length1234The size of the response body in bytes
X-Count4The number of documents attached to the task

Response codes

Response codeDescription
200 OKThe list of documents was successfully returned

Example response

Response
{
  "1001": {
    "id": 1001,
    "uploaded": "2025-12-04T11:05:37+00:00",
    "folder": "Passport or ID card",
    "name": "passport01.png",
    "mime": "image/jpeg",
    "size": 434125,
    "task": {
      "class": "checklist-passport-eu",
      "title": "Passport or ID card"
    }
  },
  "1002": {
    "id": 1002,
    "uploaded": "2025-12-10T13:38:58+00:00",
    "folder": "Passport or ID card",
    "name": "passport02.png",
    "mime": "image/png",
    "size": 391980,
    "task": {
      "class": "checklist-passport-eu",
      "title": "Passport or ID card"
    }
  }
}

POST Upload a document to the task

Initiate an upload process to add a new document to a task.

You can also upload a document to the application itself. To do this, use POST /api/v10/applications/ID/documents.

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

The process is as follows:

  1. The client calls POST /api/v10/applications/123/tasks/321/documents:

    Request
    curl
    curl \
       -X POST \
       -H "Authorization: DREAM apikey=\"YOUR-API-KEY\"" \
       "https://apply.example.edu/api/v10/applications/123/tasks/321/documents" \
       -v
       
  2. DreamApply returns code 204 and an ingress URL on the Location header, such as https://svcs-ingress.dreamapply.com/........ that contains a JWT token, authorising the upload.

  3. Client pushes a file using a standard multipart request, for example:

    Request
    curl
    curl \
       -X POST \
       -F 'upload=@/path/to/your/image.jpg' \
       "https://svcs-ingress.dreamapply.com/temp-upload-token"
       
  4. The ingress service returns code 201 if the file was accepted.

The ingress URL is valid for 30 minutes to upload the file (or files — the URL can be used multiple times to upload multiple files within the 30 minute window). Up to 10MiB are allowed, and any of the usual MIME-s are allowed (same as in the UI).

Example request

Request
curl
# --- Configuration variables ---
API_KEY="YOUR-API-KEY"
APP_ID="APPLICATION-ID"
TASK_ID="TASK-ID"
DOCUMENT_PATH="PATH-TO-DOCUMENT.JPG"
BASE_URL="https://apply.example.edu"

# 1. Initiate upload and extract ingress URL
INGRESS_URL=$(curl -X POST \
    -H "Authorization: DREAM apikey=\"$API_KEY\"" \
    "$BASE_URL/api/v10/applications/$APP_ID/tasks/$TASK_ID/documents" \
    --silent --head \
    | perl -n -e 'print $1 if /location:\s*(\S+)/i' \
    | tr -d '\r\n' \
)

# Check if the URL was successfully retrieved
if [ -z "$INGRESS_URL" ]; then
    echo "CRITICAL ERROR: Failed to retrieve Ingress URL (Token)."
    echo "Double-check your API Key, Application ID, and Task ID."
    exit 1
fi

echo "Successfully retrieved Ingress URL."

# 2. Execute Upload using the extracted URL
echo "Starting file upload of '$DOCUMENT_PATH' to Ingress Service..."

curl -X POST \
    -F "upload=@$DOCUMENT_PATH" \
    "$INGRESS_URL" \
    -w "\nUpload HTTP Status: %{http_code}\n"

Response codes

Response codeDescription
204 No ContentThe ingress URL was returned in the Location header