Application documents

Attach an uploaded document

Finishes an upload by attaching the uploaded file to the rental application, optionally to one specific employment or address entry, and returns the attachment with its download URLs. Requires the rental_applications:write permission.

POST
https://services.magicdoor.com/leasing/company-portal/rental-applications/{applicationId}/files/session/{sessionId}/commit

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

applicationIdstringrequired

The rental application to work with. A Snowflake id, sent as a decimal string.

example: 1830472847398404096
sessionIdstringrequired

The upload session to work with. A Snowflake id, sent as a decimal string.

example: 1832910556372910080

Body

application/json

Every field is optional. Send an empty object to attach the file to the application as a whole with kind other.

descriptionstring

Note stored alongside the file. At most 512 characters.

kindenum<string>

What kind of document this is. Defaults to other.

default: otherotherpayStubgovernmentIdbankStatementtaxReturnofferLetterreferenceLetteremploymentVerification
employmentIdstring

Attach the file to this employment entry instead of to the application as a whole. Cannot be combined with residentialHistoryId, and the entry must belong to this application.

residentialHistoryIdstring

Attach the file to this address entry instead of to the application as a whole. Cannot be combined with employmentId, and the entry must belong to this application.

Response

200 · The attached document, with its metadata and signed download URLs filled in.

idstring

The attachment record on this rental application. Use it to fetch or delete the file.

fileIdstring

The stored file in the Files service that this attachment points at.

namestring

File name captured when the upload was committed.

descriptionstring

Free-text note the uploader supplied. Absent when none was given.

kindenum<string>

What kind of document this is. other when the uploader did not say.

otherpayStubgovernmentIdbankStatementtaxReturnofferLetterreferenceLetteremploymentVerification
employmentIdstring

The employment entry this file is attached to. Absent when the file belongs to the application as a whole.

residentialHistoryIdstring

The residential-history entry this file is attached to. Absent when the file belongs to the application as a whole.

extensionstring

File extension without the dot, for example "pdf". An empty string when the stored file is missing.

sizeinteger

Size in bytes. 0 when the stored file is missing.

contentTypestring

MIME type, for example "application/pdf". An empty string when the stored file is missing.

publicUrlobject

Signed URLs for fetching the file. Every value is an empty string when the stored file is missing — treat an empty raw as "file unavailable".

createdstring · date-time

When the file was attached, in the company's timezone.

updatedstring · date-time

When the attachment was last changed, in the company's timezone.

400 · Both `employmentId` and `residentialHistoryId` were sent, or the entry named does not belong to this rental application.

401 · The access token is missing, expired, or not valid.

403 · The caller is authenticated but does not hold the `rental_applications:write` permission.

404 · No rental application with this id exists, or it belongs to another company. Both cases look identical so that ids cannot be probed across companies.

Allowed in every application status

This is not gated on the application's status — it works on a draft, on a submitted application, and on a retracted one. Only the applicant-facing portal locks an application once it is submitted.