Skip to content

Company

A company of the Xref platform is identified by a unique number.

Register Company

Method POST
Path /company

This endpoint registers a company under your platform. You will need to have a OAuth Partner credentials (Client ID and Client Secret) to be able to register a Company. This will also create an OAuth Client for the new company.

Request

Headers

Content-Type: application/json

Attributes (object)

AttributeTypeDescription
namestring, requiredThe name of the company in your platform.
email_domainsarray, requiredList of email domains for whitelisting.
client_idstring, requiredYour OAuth Client ID.
client_secretstring, requiredYour OAuth Client Secret.
process_unusual_activityboolean, optionalEnable unusual activity.

Body

{
    "name": "Company X",
    "email_domains": ["test.com", "test.com.au"],
    "client_id": "ae8abf05285abd",
    "client_secret": "U8fGHTsVf1mmxuhpJNmSujxzkyTf5VJWYI",
    "process_unusual_activity": "true"
}

Response

201 — application/json

{
"client_authorization_code": "ae8abf05285abd"
}

400

{
"detail": "Validation error",
"message": {
    "name": [
        "This field is required.",
        "This field may not be blank."
    ],
    "email_domains": [
        "This field is required.",
        "This field may not be blank."
    ],
    "client_id": [
        "This field is required.",
        "This field may not be blank."
    ],
    "client_secret": [
        "This field is required.",
        "This field may not be blank."
    ]
}
}

403

Company Domain Operations

Get list of company domains

Method GET
Path /company/domains

This endpoint will return a list of company domains. The endpoint returns a status code 200 with the list of domains available for the company.

Request

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

Response

200 — application/json
{
"data": {
    "email_domains": ["xref.com", "xref.com.au", "xref.global", "xref12as.com"]
}
}

Add a list of domains to an existing company

Method PUT
Path /company/domains

This endpoint will append a list of company domains to an existing company. The endpoint returns a status code 200 response with a message if the domain already exists .

Request

Headers
Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json
Attributes (object)
AttributeTypeDescription
email_domainsarray, requiredA list of company email domains.
Body
{
"email_domains": ["xref.com.eu", "xref.com.au"]
}

Response

200 — application/json
{
   "detail": "Domains have been added successfully"
}

Delete list of domains

Method DELETE
Path /company/domains

This endpoint will delete a list of company domains of an existing company. The endpoint returns a status code 200 response if a domain deleted successfully.

Request

Headers
Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json
Attributes (object)
AttributeTypeDescription
email_domainsrequired, arrayA list of company email domains.
Body
{
"email_domains": ["xref.com.eu", "xref.com.au"]
}

Response

200 — application/json
{
   "detail": "Domains mentioned in the request body deleted successfully"
}

List Hiring Accounts

List Hiring Accounts

Method GET
Path /company/hiring-accounts

This endpoint returns a list of active hiring accounts for your company.

Request

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

Response

200 — application/json
[
{
    "id": 1,
    "name": "HiringAccount1"
},
{
    "id": 2,
    "name": "HiringAccount2"
}
]
401 — application/json
{
"detail": "Authentication credentials were not provided."
}
403