The TestGorilla API connects your TestGorilla account to another ATS or HRIS tool. You can use it to retrieve assessments, invite candidates, and get test results. It's an HTTP-based API that follows the principles of REST, so you can call it with simple HTTP tools like curl. The API is available on the Plus and External Recruitment plans.
Approx. reading time: 11 minutes
In this article
- Available integrations
- TestGorilla API versions
- Authentication
- Assessments
- Inviting a candidate
- Candidates
- Test results
Available integrations
Before building your own integration, check whether TestGorilla already integrates with your ATS:
- BambooHR
- Breezy
- Buk
- Bullhorn
- Freshteam
- Greenhouse
- iCIMS
- JazzHR
- Lever
- Make.com
- Recruitee
- SmartRecruiters
- SuccessFactors
- Teamtailor
- Workable
- Workday
- Zapier
- Zoho Recruit
TestGorilla API versions
The latest TestGorilla API version is v1.3.
| Version | Date introduced | Available until |
|---|---|---|
| v1.3 | August 18, 2022 | No end date |
| v1.2 | February 19, 2022 | August 17, 2022 |
| v1.1 | November 10, 2021 | February 18, 2022 |
| v1.0 | September 23, 2021 | November 9, 2021 |
| v0.9 | April 27, 2021 | September 22, 2021 |
| v0.8 | January 1, 2021 | April 26, 2021 |
Authentication
Contact our Customer Success team to get your API token. Send it in the
Authorization
header of every request:
Authorization: Token <YOUR TOKEN GOES HERE>
Assessments
At TestGorilla, we distinguish assessments from tests. A candidate takes an assessment, which can include up to 5 tests and up to 20 custom questions, depending on your plan. You typically create one assessment per open position, and many candidates take the same assessment.
List of assessments
Use this endpoint to get the assessments in your TestGorilla account:
GET https://app.testgorilla.com/api/assessments/
Query parameters
| Parameter | Description |
|---|---|
status
|
Returns only the assessments with these statuses. Separate several values with commas. The possible values are:
Example:
Default: all statuses |
ordering
|
Sorts the list. The possible values are:
The order is ascending. Add a minus sign (-) before the value for descending order.
Example:
Default: no fixed order. Set
|
limit
|
The number of assessments per page. Default: 10 |
offset
|
The position of the first assessment to return. Use it with
Example:
Default: 0 |
Request
curl 'https://app.testgorilla.com/api/assessments/?status=active,inactive' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
{
"count": 27,
"next": "https://app.testgorilla.com/api/assessments/?limit=10&offset=10&status=active,inactive",
"previous": null,
"results": [
{
"id": 32,
"name": "Python developer",
"candidates": 42,
"invited": 13,
"started": 8,
"finished": 21,
"status": "active",
"finished_percentage": 50,
"modified": "2021-07-10T15:06:05.719971+00:00",
...
},
{...}
]
}
Assessment details
Use this endpoint to get the details of one assessment, including its public links:
GET https://app.testgorilla.com/api/assessments/<ASSESSMENT_ID>/
Request
curl 'https://app.testgorilla.com/api/assessments/<ASSESSMENT_ID>/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
{
"id": 32,
"name": "Python developer",
"candidates": 42,
"invited": 13,
"started": 8,
"finished": 21,
"status": "active",
"finished_percentage": 50,
"modified": "2021-07-10T15:06:05.719971+00:00",
"benchmark_name": "All candidates",
"public_links": [
{
"id": 32,
"label": "General public link",
"public_uuid": "<PUBLIC_LINK_UUID>",
"active": true,
"candidates_limit": 0,
"candidates_count": 0,
"invitation_link": "<PUBLIC_LINK_URL>",
"is_default_link": true,
...
}
],
...
}
Inviting a candidate
Once you've created an assessment, you can invite candidates to take it. Each candidate is identified by a unique test taker ID or by their email address. Candidates can take more than one assessment, but each assessment only once.
There are two ways to invite candidates:
- With a public link that anyone can use
- One by one, with their email address and, optionally, their first and last name
Tip: Candidates can start an assessment, leave, and come back later to finish it, using the same link they used the first time. This only works while the assessment is active.
Creating a public link for an assessment
Every assessment has a default public link that anyone can use to take it. To
get it, call the
Assessment details endpoint. Each
item in
public_links
includes the ready-to-share link in
invitation_link.
The default link has
is_default_link
set to
true.
Activating or deactivating a public link
Send
true
or
false
in the
active
attribute. While a link is deactivated, candidates can't open the assessment
with it.
PUT https://app.testgorilla.com/api/assessments/public_links/<PUBLIC_LINK_ID>/
Request
curl 'https://app.testgorilla.com/api/assessments/public_links/<PUBLIC_LINK_ID>/' \
-X PUT \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>' \
-H 'Content-Type: application/json' \
--data-raw '{"active": false, "label": "Main", "assessment": <ASSESSMENT_ID>}'
is the
id
of the link in
public_links.
Inviting a candidate using their email address
Send the candidate's email address, and optionally their first and last name, to this endpoint:
POST https://app.testgorilla.com/api/assessments/<ASSESSMENT_ID>/invite_candidate/
Note: First and last name are optional, but we recommend sending them.
Request
curl 'https://app.testgorilla.com/api/assessments/<ASSESSMENT_ID>/invite_candidate/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>' \
-H 'Content-Type: application/json' \
--data-raw '{"email": "john@example.com", "first_name": "John", "last_name": "Smith"}'
Response
{
"id": 8000,
"assessment": 99,
"email": "john@example.com",
"first_name": "John",
"last_name": "Smith",
"invitation_uuid": "d1bb9864-0515-4543-9bac-f26af0b13895",
"created": "2021-09-29T07:55:14.517886+00:00",
"testtaker_id": 9999,
"status": "invited"
}
Save the
id
(the candidature ID) and the
testtaker_id.
You need them to get the candidate's results later.
Getting a candidate's personal assessment link without sending an email
If candidates start the assessment from your own application, you can skip the invitation email and send them straight to their personal link. This takes two steps.
1. Invite the candidate without an email. Add
no_email=true
to the request to invite a candidate:
curl 'https://app.testgorilla.com/api/assessments/<ASSESSMENT_ID>/invite_candidate/?no_email=true' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>' \
-H 'Content-Type: application/json' \
--data-raw '{"email": "john@example.com", "first_name": "John", "last_name": "Smith"}'
{
"id": 8000,
"assessment": 32,
"email": "john@example.com",
"first_name": "John",
"last_name": "Smith",
"invitation_uuid": "d1bb9864-0515-4543-9bac-f26af0b13895",
...
"testtaker_id": 9999,
"status": "invited"
}
2. Build the link. Use the
invitation_uuid
from the same response:
https://assessment.testgorilla.com/testtaker/takeinvitation/<INVITATION_UUID>
Save the
testtaker_id
too, to get the candidate's results later.
Re-inviting a candidate
You can send the invitation again using the candidature ID (id).
You get it when you
invite the candidate, or from the
list of candidates invited to an assessment.
Request
curl -X POST 'https://app.testgorilla.com/api/assessments/candidature/<CANDIDATURE_ID>/send-invitation/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>' \
-H 'Content-Type: application/json' \
--data-raw '{}'
Candidates
List of candidates invited to an assessment
Use this endpoint to get the candidates invited to an assessment:
GET https://app.testgorilla.com/api/assessments/candidature/?assessment=<ASSESSMENT_ID>
Query parameters
| Parameter | Description |
|---|---|
assessment
|
The ID of the assessment. Required. |
status
|
Returns only the candidates with this status. The possible values are:
Default: all statuses |
stage
|
Returns only the candidates in this hiring stage. The possible values are:
Default: all stages |
ordering
|
Sorts the list. The possible values are:
The order is ascending. Add a minus sign (-) before the value for descending order.
Example:
Default: newest invitation first |
limit
|
The number of candidates per page. Default: 10. Maximum: 50 |
Pagination
To get the next page, call the URL in the
next
attribute of the response. On the last page,
next
is
null.
Don't build page URLs with an offset yourself: the list uses a cursor for most
sort orders and ignores the offset.
The response doesn't include the total number of candidates. To get it, use the following endpoint. It accepts the same filters as the list.
GET https://app.testgorilla.com/api/assessments/candidature/count/?assessment=<ASSESSMENT_ID>
{ "count": 42 }
Request
curl 'https://app.testgorilla.com/api/assessments/candidature/?assessment=<ASSESSMENT_ID>' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
{
"next": "https://app.testgorilla.com/api/assessments/candidature/?assessment=<ASSESSMENT_ID>&cursor=<CURSOR>",
"previous": null,
"results": [
{
"id": 8000,
"testtaker_id": 4276,
"email": "john@example.com",
"full_name": "John Smith",
"invitation_uuid": "edb70e44-271d-4e6a-8533-901fdc95f230",
"created": "2021-09-18T09:16:33.975663+02:00",
"date_completed": "2021-09-19T10:02:11.120411+02:00",
"status": "completed",
"stage": "HIR",
"average_without_benchmark": 76,
"average_with_weight": null,
"display_normalized_weighted_percentile_score": 81,
...
},
{...}
]
}
These are the fields you need to identify each candidate and read their overall score:
| Field | Description |
|---|---|
id
|
The candidature ID. Use it as
<CANDIDATURE_ID>
in the requests in this article.
|
testtaker_id
|
The test taker ID. Use it as
<TEST_TAKER_ID>
to get the candidate's results.
|
status
|
Where the candidate is in the assessment. See the
status
parameter above.
|
stage
|
The candidate's hiring stage. See the
stage
parameter above.
|
average_without_benchmark
|
The overall Raw score: the average percentage of correct answers across the candidate's scored tests, from 0 to 100. |
average_with_weight
|
The overall raw score with your test weights applied. Use it
instead of
average_without_benchmark
if you weight the tests in the assessment.
|
display_normalized_weighted_percentile_score
|
The overall Percentile, from 1 to 99.
null
when no percentile is available for the candidate.
|
For scores per test, use
Retrieving assessment results. Personality
results are also there, in the
score_display
attribute of each personality test.
Retrieving candidate details
This endpoint returns a candidate's name and email address, and the assessments
they were invited to, in
assessments_detail.
Get the
<TEST_TAKER_ID>
from the list of candidates.
Caution: Up to v0.8 of the API, this endpoint returned the results of every assessment the candidate ever took. Results are now in the results endpoint.
Request
curl 'https://app.testgorilla.com/api/assessments/candidates/<TEST_TAKER_ID>/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
{
"id": 4276,
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"assessments_detail": [
{
"id": 8000,
...
},
{...}
]
}
To get only one assessment in
assessments_detail,
add
?candidature=<CANDIDATURE_ID>
to the request.
Retrieving a candidate's anti-cheating flags
Get the
<TEST_TAKER_ID>
and
<CANDIDATURE_ID>
from the list of candidates, then call:
curl 'https://app.testgorilla.com/api/assessments/candidates/<TEST_TAKER_ID>/?candidature=<CANDIDATURE_ID>' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
These fields in
assessments_detail
hold the anti-cheating flags:
| Field | Description |
|---|---|
is_exited_full_screen
|
true
if the candidate left full-screen mode.
|
is_left_screen
|
true
if the mouse left the assessment screen.
|
is_camera_enabled
|
true
if the candidate's camera was on during the assessment.
|
Response
{
"id": <TEST_TAKER_ID>,
...
"assessments_detail": [
{
...
"is_exited_full_screen": false,
"is_left_screen": false,
"is_camera_enabled": false,
...
}
]
}
Deleting a candidate from an assessment
This endpoint removes a candidate from an assessment, for example to invite them to take it a second time.
curl -X DELETE 'https://app.testgorilla.com/api/assessments/candidature/<CANDIDATURE_ID>/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Setting a candidate's stage to Rejected
Get the
<CANDIDATURE_ID>
from the list of candidates, then send
the
REJ
stage:
Request
curl -X PATCH 'https://app.testgorilla.com/api/assessments/candidature/<CANDIDATURE_ID>/change_stage/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>' \
-H 'Content-Type: application/json' \
--data-raw '{"stage": "REJ"}'
Response
The response includes the new stage:
{
"id": <CANDIDATURE_ID>,
"stage": "REJ",
"reminder_sent": false
}
Sending a rejection email to a candidate
Get the
<CANDIDATURE_ID>
from the list of candidates, then call:
Important: Set the candidate's stage to Rejected (REJ)
first. See
Setting a candidate's stage to Rejected.
If the stage isn't Rejected, this endpoint sends the candidate a reminder
to complete the assessment instead.
Request
curl -X POST 'https://app.testgorilla.com/api/assessments/candidature/<CANDIDATURE_ID>/send-reminder/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Test results
Retrieving assessment results
Use this endpoint to get a candidate's results for each test in an assessment:
GET https://app.testgorilla.com/api/assessments/results/?candidature__assessment=<ASSESSMENT_ID>&candidature__test_taker=<TEST_TAKER_ID>
Query parameters
| Parameter | Description |
|---|---|
candidature__assessment
|
The assessment ID. Required. |
candidature__test_taker
|
The test taker ID. Required. |
Request
curl 'https://app.testgorilla.com/api/assessments/results/?candidature__assessment=<ASSESSMENT_ID>&candidature__test_taker=<TEST_TAKER_ID>' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 234567,
"name": "Problem solving",
"test_id": 7244,
"algorithm": "basic",
"completed": true,
"scored": true,
"raw_score": 85,
"display_normalized_percentile_score": 72,
"score": 68,
"score_display": "",
...
},
{
"id": 123456,
"name": "Big 5 (OCEAN)",
"test_id": 494,
"algorithm": "big_5",
"completed": true,
"scored": true,
"raw_score": null,
"display_normalized_percentile_score": null,
"score": null,
"score_display": "2-1-1-2-1_32.0-34.0-33.0-35.0-32.0",
...
}
]
}
The response includes more fields than the ones below. These are the ones you need to read a candidate's results for each test:
| Field | Description |
|---|---|
id
|
The test result ID. Use it as
<TEST_RESULT_ID>
in the coding test
requests.
|
name
|
The name of the test. |
algorithm
|
How the test is scored. See Result types. |
completed
|
true
when the candidate has finished the test.
|
scored
|
true
when the score is final. Scores can be
null
until then.
|
raw_score
|
The Raw score shown on the candidate's results
page: the percentage of correct answers, from 0 to 100.
null
for tests that don't have a raw score, such as personality tests.
|
display_normalized_percentile_score
|
The Percentile shown on the candidate's results
page, from 1 to 99. A percentile of 72 means the candidate scored
higher than 72% of the candidates who took the same test.
null
when the test has no percentile.
|
score_display
|
The result of personality and culture add tests. See Personality tests. |
score
|
Kept for existing integrations. If the assessment uses a comparison
group, it holds an older percentile calculation that doesn't
match the percentile in the app; otherwise it equals
raw_score.
For new integrations, use
raw_score
and
display_normalized_percentile_score
instead.
|
The API always returns both the raw score and the percentile, whichever scoring method you choose to display in TestGorilla.
Retrieving assessment results in PDF
Get the candidate from the list of candidates, then use these fields from the response in the request below:
| Field in the list | Value in the request |
|---|---|
testtaker_id
|
<TEST_TAKER_ID>
|
id
|
<CANDIDATURE_ID>
|
The
candidature
parameter is required. PDF reports must be included in your plan.
Request
curl 'https://app.testgorilla.com/api/assessments/candidates/<TEST_TAKER_ID>/render_pdf/?candidature=<CANDIDATURE_ID>' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Result types
How a test result is represented depends on the algorithm used to score the test. The table below lists the algorithms, the attributes that hold the result, and where to learn how to read it.
| Test type | Algorithm | Result attributes |
|---|---|---|
|
Basic Guide to analyzing results |
basic
|
raw_scoredisplay_normalized_percentile_score
|
|
Custom questions Using custom questions |
custom_questions
|
raw_score
|
|
Personality Interpreting personality tests |
enneagramdisc16_typesbig_5
|
score_display
|
|
Culture add Using the culture add test |
culture_fit
|
score_display
|
Basic tests
Basic tests are those where
algorithm
is
basic.
The raw score (percentage of correct answers) is in the
raw_score
attribute, and the percentile in the
display_normalized_percentile_score
attribute.
Custom questions
Custom questions are returned as an extra test, where
algorithm
is
custom_questions.
The score is in the
raw_score
attribute.
Personality tests
Personality test results are in the
score_display
attribute. Its format depends on the test.
Big 5 (OCEAN)
Results where
algorithm
is
big_5.
score_display
holds two sections separated by an underscore (_), with five values each, separated
by dashes (-):
- Section 1: the calibrated score, from 1 (very low) to 5 (very high)
- Section 2: the original, unprocessed score, as decimal values
The five values are the five factors, in this order: Extroversion, Agreeableness, Conscientiousness, Emotional stability, and Openness to experience.
Example:
2-1-1-2-1_30.0-29.0-33.0-26.0-31.0
-
Section 1:
2-1-1-2-1 -
Section 2:
30.0-29.0-33.0-26.0-31.0
In TestGorilla, this result looks like this:
Enneagram
Results where
algorithm
is
enneagram.
score_display
is one of: Improver, Giver, Go-getter, Contemplator, Pioneer, The Devoted, Cheerleader,
Master, Agreeable, or No results.
No results has no description: looking it up with the personality description endpoint returns an HTTP 404 response.
DISC
Results where
algorithm
is
disc.
score_display
is one of:
d,
i,
s,
c,
di,
is,
sc,
cd,
id,
si,
cs,
dc.
16 types
Results where
algorithm
is
16_types.
score_display
holds the dominant letter on each of the 4 scales (E-I, S-N, T-F, and J-P), so
it's one of:
ESTJ,
ENTJ,
ISTJ,
INTJ,
ESTP,
ENTP,
ISTP,
INTP,
ESFJ,
ENFJ,
ISFJ,
INFJ,
ESFP,
ENFP,
ISFP,
INFP.
Personality description endpoint
To show what a personality result means, call this endpoint with the algorithm and the result value. It returns the description as HTML.
GET https://app.testgorilla.com/api/tests/personality/<ALGORITHM>/<SCORE>/
For example, to get the description of INTJ (The Intellectual) for the 16 types
test, use the algorithm
16_types
and the value
INTJ:
Request
curl 'https://app.testgorilla.com/api/tests/personality/16_types/INTJ/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
{
"personality": "<h2>INTJ – The Intellectual</h2>\n<h3>Description</h3>\n<p>INTJs are systematic, analytical, and intuitive thinkers. ...</p>"
}
Coding tests
Both requests below need the
<TEST_RESULT_ID>
of the coding test. It's the
id
of the coding test in
Retrieving assessment results.
Retrieving the time used on a coding test
Request
curl 'https://app.testgorilla.com/api/assessments/results/<TEST_RESULT_ID>/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
The response includes the time allowed (duration)
and the time the candidate used (response_time),
both in seconds.
{
"skill_areas_score": [],
"duration": 1800.0,
"response_time": 739,
...
}
Retrieving the URL to a coding test report
Request
curl 'https://app.testgorilla.com/api/assessments/code_questions/<TEST_RESULT_ID>/invitation_token/' \
-H 'Authorization: Token <YOUR TOKEN GOES HERE>'
Response
{
"invitation_uuid": "<CODE_REPORT_UUID>"
}
Use the UUID to build the link to the report:
https://app.testgorilla.com/customer/candidates/code-report/<CODE_REPORT_UUID>
Note: With these endpoints, you can manage your candidates from your own system. To create assessments and write custom questions, use TestGorilla directly.