Company Provisioning
AvailableThese endpoints allow you to provision new company accounts (recruiter access) and deactivate company access.
1. Provision Company
Registers or updates a company and its list of associated recruiters.
HTTP Request [POST]
https://parceiros.empregos.com.br/api/company/provision
- cURL
- C#
curl -X 'POST' \
'https://parceiros.empregos.com.br/api/company/provision' \
-H 'Content-Type: application/json' \
-H 'Authorization: bearer any' \
-d '{
"externalCompanyId": "E1",
"companyName": "Empregos.com.br",
"nationalRegister": "12345678000199",
"productId": 10,
"recruiter": [
{
"externalRecruiterId": "R1",
"email": "recrutador@empregos.com.br",
"recruiterName": "José Silva"
}
]
}'
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
private const string ApiUrl = "https://parceiros.empregos.com.br/api/company/provision";
static async Task Main(string[] args)
{
using (HttpClient httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", "any");
var payload = new
{
externalCompanyId = "E1",
companyName = "Empregos.com.br",
nationalRegister = "12345678000199",
productId = 10,
recruiter = new[]
{
new
{
externalRecruiterId = "R1",
email = "recrutador@empregos.com.br",
recruiterName = "José Silva"
}
}
};
var json = JsonConvert.SerializeObject(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PostAsync(ApiUrl, content);
string result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
}
Parameters [Request]
| Field | Description | Type | Required |
|---|---|---|---|
| externalCompanyId | Unique identifier of the company in the partner system. Max 50 chars. | String | Yes |
| companyName | Company name. Max 100 chars. | String | Yes |
| nationalRegister | National registration ID (CNPJ). Max 20 chars. | String | Yes |
| productId | Product/Plan Code ID. Can be null. | Int | No |
| recruiter | List of recruiters to provision. | Array | Yes |
| recruiter.externalRecruiterId | Unique identifier of the recruiter. Max 50 chars. | String | Yes |
| recruiter.email | Email of the recruiter. Max 255 chars. | String | Yes |
| recruiter.recruiterName | Name of the recruiter. Max 200 chars. | String | Yes |
Responses
- 200 OK: The request was processed. Returns one report item per recruiter in the request. A 200 does not mean every recruiter was provisioned: check
statuson each item.{
"report": [
{
"externalRecruiterId": "R1",
"status": "PROVISIONED",
"redirectUrl": "https://b2b.empregos.com.br/empresa/cadastro/comecar-cadastro?email=recrutador%40empregos.com.br"
},
{
"externalRecruiterId": "R2",
"status": "ERROR",
"redirectUrl": "https://b2b.empregos.com.br/empresa/cadastro/comecar-cadastro?email=outro%40empregos.com.br",
"error": "Email is already registered with different details."
}
]
} - 400 BadRequest: Invalid payload or a failure in the provisioning. A payload that breaks a validation (missing required field, a value over its maximum length, an invalid
recruiter.email) is rejected with the standard validation response, which lists the errors by field. A failure during provisioning, such as no default product configured for the partner whenproductIdis not sent, returns:{
"success": false,
"message": "Default product not found for partner."
} - 401 Unauthorized: missing or invalid bearer token. See Security.
- 500 InternalServerError: unexpected error. Same body format as the 400 above.
| Response field | Description | Type |
|---|---|---|
| report | One item per recruiter received in the request. | Array |
| report.externalRecruiterId | The recruiter identifier sent in the request. | String |
| report.status | PROVISIONED when the recruiter access was created or updated; ERROR otherwise. | String |
| report.redirectUrl | Link to the Empregos B2B sign-up, with the recruiter e-mail pre-filled (URL-encoded in email). The recruiter follows it to finish the registration. | String |
| report.error | Reason of the failure. Present only when status is ERROR. | String |
2. Deactivate Company Access
Deactivates access for all recruiters associated with the specified company and cancels their active plan.
HTTP Request [DELETE]
https://parceiros.empregos.com.br/api/company/provision
- cURL
- C#
curl -X 'DELETE' \
'https://parceiros.empregos.com.br/api/company/provision' \
-H 'Content-Type: application/json' \
-H 'Authorization: bearer any' \
-d '{
"externalCompanyId": "E1",
"companyName": "Empregos.com.br",
"nationalRegister": "12345678000199",
"productId": 10,
"recruiter": []
}'
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
private const string ApiUrl = "https://parceiros.empregos.com.br/api/company/provision";
static async Task Main(string[] args)
{
using (HttpClient httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", "any");
var payload = new
{
externalCompanyId = "E1",
companyName = "Empregos.com.br",
nationalRegister = "12345678000199"
};
var request = new HttpRequestMessage(HttpMethod.Delete, ApiUrl)
{
Content = new StringContent(JsonConvert.SerializeObject(payload), Encoding.UTF8, "application/json")
};
var response = await httpClient.SendAsync(request);
string result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
}
Parameters [Request]
The body has the same format as the provisioning request, and the same validations apply. Only externalCompanyId is used to find the company to deactivate, but companyName and nationalRegister are still required. recruiter and productId are ignored, and recruiter can be an empty array or omitted.
| Field | Description | Type | Required |
|---|---|---|---|
| externalCompanyId | Unique identifier of the company in the partner system. Max 50 chars. It identifies the company to deactivate. | String | Yes |
| companyName | Company name. Max 100 chars. Not used to find the company. | String | Yes |
| nationalRegister | National registration ID (CNPJ). Max 20 chars. Not used to find the company. | String | Yes |
| productId | Ignored. | Int | No |
| recruiter | Ignored. Can be an empty array. | Array | No |
Responses
- 200 OK: Request processed.
successistrueandmessagereports how many access records were updated and the result of the integration that cancels the plan.{
"success": true,
"message": "Company access deactivated successfully. Rows affected: 2. Integration: success."
}Integrationissuccess,failed, orskipped (Company/Plan Code not found). A 200 does not guarantee the plan was cancelled: checkIntegrationin the message. - 400 BadRequest: Invalid payload (rejected with the standard validation response, which lists the errors by field), or a failure while deactivating, which returns:
{
"success": false,
"message": "Invalid partner code. It must be an integer."
} - 401 Unauthorized: missing or invalid bearer token. See Security.
- 500 InternalServerError: unexpected error. Same body format as the 400 above.
| Response field | Description | Type |
|---|---|---|
| success | true when the request was processed. | Boolean |
| message | Result message (in English). | String |