Skip to content

Employers

Alternatively, another set of endpoints exist to interact with Users via email address as well as create them.

Employer Operations

List Employers

Method GET
Path /employers

This endpoint returns a list of employers associated with your company.

Request

Headers
Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json

Response

200 — application/json
[
{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@email.com",
},
{
    "first_name": "Joe",
    "last_name": "Bloggs",
    "email": "joe@example.com",
}
]
401 — application/json
{
"detail": "Authentication credentials were not provided."
}
403

Create an Employer

Method POST
Path /employers

This endpoint allows you to create an employer under your company. The API returns 200 if the employer already exists (as though you made a GET call), a 201 if an employer was created, or a 400 if the request was somehow invalid.

Request

Headers

Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json

Attributes (object)

AttributeTypeDescription
first_namestring, optionalUser's first name.
last_namestring, optionalUser's last name.
emailstring, requiredUser's email address.

Body

{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@email.com"
}

Response

200 — application/json

Attributes (object)
AttributeTypeDescription
first_namestringUser's first name.
last_namestringUser's last name.
emailstringUser's email address.
Body
{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@email.com"
}

201 — application/json

Attributes (object)
AttributeTypeDescription
first_namestringUser's first name.
last_namestringUser's last name.
emailstringUser's email address.
Body
{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@email.com"
}

400 — application/json

{
"email": ["ERROR_INVALID"]
}

401 — application/json

{
"detail": "Authentication credentials were not provided."
}

Retrieve an Employer

Method GET
Path /employers/{email}

This endpoint requires a specific Employer email address, and returns information such as the employer's first name, last name and email address. The API returns a 404 error if the specified employer is not found, and a 403 error if the requesting employer does not have the permissions required to view the employer's details.

Request

Headers

Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json

Parameters

Name Example / default Required Type Description
email 'example@xref.com' Yes string An email address.

Response

200 — application/json

Attributes (object)
AttributeTypeDescription
first_namestringUser's first name.
last_namestringUser's last name.
emailstringUser's email address.
Body
{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@email.com"
}

401 — application/json

{
"detail": "Authentication credentials were not provided."
}

403