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
Content-Type: application/json
Attributes (object)
| Attribute | Type | Description |
name | string, required | The name of the company in your platform. |
email_domains | array, required | List of email domains for whitelisting. |
client_id | string, required | Your OAuth Client ID. |
client_secret | string, required | Your OAuth Client Secret. |
process_unusual_activity | boolean, optional | Enable 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
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
Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json
Attributes (object)
| Attribute | Type | Description |
email_domains | array, required | A 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
Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json
Attributes (object)
| Attribute | Type | Description |
email_domains | required, array | A 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
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