The Student Guarantor

The Student Guarantor API Reference

The Student Guarantor API is organised around REST. It has resource-oriented URLs, accepts JSON request bodies, returns JSON responses, and uses standard HTTP response codes, authentication and verbs.

The base URL for every request is:

https://api.thestudentguarantor.com/v1

Use the sandbox to test your integration without creating real applications. The API key you use determines whether a request runs in the sandbox or in production.

EnvironmentKey prefix
Sandboxtsg_test_sk_
Productiontsg_live_sk_

1Integration flow

TenantTSG componentYour frontendYour serverTSG APIPOST /quotesPOST /filesPOST /applicationsapplication · requirements[]POST /applications/{id}/sessionssession · client_secretclient_secretmount(clientSecret)tenant requirementsonCompletewebhook · application.requirements_updatedPOST /applications/{id}/fee/confirmopt · when fee.collection is partnercosigner, landlord: completed by email linkwebhook · application.approved, guarantee.issuedGET /guarantees/{id}/certificate

Solid arrows are requests. Dashed arrows are responses and callbacks. Webhooks are requests from the API to your server.

2Authentication

The API uses API keys to authenticate requests. Provide your secret key as a bearer token.

curl https://api.thestudentguarantor.com/v1/applications \
  -H "Authorization: Bearer tsg_test_sk_4f9c…"

Secret keys carry full access to your account. Keep them on your server and don't expose them in client-side code. Client-side code uses a session's client_secret instead.

All requests must be made over HTTPS. Calls made over plain HTTP fail. Requests without a valid key return 401.

You can have two active keys per environment, which lets you rotate keys without downtime. You can restrict a production key to a list of source IP addresses.

3Errors

The API uses conventional HTTP response codes. Codes in the 2xx range indicate success. Codes in the 4xx range indicate a request that failed given the information provided. Codes in the 5xx range indicate an error on our servers.

{
  "error": {
    "type": "validation_error",
    "code": "date_range_invalid",
    "message": "tenancy.end_date must be after tenancy.start_date.",
    "param": "tenancy.end_date",
    "request_id": "req_5tH9jK2mNb"
  }
}
StatusTypeDescription
400invalid_request_errorThe request is malformed or missing a required parameter.
401authentication_errorNo valid API key provided.
403permission_errorThe API key can't perform the request.
404not_found_errorThe requested object doesn't exist.
409conflict_errorThe request conflicts with another request or with the object's current state.
422validation_errorA parameter failed validation.
429rate_limit_errorToo many requests. Retry after the number of seconds in Retry-After.
5xxapi_errorSomething went wrong on our end. Retry with the same idempotency key.

Handle errors by code. The message is for developers and can change.

CodeDescription
parameter_missingA required parameter is missing. See param.
parameter_invalidA parameter has the wrong type or format. See param.
external_reference_in_useAn application with this external_reference exists. Its ID is in existing_id.
idempotency_key_reusedThe idempotency key was used with different parameters.
quote_expiredThe quote is past its expires_at.
quote_mismatchThe application's priced details differ from the quote's.
tenancy_not_eligibleThe tenancy can't be guaranteed.
file_not_foundA referenced file doesn't exist or has been deleted.
file_type_unsupportedThe file isn't a JPEG, PNG or PDF.
application_not_editableThe application's status or signatures don't allow this update.
fee_collection_mismatchThe application's fee.collection isn't partner.
fee_amount_mismatchThe confirmed amount differs from fee.amount.
fee_changedThe fee is no longer the quoted fee or fee.amount. Create a new quote.
session_not_availableNo requirement can be completed in a session.
fee_already_collectedThe fee is paid, so the fee or a priced detail can't change.
cosigner_email_same_as_tenantThe cosigner and the tenant have the same email.
tenant_email_not_allowedThe tenant's email can't be used for an application.
university_not_foundNo university has this university_id.
endpoint_limit_reachedThe account has 5 webhook endpoints in this environment.
document_not_availableThe guarantee has no signed agreement to download.
request_in_progressA request with this idempotency key is still running.
simulation_not_applicableThe simulated action has nothing to do on this application.

4Idempotent requests

The API supports idempotency for safely retrying requests without performing the same operation twice. To make an idempotent request, provide an Idempotency-Key header.

curl https://api.thestudentguarantor.com/v1/applications \
  -H "Authorization: Bearer tsg_test_sk_4f9c…" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -d @application.json

The API saves the status code and body of the first request made with a key and returns them for subsequent requests with the same key. Keys expire after 24 hours and can be up to 255 characters. We recommend V4 UUIDs. Reusing a key with different parameters returns 409.

All POST and PATCH requests accept idempotency keys. GET and DELETE requests are idempotent by definition.

5Pagination

All list endpoints return objects in reverse chronological order and share the same parameters: limit, between 1 and 100 with a default of 20, and starting_after, the ID of the last object on the previous page.

{
  "object": "list",
  "data": [ … ],
  "has_more": true
}

6Request IDs

Each request has an identifier, returned in the Request-Id response header and in error.request_id. Include it when you contact us about a request.

7Rate limits

The API allows 25 requests per second per key. Requests over the limit return 429 with a Retry-After header.

8Versioning

The version is part of the path. Backwards-compatible changes are released within /v1: new endpoints, new optional parameters, new response fields, new enum values and new event types. Your integration should ignore fields and values it doesn't recognise.

9Data formats

TypeFormatExample
AmountObject with an integer amount in the currency's smallest unit and an ISO 4217 currency.{"amount": 50000, "currency": "GBP"}
RentAmount with a period of week, month or total.{"amount": 32500, "currency": "GBP", "period": "week"}
DateISO 8601 calendar date.2026-10-24
TimestampISO 8601, UTC.2026-11-19T09:16:03Z
CountryISO 3166-1 alpha-2.CN
Phone numberE.164.+8613800139527
Localeen or zh-CN.zh-CN
Object IDString prefixed by object type: quo_, app_, gua_, file_, sess_, evt_, whk_.app_3Nf7QwR1tY8uLk5H

10Application statuses

StatusDescription
incompleteOne or more requirements are due or blocked.
in_reviewAll requirements are satisfied or in review.
approvedThe guarantee is issued. Its ID is in guarantee.
declinedNo guarantee will be issued. The reason is in decline_reason.
cancelledThe application was cancelled through the API.
expiredThe application wasn't completed before expires_at.

Requirements

An application's requirements list what must be completed before it can be approved. Each requirement has a code, the party responsible, a status and the ways it can be completed. The requirements on an application depend on the applicant and on your account configuration. Don't assume a fixed set.

CodeSatisfied whencompletable_via
tenant.detailsThe tenant's personal details are complete.api, session
tenant.identityThe tenant's identity is verified. Blocked until fee.payment is satisfied.api for cn_resident_id, otherwise session
tenant.proof_of_studyAn offer or enrolment letter is provided.api, session
tenant.right_to_rentA Right to Rent share code is provided.api, session
tenant.signatureThe tenant has signed the agreement. Blocked until the landlord requirements on the application are satisfied.session
tenancy.detailsThe property, rent, dates and landlord details are complete.api
cosigner.detailsThe cosigner's personal details are complete.api, session
cosigner.identityThe cosigner's identity is verified.api for cn_resident_id, otherwise email_link
cosigner.signatureThe cosigner has signed the agreement.email_link
landlord.confirmationThe landlord has confirmed the tenancy details.email_link
landlord.signatureThe landlord has signed the agreement.email_link
fee.paymentThe fee is paid.api or session, by fee.collection
Requirement statusDescription
dueWaiting for party. If a submission was rejected, reason says why.
in_reviewSubmitted and being checked.
blockedCan't be completed until another requirement is satisfied.
satisfiedComplete.

11Embedded component

The component renders the requirements a tenant can complete in a session. Load the script, create a session on your server, and mount the component with the session's client_secret.

<div id="tsg-guarantee"></div>
<script src="https://app.thestudentguarantor.com/embed/v1/guarantee.js"></script>
<script>
  const guarantee = TSG.guarantee({
    clientSecret: "sess_9Tg4HbN6mJ2kLp8Q_secret_x7Vq2ZcR5tYw8Ub1",
    locale: "zh-CN",
    appearance: { accentColor: "#FF5A5F" },
    onComplete: (event) => { /* event.applicationId, event.outstanding */ },
    onExit: (event) => { /* event.reason */ },
    onError: (event) => { /* event.code */ }
  });
  guarantee.mount("#tsg-guarantee");
</script>

Methods

MethodDescription
TSG.guarantee(options)Creates a component instance for a session.
guarantee.mount(selector)Renders the component in the element matching selector.
guarantee.unmount()Removes the component from the DOM. It can be mounted again.
guarantee.destroy()Removes the component and discards the session on the client.

Options

OptionTypeDescription
clientSecretrequiredstringThe session's client_secret.
localestringen or zh-CN. Defaults to the session's locale.
appearance.accentColorstringHex colour for buttons and links.
appearance.borderRadiusstringCSS length for corners.
appearance.fontFamilystringSystem font stack.

Events

CallbackPayloadDescription
onReadyCalled when the component has rendered.
onStepChangestepCalled when the tenant moves to another step. Steps appear in this order, and only when the tenant has something to complete in them: review, payment, documents, agreement, done.
onCompleteapplicationId, outstandingCalled when the tenant has completed every requirement available to them. outstanding lists the codes that remain for other parties.
onExitreasonCalled when the tenant leaves before completing. reason is closed or expired.
onErrorcode, messageCalled when the component can't continue. Codes include session_invalid, session_expired, origin_not_allowed and payment_unavailable.

The component only renders on the origins registered for your account. Don't rely on onComplete to update your records. Retrieve the application or listen for application.requirements_updated.

Redirect mode

To use the component where the script can't run, such as a native app or a WeChat mini program, create the session with mode: "redirect" and open its url in a web view. When the tenant finishes or leaves, they are redirected to your return_url with application_id and session_status appended. The return_url must be an HTTPS URL on one of the origins registered for your account.

Content Security Policy

script-src  https://app.thestudentguarantor.com
frame-src   https://app.thestudentguarantor.com

12Fee collection

The fee.collection attribute determines how the fee.payment requirement is satisfied.

fee.collectionDescription
partnerYou charge the tenant, then confirm the fee.
tsgThe tenant pays in the component's payment step. Available in the sandbox only during the preview.

13Webhooks

The API sends events to your webhook endpoints as POST requests with a JSON body.

POST /hooks/tsg HTTP/1.1
Content-Type: application/json
TSG-Event-Id: evt_4Rt7YuI1oP3aS6dF
TSG-Signature: t=1795080687,v1=5d1c0f0b6a7e3c9a…

{
  "id": "evt_4Rt7YuI1oP3aS6dF",
  "object": "event",
  "type": "application.approved",
  "livemode": false,
  "created_at": "2026-11-19T09:31:27Z",
  "data": {
    "object": {
      "id": "app_3Nf7QwR1tY8uLk5H",
      "object": "application",
      "status": "approved",
      "guarantee": "gua_6Yh2JmK9pL4nB7vC"
    }
  }
}

Event types

Typedata.objectDescription
application.createdapplicationOccurs when an application is created.
application.requirements_updatedapplicationOccurs when the status of a requirement changes.
application.in_reviewapplicationOccurs when an application enters review.
application.approvedapplicationOccurs when an application is approved.
application.declinedapplicationOccurs when an application is declined.
application.cancelledapplicationOccurs when an application is cancelled.
application.expiredapplicationOccurs when an application expires.
fee.paidapplicationOccurs when a fee is confirmed or paid.
fee.refundedapplicationOccurs when a fee is refunded in full or in part.
guarantee.issuedguaranteeOccurs when a guarantee is issued.
guarantee.updatedguaranteeOccurs when a guarantee's cover is amended.
guarantee.endedguaranteeOccurs when a guarantee ends.

Verify signatures

Each request includes a TSG-Signature header with a timestamp t and a signature v1. The signature is the HMAC-SHA256, keyed with the endpoint's secret, of the timestamp, a . character and the raw request body. Compute it, compare it with v1 using a constant-time comparison, and reject requests with a timestamp older than five minutes.

For 24 hours after you roll an endpoint's secret, the header carries two v1 values, one for the new secret and one for the old. Accept the request if any v1 matches.

const crypto = require("crypto");

function verify(rawBody, header, secret) {
  const parts = header.split(",").map((p) => p.split("="));
  const t = (parts.find(([k]) => k === "t") || [])[1];
  const expected = Buffer.from(crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"));
  const matches = parts.some(([k, v]) => k === "v1" && v.length === expected.length && crypto.timingSafeEqual(Buffer.from(v), expected));
  return matches && Math.abs(Date.now() / 1000 - Number(t)) <= 300;
}

Delivery

  • Return a 2xx response within 10 seconds. Any other response, or a timeout, is treated as a failure.
  • Failed deliveries are retried with exponential backoff for up to 24 hours.
  • Your endpoint can receive the same event more than once. Use TSG-Event-Id to detect duplicates.
  • Event order isn't guaranteed. Retrieve the object if you need its current state.

14Testing

In the sandbox, no identity checks run, no payments are taken and no emails are sent. Use simulate an outcome to complete requirements for the tenant, cosigner and landlord.

To trigger a specific outcome, create the application with one of these values as tenant.last_name.

tenant.last_nameOutcome
Unreadabletenant.identity returns to due with reason: "document_unreadable".
Mismatchtenant.identity returns to due with reason: "name_mismatch".
ReviewThe application stays in_review until you simulate approve or decline.
DeclineThe application is declined with decline_reason: "tenant_not_eligible".

The component's payment step accepts the test card 4242 4242 4242 4242.

15Resources

15.1Reference data

Lookup values for universities and countries.

GET    /universities
GET    /countries

List universities

GET/universities

Returns a list of universities. Use a university's id as study.university_id.

Parameters

NameInDescription
qqueryCase-insensitive search across the English and Chinese names.

Returns

Returns a list of university objects.

Example response

{
  "object": "list",
  "data": [
    {
      "id": "uni_ucl",
      "object": "university",
      "name": "University College London",
      "name_zh": "伦敦大学学院",
      "country": "GB"
    }
  ],
  "has_more": false
}

List countries

GET/countries

Returns the list of supported countries.

Returns

Returns a list of country objects.

Example response

{
  "object": "list",
  "data": [
    {
      "code": "CN",
      "object": "country",
      "name": "China",
      "name_zh": "中国"
    },
    {
      "code": "MY",
      "object": "country",
      "name": "Malaysia",
      "name_zh": "马来西亚"
    }
  ],
  "has_more": false
}

15.2Quotes

A quote is the fee for a guarantee on one tenancy.

POST   /quotes
GET    /quotes/{quote_id}

The quote object

FieldTypeDescription
idstring
objectstringAlways quote.
livemodebooleanfalse in the sandbox.
feeobjectThe fee for the tenancy.
fee.amountintegerThe amount in the currency's smallest unit. 50000 is £500.00.
fee.currencystringISO 4217 code. Fees are always GBP.
monthly_rent_shareobjectThe tenant's rent for one calendar month, rounded to the nearest pound (50p rounds up). The fee is calculated on this figure.
monthly_rent_share.amountintegerThe amount in the currency's smallest unit. 50000 is £500.00.
monthly_rent_share.currencystringISO 4217 code. Fees are always GBP.
eligibilityobject
eligibility.statusenumeligible: an application can be created. review: an application can be created and will be reviewed manually. ineligible: an application with these details will be rejected with 422.
eligibility.reasonsarray of stringMachine-readable reasons when status is not eligible, for example property_country_unsupported.
expires_atdate-time
created_atdate-time

Create a quote

POST/quotes

Creates a quote. To apply the quoted fee to an application, pass the quote's id as quote_id before expires_at. If the fee for the same details has changed since the quote was created, the application is rejected with 409 fee_changed. Create a new quote.

Request body

FieldTypeDescription
applicant_typeenumType of applicant. One of student, graduate. Default student.
tenantrequiredobject
tenant.nationalityrequiredstringISO 3166-1 alpha-2 code.
tenant.country_of_residencestringISO 3166-1 alpha-2 code. Defaults to the nationality.
studyobjectRequired when applicant_type is student.
study.university_idstringFrom the universities list. Send either this or university_name.
study.university_namestringFor an institution not in the universities list.
study.coursestring
study.levelrequiredenumOne of foundation, undergraduate, postgraduate, other.
study.first_yearbooleanWhether this tenancy covers the tenant's first year at the university.
propertyrequiredobject
property.countryrequiredstringISO 3166-1 alpha-2 code of the property. Currently GB.
property.postcodestringUK postcode.
tenancyrequiredobject
tenancy.rentrequiredobject
tenancy.rent.amountrequiredintegerThe tenant's own share of the rent for one period, in pence.
tenancy.rent.currencyrequiredstringAlways GBP.
tenancy.rent.periodrequiredenumWhat amount covers. total is the whole rent for the tenancy from start date to end date. One of week, month, total.
tenancy.start_daterequireddate
tenancy.end_datedateRequired unless the tenancy is periodic with no fixed end.
tenancy.tenant_countintegerHow many tenants are named on the tenancy. Default 1.
cosigner_relationshipenumThe cosigner's relationship to the tenant, if known. One of parent, guardian, relative, spouse, friend, other.

Example request

curl https://api.thestudentguarantor.com/v1/quotes \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -H "Content-Type: application/json" \
  -d '{
  "tenant": {
    "nationality": "CN",
    "country_of_residence": "CN"
  },
  "study": {
    "university_id": "uni_ucl",
    "level": "postgraduate",
    "first_year": true
  },
  "property": {
    "country": "GB",
    "postcode": "E1 6LT"
  },
  "tenancy": {
    "rent": {
      "amount": 32500,
      "currency": "GBP",
      "period": "week"
    },
    "start_date": "2026-10-24",
    "end_date": "2027-07-10",
    "tenant_count": 1
  }
}'

Returns

Returns the quote object.

Example response

{
  "id": "quo_8Kc2VnQ4hT7xWm3B",
  "object": "quote",
  "livemode": false,
  "fee": {
    "amount": 50000,
    "currency": "GBP"
  },
  "monthly_rent_share": {
    "amount": 140800,
    "currency": "GBP"
  },
  "eligibility": {
    "status": "eligible",
    "reasons": []
  },
  "expires_at": "2026-11-26T09:14:02Z",
  "created_at": "2026-11-19T09:14:02Z"
}

Retrieve a quote

GET/quotes/{quote_id}

Retrieves a quote.

Returns

Returns the quote object.

15.3Files

A file is a document you upload and attach to an application.

POST   /files

The file object

FieldTypeDescription
idstring
objectstringAlways file.
purposeenumWhat the file is. One of identity_document_front, identity_document_back, proof_of_study, visa, tenancy_agreement, other.
filenamestring
content_typestring
sizeintegerSize in bytes.
created_atdate-time

Upload a file

POST/files

Uploads a file. Send the request as multipart/form-data. Files can be JPEG, PNG or PDF, up to 10 MB.

Files that aren't attached to an application are deleted after 7 days.

Request body

FieldTypeDescription
filerequiredfileThe file contents.
purposerequiredenumWhat the file is. One of identity_document_front, identity_document_back, proof_of_study, visa, tenancy_agreement, other.

Example request

curl https://api.thestudentguarantor.com/v1/files \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -F "purpose=identity_document_front" \
  -F "file=@id-front.jpg"

Returns

Returns the file object.

Example response

{
  "id": "file_5pXr9LmA2dQe7NzK",
  "object": "file",
  "purpose": "identity_document_front",
  "filename": "id-front.jpg",
  "content_type": "image/jpeg",
  "size": 482113,
  "created_at": "2026-11-19T09:15:40Z"
}

15.4Applications

An application is a request for a guarantee. It tracks the requirements that must be completed before the guarantee is issued.

POST   /applications
GET    /applications
GET    /applications/{application_id}
PATCH  /applications/{application_id}
POST   /applications/{application_id}/cancel
POST   /applications/{application_id}/fee/confirm

The application object

FieldTypeDescription
idstring
objectstringAlways application.
livemodeboolean
external_referencestring
statusenumincomplete: at least one requirement is due or blocked. in_review: all requirements are supplied and the application is being reviewed. approved: the guarantee is issued. declined: no guarantee will be issued. cancelled: cancelled by you. expired: not completed before expires_at.
applicant_typeenumType of applicant. One of student, graduate. Default student.
localestring
tenantobjectThe tenant's name and email.
tenant.first_namestring
tenant.last_namestring
tenant.emailstring
feeobject
fee.collectionenumOne of partner, tsg.
fee.amountobject
fee.amount.amountintegerThe amount in the currency's smallest unit. 50000 is £500.00.
fee.amount.currencystringISO 4217 code. Fees are always GBP.
fee.statusenumOne of unpaid, paid, refunded, partially_refunded.
fee.paid_atdate-time
requirementsarray of objectThe application's requirements.
requirements[].codeenumIdentifier of the requirement. One of tenant.details, tenant.identity, tenant.proof_of_study, tenant.right_to_rent, tenant.signature, cosigner.details, cosigner.identity, cosigner.signature, tenancy.details, fee.payment, landlord.confirmation, landlord.signature.
requirements[].partyenumParty responsible for the requirement. One of partner, tenant, cosigner, landlord, tsg.
requirements[].statusenumdue: waiting for party. in_review: supplied and being checked. blocked: cannot start until another requirement is satisfied. satisfied: done.
requirements[].completable_viaarray of enumapi: supply it with an update. session: the tenant completes it in the embedded component. email_link: we email the party a link.
requirements[].fieldsarray of stringFor *.details requirements, the missing or invalid field paths.
requirements[].reasonstring or nullA machine-readable reason when a supplied item was not accepted, for example document_unreadable, document_expired, name_mismatch.
decline_reasonenumOne of identity_not_verified, tenancy_not_eligible, tenant_not_eligible, suspected_fraud, other.
guaranteestring or nullThe guarantee ID once approved.
metadataobject
expires_atdate-time
created_atdate-time
updated_atdate-time

Create an application

POST/applications

Creates an application. Any information you don't provide is added to requirements.

Request body

FieldTypeDescription
external_referencerequiredstringYour identifier for the application. Must be unique.
quote_idstringID of a quote to apply. If omitted, the fee is calculated from the application.
applicant_typeenumType of applicant. One of student, graduate. Default student.
localeenumLanguage of the tenant's sessions and emails. One of en, zh-CN. Default en.
tenantrequiredobject
tenant.first_namerequiredstringGiven name in Latin characters, as on the identity document.
tenant.last_namerequiredstringFamily name in Latin characters.
tenant.name_localstringThe full name in its original script, for example 张雨曦. Used to check Chinese identity cards.
tenant.emailrequiredemail
tenant.phonestringE.164 format.
tenant.date_of_birthdate
tenant.nationalityrequiredstringISO 3166-1 alpha-2 code.
tenant.country_of_residencestringISO 3166-1 alpha-2 code.
tenant.addressobjectHome address outside the rented property.
tenant.address.line1requiredstring
tenant.address.line2string
tenant.address.cityrequiredstring
tenant.address.statestringState
tenant.address.postal_codestring
tenant.address.countryrequiredstringISO 3166-1 alpha-2 code.
tenant.right_to_rent_share_codestringGOV.UK Right to Rent share code.
studyobjectRequired when applicant_type is student.
study.university_idstringFrom the universities list. Send either this or university_name.
study.university_namestringFor an institution not in the universities list.
study.coursestring
study.levelrequiredenumOne of foundation, undergraduate, postgraduate, other.
study.first_yearbooleanWhether this tenancy covers the tenant's first year at the university.
propertyrequiredobject
property.namestringThe room or unit as you list it, for example Gold Studio Plus.
property.line1requiredstring
property.line2string
property.cityrequiredstring
property.postcoderequiredstring
property.countryrequiredstringCurrently GB.
property.accommodation_typeenumpbsa is purpose-built student accommodation run by a private operator. One of pbsa, university_halls, private, other.
tenancyrequiredobject
tenancy.agreement_typeenumType of tenancy agreement. One of licence, assured_periodic, common_law, other.
tenancy.rentrequiredobject
tenancy.rent.amountrequiredintegerThe tenant's own share of the rent for one period, in pence.
tenancy.rent.currencyrequiredstringAlways GBP.
tenancy.rent.periodrequiredenumWhat amount covers. total is the whole rent for the tenancy from start date to end date. One of week, month, total.
tenancy.start_daterequireddate
tenancy.end_datedateRequired unless agreement_type is assured_periodic.
tenancy.tenant_countintegerDefault 1.
tenancy.total_rentobjectThe rent for the whole property, when tenant_count is more than 1.
tenancy.total_rent.amountrequiredintegerThe tenant's own share of the rent for one period, in pence.
tenancy.total_rent.currencyrequiredstringAlways GBP.
tenancy.total_rent.periodrequiredenumWhat amount covers. total is the whole rent for the tenancy from start date to end date. One of week, month, total.
tenancy.payment_scheduleenumHow the tenant pays rent to the accommodation provider. One of monthly, instalments.
tenancy.landlordobjectThe landlord's contact details.
tenancy.landlord.namerequiredstring
tenancy.landlord.emailemail
tenancy.landlord.phonestring
tenancy.landlord.addressobject
cosignerobjectThe cosigner's details.
cosigner.first_namerequiredstring
cosigner.last_namerequiredstring
cosigner.name_localstring
cosigner.relationshiprequiredenumOne of parent, guardian, relative, spouse, friend, other.
cosigner.emailrequiredemailMust differ from the tenant's. The signing link is sent here.
cosigner.phonestringE.164 format.
cosigner.date_of_birthdate
cosigner.nationalitystring
cosigner.country_of_residencestring
cosigner.addressobject
cosigner.address.line1requiredstring
cosigner.address.line2string
cosigner.address.cityrequiredstring
cosigner.address.statestringState
cosigner.address.postal_codestring
cosigner.address.countryrequiredstringISO 3166-1 alpha-2 code.
cosigner.localeenumThe language of the cosigner's emails. Defaults to the application's locale. One of en, zh-CN.
documentsobject
documents.tenant_identityobjectImages of an identity document. Supported for Chinese resident identity cards only.
documents.tenant_identity.typerequiredenumOne of cn_resident_id.
documents.tenant_identity.frontrequiredstringA file ID. The side with the photograph.
documents.tenant_identity.backrequiredstringA file ID. The side with the national emblem.
documents.cosigner_identityobjectImages of an identity document. Supported for Chinese resident identity cards only.
documents.cosigner_identity.typerequiredenumOne of cn_resident_id.
documents.cosigner_identity.frontrequiredstringA file ID. The side with the photograph.
documents.cosigner_identity.backrequiredstringA file ID. The side with the national emblem.
documents.proof_of_studystringA file ID. Offer or enrolment letter.
documents.visastringA file ID.
documents.tenancy_agreementstringA file ID.
feeobject
fee.collectionrequiredenumpartner: you charge the tenant and confirm the fee through the API. tsg: the tenant pays in a session. Defaults to the mode configured for your account.
consentsrequiredobject
consents.data_sharingrequiredobjectThe tenant's consent to share their details with The Student Guarantor.
consents.data_sharing.accepted_atrequireddate-time
consents.data_sharing.ip_addressstring
consents.data_sharing.wording_versionstringYour identifier for the consent wording shown.
metadataobjectSet of up to 20 key-value pairs that you can attach to the object.

Example request

curl https://api.thestudentguarantor.com/v1/applications \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -H "Content-Type: application/json" \
  -d '{
  "external_reference": "BK-2026-223515",
  "quote_id": "quo_8Kc2VnQ4hT7xWm3B",
  "applicant_type": "student",
  "locale": "zh-CN",
  "tenant": {
    "first_name": "Yuxi",
    "last_name": "Zhang",
    "name_local": "张雨曦",
    "email": "yuxi.zhang@example.com",
    "phone": "+8613800139527",
    "date_of_birth": "2003-04-17",
    "nationality": "CN",
    "country_of_residence": "CN",
    "address": {
      "line1": "88 Century Avenue",
      "city": "Shanghai",
      "postal_code": "200120",
      "country": "CN"
    }
  },
  "study": {
    "university_id": "uni_ucl",
    "course": "MSc Data Science",
    "level": "postgraduate",
    "first_year": true
  },
  "property": {
    "name": "Gold Studio Plus",
    "line1": "Flat 218, Tower Building",
    "line2": "12 Example Street",
    "city": "London",
    "postcode": "E1 6LT",
    "country": "GB",
    "accommodation_type": "pbsa"
  },
  "tenancy": {
    "agreement_type": "licence",
    "rent": {
      "amount": 32500,
      "currency": "GBP",
      "period": "week"
    },
    "start_date": "2026-10-24",
    "end_date": "2027-07-10",
    "tenant_count": 1,
    "landlord": {
      "name": "Example Student Living Ltd",
      "email": "lettings@example-living.co.uk"
    }
  },
  "cosigner": {
    "first_name": "Wei",
    "last_name": "Zhang",
    "relationship": "parent",
    "email": "wei.zhang@example.com",
    "phone": "+8613900001234",
    "date_of_birth": "1974-09-02",
    "nationality": "CN",
    "country_of_residence": "CN",
    "address": {
      "line1": "88 Century Avenue",
      "city": "Shanghai",
      "postal_code": "200120",
      "country": "CN"
    },
    "locale": "zh-CN"
  },
  "documents": {
    "tenant_identity": {
      "type": "cn_resident_id",
      "front": "file_5pXr9LmA2dQe7NzK",
      "back": "file_Q2w8ErT6yU1iOp3L"
    },
    "proof_of_study": "file_Z7xC4vB9nM2aSd5F"
  },
  "fee": {
    "collection": "partner"
  },
  "consents": {
    "data_sharing": {
      "accepted_at": "2026-11-19T09:12:55Z",
      "ip_address": "203.0.113.24"
    }
  },
  "metadata": {
    "house_id": "13888",
    "unit_id": "223515"
  }
}'

Returns

Returns the application object.

Example response

{
  "id": "app_3Nf7QwR1tY8uLk5H",
  "object": "application",
  "livemode": false,
  "external_reference": "BK-2026-223515",
  "status": "incomplete",
  "applicant_type": "student",
  "locale": "zh-CN",
  "tenant": {
    "first_name": "Yuxi",
    "last_name": "Zhang",
    "email": "yuxi.zhang@example.com"
  },
  "fee": {
    "collection": "partner",
    "amount": {
      "amount": 50000,
      "currency": "GBP"
    },
    "status": "unpaid"
  },
  "requirements": [
    {
      "code": "tenant.identity",
      "party": "partner",
      "status": "blocked",
      "completable_via": [
        "api",
        "session"
      ]
    },
    {
      "code": "tenant.proof_of_study",
      "party": "tsg",
      "status": "in_review",
      "completable_via": [
        "api",
        "session"
      ]
    },
    {
      "code": "cosigner.identity",
      "party": "partner",
      "status": "due",
      "completable_via": [
        "api",
        "session"
      ]
    },
    {
      "code": "fee.payment",
      "party": "partner",
      "status": "due",
      "completable_via": [
        "api"
      ]
    },
    {
      "code": "tenant.signature",
      "party": "tenant",
      "status": "due",
      "completable_via": [
        "session"
      ]
    },
    {
      "code": "cosigner.signature",
      "party": "cosigner",
      "status": "blocked",
      "completable_via": [
        "email_link"
      ]
    },
    {
      "code": "landlord.confirmation",
      "party": "landlord",
      "status": "due",
      "completable_via": [
        "email_link"
      ]
    },
    {
      "code": "landlord.signature",
      "party": "landlord",
      "status": "blocked",
      "completable_via": [
        "email_link"
      ]
    }
  ],
  "guarantee": null,
  "created_at": "2026-11-19T09:16:03Z",
  "updated_at": "2026-11-19T09:16:03Z"
}

List applications

GET/applications

Returns a list of applications.

Parameters

NameInDescription
external_referencequeryReturn only the application with this reference.
statusqueryOne of incomplete, in_review, approved, declined, cancelled, expired.
created_afterqueryOnly applications created at or after this time.

Returns

Returns a list of application objects.

Retrieve an application

GET/applications/{application_id}

Retrieves an application.

Returns

Returns the application object.

Update an application

PATCH/applications/{application_id}

Updates an application by setting the values of the parameters passed. Parameters not provided are left unchanged.

You can update an application while its status is incomplete or in_review. tenancy, property, tenant and cosigner can't be updated after any party has signed, and tenancy and property can't be updated after the landlord has confirmed the tenancy details. To change them, cancel the application and create a new one. Updating a priced detail recalculates the fee, and isn't allowed after the fee is paid.

Request body

Nested objects take the same fields as in create.

Any subset of the fields accepted at creation, except external_reference, quote_id and consents.

FieldTypeDescription
localeenumOne of en, zh-CN.
tenantobject
studyobjectRequired when applicant_type is student.
propertyobject
tenancyobject
cosignerobjectThe cosigner's details.
documentsobject
metadataobject

Example request

curl https://api.thestudentguarantor.com/v1/applications/app_3Nf7QwR1tY8uLk5H \
  -X PATCH \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -H "Content-Type: application/json" \
  -d '{
  "documents": {
    "cosigner_identity": {
      "type": "cn_resident_id",
      "front": "file_A1s2D3f4G5h6J7k8",
      "back": "file_L9k8J7h6G5f4D3s2"
    }
  }
}'

Returns

Returns the application object. Returns an error if the application is approved, declined, cancelled or expired, or if the update isn't allowed in its current state.

Cancel an application

POST/applications/{application_id}/cancel

Cancels an application. You can cancel an application while its status is incomplete or in_review. Cancelling invalidates its sessions.

Request body

FieldTypeDescription
reasonenumOne of booking_cancelled, tenant_request, duplicate, other.
notestring

Example request

curl https://api.thestudentguarantor.com/v1/applications/app_3Nf7QwR1tY8uLk5H/cancel \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "booking_cancelled"
}'

Returns

Returns the application object with a status of cancelled. Returns an error if the application is already approved.

Confirm a fee you collected

POST/applications/{application_id}/fee/confirm

Confirms that you've collected the fee from the tenant. Satisfies the fee.payment requirement. The application's fee.collection must be partner. If the fee is no longer fee.amount, the request is rejected with 409 fee_changed and nothing is recorded.

Request body

FieldTypeDescription
amountrequiredobject
amount.amountrequiredintegerThe amount in the currency's smallest unit. 50000 is £500.00.
amount.currencyrequiredstringISO 4217 code. Fees are always GBP.
paid_atrequireddate-timeWhen the tenant's payment succeeded.
payment_referencerequiredstringYour order or transaction ID, shown on statements.
collectedobjectWhat you charged the tenant, if not in pounds sterling.
collected.amountrequiredintegerThe amount in the currency's smallest unit. 50000 is £500.00.
collected.currencyrequiredstringISO 4217 code. Fees are always GBP.

Example request

curl https://api.thestudentguarantor.com/v1/applications/app_3Nf7QwR1tY8uLk5H/fee/confirm \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": {
    "amount": 50000,
    "currency": "GBP"
  },
  "paid_at": "2026-11-19T09:21:44Z",
  "payment_reference": "ORD-99120045",
  "collected": {
    "amount": 462500,
    "currency": "CNY"
  }
}'

Returns

Returns the application object with a fee.status of paid. Returns an error if amount differs from fee.amount.

15.5Sessions

A session authenticates one tenant in the embedded component for one application.

POST   /applications/{application_id}/sessions

The session object

FieldTypeDescription
idstring
objectstringAlways session.
application_idstring
modeenumOne of embedded, redirect.
client_secretstringSecret used to mount the embedded component.
urluriThe hosted page for redirect mode.
expires_atdate-time

Create a session

POST/applications/{application_id}/sessions

Creates a session for an application. Sessions expire after 60 minutes. Creating a session invalidates the application's earlier sessions.

Request body

FieldTypeDescription
modeenumembedded: for the JavaScript component. redirect: the tenant is sent to url. Default embedded.
localeenumOverrides the application's locale for this session. One of en, zh-CN.
return_urluriWhere the tenant is sent when they finish or leave. Required for redirect. We append application_id and session_status (completed or exited).

Example request

curl https://api.thestudentguarantor.com/v1/applications/app_3Nf7QwR1tY8uLk5H/sessions \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "embedded",
  "locale": "zh-CN",
  "return_url": "https://www.example-platform.com/bookings/BK-2026-223515/guarantee"
}'

Returns

Returns the session object. Returns an error if no requirement can be completed in a session.

Example response

{
  "id": "sess_9Tg4HbN6mJ2kLp8Q",
  "object": "session",
  "application_id": "app_3Nf7QwR1tY8uLk5H",
  "mode": "embedded",
  "client_secret": "sess_9Tg4HbN6mJ2kLp8Q_secret_x7Vq2ZcR5tYw8Ub1",
  "url": "https://app.thestudentguarantor.com/embed/session#sess_9Tg4HbN6mJ2kLp8Q_secret_x7Vq2ZcR5tYw8Ub1",
  "expires_at": "2026-11-19T10:17:10Z"
}

15.6Guarantees

A guarantee is created when an application is approved.

GET    /guarantees
GET    /guarantees/{guarantee_id}
GET    /guarantees/{guarantee_id}/certificate
GET    /guarantees/{guarantee_id}/agreement
POST   /guarantees/{guarantee_id}/end

The guarantee object

FieldTypeDescription
idstring
objectstringAlways guarantee.
livemodeboolean
referencestringThe guarantee reference, in the form TSG-YYYY-XXXXXXXX.
statusenumactive: in force. ended: the cover period has finished or the guarantee was ended early. cancelled: ended before the tenancy started.
application_idstring
external_referencestring
tenantobject
tenant.first_namestring
tenant.last_namestring
propertyobject
property.line1string
property.line2string
property.citystring
property.postcodestring
property.countrystring
coverobject
cover.start_datedate
cover.end_datedate
cover.monthly_rent_shareobject
cover.monthly_rent_share.amountintegerThe amount in the currency's smallest unit. 50000 is £500.00.
cover.monthly_rent_share.currencystringISO 4217 code. Fees are always GBP.
refundobject or nullPresent after a guarantee is ended early or cancelled.
refund.amountobject
refund.amount.amountintegerThe amount in the currency's smallest unit. 50000 is £500.00.
refund.amount.currencystringISO 4217 code. Fees are always GBP.
refund.statusenumOne of pending, credited, paid.
verify_urluriPublic verification page for the guarantee.
metadataobject
issued_atdate-time
ended_atdate-time

List guarantees

GET/guarantees

Returns a list of guarantees.

Parameters

NameInDescription
statusqueryOne of active, ended, cancelled.
external_referencequery

Returns

Returns a list of guarantee objects.

Retrieve a guarantee

GET/guarantees/{guarantee_id}

Retrieves a guarantee.

Returns

Returns the guarantee object.

Example response

{
  "id": "gua_6Yh2JmK9pL4nB7vC",
  "object": "guarantee",
  "livemode": false,
  "reference": "TSG-2026-7KQ4M9XZ",
  "status": "active",
  "application_id": "app_3Nf7QwR1tY8uLk5H",
  "external_reference": "BK-2026-223515",
  "tenant": {
    "first_name": "Yuxi",
    "last_name": "Zhang"
  },
  "property": {
    "line1": "Flat 218, Tower Building",
    "line2": "12 Example Street",
    "city": "London",
    "postcode": "E1 6LT",
    "country": "GB"
  },
  "cover": {
    "start_date": "2026-10-24",
    "end_date": "2027-07-10",
    "monthly_rent_share": {
      "amount": 140800,
      "currency": "GBP"
    }
  },
  "verify_url": "https://app.thestudentguarantor.com/g/TSG-2026-7KQ4M9XZ",
  "issued_at": "2026-11-19T09:31:27Z"
}

Download the certificate

GET/guarantees/{guarantee_id}/certificate

Retrieves the Rent Guarantee Certificate as a PDF.

Returns

Returns the PDF with a content type of application/pdf.

Download the signed agreement

GET/guarantees/{guarantee_id}/agreement

Retrieves the signed guarantee agreement as a PDF.

Returns

Returns the PDF with a content type of application/pdf.

End a guarantee early

POST/guarantees/{guarantee_id}/end

Ends a guarantee before its cover.end_date. The refund is calculated and returned in refund with a status of pending until it's processed. Repeating the request with the same parameters returns the same guarantee.

Request body

FieldTypeDescription
end_daterequireddateThe last day of the tenancy.
reasonrequiredenumOne of booking_cancelled, tenancy_ended_early, tenant_request, other.
notestring

Example request

curl https://api.thestudentguarantor.com/v1/guarantees/gua_6Yh2JmK9pL4nB7vC/end \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Idempotency-Key: 6f1c2a9e-8f0b-4c59-9d0e-2b7a54d0c1aa" \
  -H "Content-Type: application/json" \
  -d '{
  "end_date": "2027-03-31",
  "reason": "tenancy_ended_early"
}'

Returns

Returns the guarantee object. If end_date is in the future, status stays active and cover.end_date is updated. Any refund is in refund.

15.7Webhooks

Webhook endpoints receive events. Events are also available from the API for 30 days.

POST   /webhook_endpoints
GET    /webhook_endpoints
DELETE /webhook_endpoints/{webhook_endpoint_id}
GET    /events

The webhook endpoint object

FieldTypeDescription
idstring
objectstringAlways webhook_endpoint.
urluri
eventsarray of enumOne of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended.
statusenumOne of enabled, disabled.
secretstringReturned only when the endpoint is created.
descriptionstring or null
created_atdate-time

The event object

FieldTypeDescription
idstring
objectstringAlways event.
typeenumOne of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended.
livemodeboolean
created_atdate-time
dataobject
data.objectobjectThe application or guarantee as it was when the event happened, in the same shape the API returns.

Create a webhook endpoint

POST/webhook_endpoints

Creates a webhook endpoint.

Request body

FieldTypeDescription
urlrequireduriMust be HTTPS on port 443.
eventsarray of enumThe event types to deliver. Omit to receive all of them. One of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended.
descriptionstring

Example request

curl https://api.thestudentguarantor.com/v1/webhook_endpoints \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://api.example-platform.com/hooks/tsg",
  "events": [
    "application.requirements_updated",
    "application.approved",
    "application.declined",
    "guarantee.issued"
  ]
}'

Returns

Returns the webhook endpoint object with its secret. The secret isn't returned again.

Example response

{
  "id": "whk_2Bv5NmQ8wE1rT4yU",
  "object": "webhook_endpoint",
  "url": "https://api.example-platform.com/hooks/tsg",
  "events": [
    "application.requirements_updated",
    "application.approved",
    "application.declined",
    "guarantee.issued"
  ],
  "status": "enabled",
  "secret": "whsec_Jx4mP9qLs2Vt7RzKc8Bn1WdY",
  "created_at": "2026-11-19T08:02:11Z"
}

List webhook endpoints

GET/webhook_endpoints

Returns a list of your webhook endpoints.

Returns

Returns a list of webhook endpoint objects.

Delete a webhook endpoint

DELETE/webhook_endpoints/{webhook_endpoint_id}

Deletes a webhook endpoint.

Returns

Returns an empty response.

List events

GET/events

Returns a list of events from the last 30 days.

Parameters

NameInDescription
typequeryOne of application.created, application.requirements_updated, application.in_review, application.approved, application.declined, application.cancelled, application.expired, fee.paid, fee.refunded, guarantee.issued, guarantee.updated, guarantee.ended.
created_afterquery

Returns

Returns a list of event objects.

15.8Sandbox

Endpoints available only in the sandbox.

POST   /test/applications/{application_id}/simulate

Simulate an outcome

POST/test/applications/{application_id}/simulate

Completes requirements or the review on a sandbox application.

Request body

FieldTypeDescription
actionrequiredenumtenant_completes_session satisfies every requirement whose party is tenant. cosigner_signs, landlord_confirms and landlord_signs satisfy the matching requirement. documents_accepted and documents_rejected settle requirements that are in_review. approve and decline settle an application that is in_review.

Example request

curl https://api.thestudentguarantor.com/v1/test/applications/app_3Nf7QwR1tY8uLk5H/simulate \
  -X POST \
  -H "Authorization: Bearer $TSG_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "tenant_completes_session"
}'

Returns

Returns the application object. Returns 404 in production.