# Create Bgv

> Source: https://truto.one/docs/api-reference/unified-hris-api/bgv/create/

`POST /unified/hris/bgv`

Resource: **Bgv** · API: **Unified HRIS API**

## Supported integrations

SpringVerify India (partial), SpringVerify US (partial)

## Query parameters

- **`integrated_account_id`** _(string, required)_
  The ID of the integrated account to use for the request.
- **`truto_response_format`** _(string)_
  The format of the response. - `unified` returns the response with unified mappings applied. - `raw` returns the unprocessed, raw response from the remote API. - `normalized` applies the unified mappings and returns the data in a normalized format. - `stream` returns the response as a stream, which is ideal for transmitting large datasets, files, or binary data. Using streaming mode helps to efficiently handle large payloads or real-time data flows without requiring the entire data to be buffered in memory. - `debug` returns the final unified result alongside raw remote fetch information. The response is an envelope containing `result` (identical to unified mode output) and `debug` (with `requestUrl`, `requestOptions`, `data`, `responseHeaders`, and for list operations: `nextCursor`, `isLooping`, `isEmptyResult`, `resultCount`). `debug` is `null` for static responses or when `truto_skip_api_call=true`. Defaults to `unified`.
  Allowed: `unified`, `raw`, `normalized`, `stream`, `debug`
- **`truto_ignore_remote_data`** _(boolean)_
  Excludes the `remote_data` attribute from the response.
- **`truto_exclude_fields`** _(array<string>)_
  Array of fields to exclude from the response.
- **`remote_query`** _(object)_
  Query parameters to pass to the underlying API without any transformations. Refer [this guide](https://truto.one/docs/api-reference/overview/querying#remote-query-parameters) to see how to structure the query parameters.

## Request body

- **`candidate`** _(object)_
  The BGV's candidate
  - **`id`** _(string)_
    The candidate's unique identifier
  - **`first_name`** _(string)_
    The candidate's first name
  - **`middle_name`** _(string)_
    The candidate's middle name
  - **`last_name`** _(string)_
    The candidate's last name
  - **`name`** _(string, required)_
    The candidate's full name
  - **`emails`** _(array<object>, required)_
    The candidate's email addresses
    - **`email`** _(string, required)_
      The email address
    - **`type`** _(string)_
      The type of email address
    - **`is_primary`** _(boolean)_
      Whether the email address is primary
  - **`phones`** _(array<object>)_
    The candidate's phone numbers
    - **`number`** _(string)_
      The phone number
    - **`extension`** _(string)_
      The extension of the phone number
    - **`type`** _(string)_
      The type of phone number
  - **`gender`** _(string)_
    The candidate's gender
    Allowed: `male`, `female`, `non_binary`, `not_specified`, `prefer_not_to_say`, `other`
  - **`date_of_birth`** _(string)_
    The candidate's date of birth
  - **`address`** _(object)_
    The candidate's address
    - **`street_1`** _(string)_
      The first line of the street address
    - **`street_2`** _(string)_
      The second line of the street address
    - **`city`** _(string)_
      The city
    - **`state`** _(string)_
      The state
    - **`postal_code`** _(string)_
      The postal code
    - **`country`** _(string)_
      The country
  - **`employee_number`** _(string)_
    The candidate's employee number
  - **`invite`** _(boolean)_
    Whether to invite the candidate
  - **`ssn`** _(string)_
- **`package`** _(object)_
  The BGV's package
  - **`id`** _(string, required)_
    The BGV package's unique identifier
  - **`name`** _(string)_
    The BGV package's name
  - **`package_group`** _(object, required)_
    The package's package group
    - **`id`** _(string, required)_
      The package group's unique identifier
    - **`name`** _(string)_
      The package group's name
  - **`checks`** _(object)_
- **`documents`** _(array<object>)_
  The BGV's documents. A document with type 'resume' and a URL is required.
  - **`id`** _(string)_
    The document's unique identifier
  - **`type`** _(string)_
    The document's type
  - **`name`** _(string)_
    The document's name
  - **`url`** _(string, required)_
    The document's URL
  - **`uploaded_at`** _(string)_
    The date and time of the document's upload
- **`send_invite`** _(boolean)_
  Whether to invite the candidate. Overridden by candidate.invite if both are provided.
- **`consent_url`** _(string)_
- **`verifications`** _(object)_
- **`remote_data`** _(object)_
  Any additional data that should be passed as part of the request body. This data is not transformed by Truto and is passed as is to the remote API.

## Response body

- **`id`** _(string, required)_
  The BGV's unique identifier
- **`candidate`** _(object)_
  The BGV's candidate
  - **`id`** _(string)_
    The candidate's unique identifier
  - **`first_name`** _(string)_
    The candidate's first name
  - **`middle_name`** _(string)_
    The candidate's middle name
  - **`last_name`** _(string)_
    The candidate's last name
  - **`name`** _(string)_
    The candidate's full name
  - **`emails`** _(array<object>)_
    The candidate's email addresses
    - **`email`** _(string)_
      The email address
    - **`type`** _(string)_
      The type of email address
    - **`is_primary`** _(boolean)_
      Whether the email address is primary
  - **`phones`** _(array<object>)_
    The candidate's phone numbers
    - **`number`** _(string)_
      The phone number
    - **`extension`** _(string)_
      The extension of the phone number
    - **`type`** _(string)_
      The type of phone number
  - **`gender`** _(string)_
    The candidate's gender
    Allowed: `male`, `female`, `non_binary`, `not_specified`, `prefer_not_to_say`, `other`
  - **`date_of_birth`** _(string)_
    The candidate's date of birth
  - **`address`** _(object)_
    The candidate's address
    - **`street_1`** _(string)_
      The first line of the street address
    - **`street_2`** _(string)_
      The second line of the street address
    - **`city`** _(string)_
      The city
    - **`state`** _(string)_
      The state
    - **`postal_code`** _(string)_
      The postal code
    - **`country`** _(string)_
      The country
  - **`employee_number`** _(string)_
    The candidate's employee number
- **`employee`** _(object)_
  The employee associated with the background verification
  - **`id`** _(string)_
    The employee's unique identifier
  - **`name`** _(string)_
    The employee's name
- **`package`** _(object)_
  The BGV's package
  - **`id`** _(string)_
    The package's unique identifier
  - **`name`** _(string)_
    The package's name
  - **`package_group`** _(object)_
    The package's package group
    - **`id`** _(string)_
      The package group's unique identifier
    - **`name`** _(string)_
      The package group's name
- **`status`** _(string)_
  The BGV's status
  Allowed: `draft`, `invited`, `pending_candidate`, `in_progress`, `insufficient`, `completed`, `canceled`, `expired`, `failed`, `unknown`
- **`result`** _(string)_
  The BGV's result
  Allowed: `clear`, `consider`, `discrepant`, `verified`, `unable_to_verify`, `not_applicable`, `unknown`
- **`checks`** _(array<object>)_
  The BGV's checks
  - **`id`** _(string)_
    The check's unique identifier
  - **`name`** _(string)_
    The check's name
  - **`type`** _(string)_
    The check's type
  - **`status`** _(string)_
    The check's status
  - **`result`** _(string)_
    The check's result
  - **`details`** _(string)_
    The check's details
- **`documents`** _(array<object>)_
  The BGV's documents
  - **`id`** _(string)_
    The document's unique identifier
  - **`type`** _(string)_
    The document's type
  - **`name`** _(string)_
    The document's name
  - **`url`** _(string)_
    The document's URL
  - **`uploaded_at`** _(string)_
    The date and time of the document's upload
- **`report`** _(object)_
  The BGV's report
  - **`expires_at`** _(string)_
    The date and time of the report's expiry
  - **`mime_type`** _(string)_
    The report's MIME type
- **`urls`** _(array<object>)_
  The BGV's URLs
  - **`url`** _(string)_
    The URL
  - **`type`** _(string)_
    The URL type
    Allowed: `invitation`, `consent`, `candidate_portal`, `report`
- **`requested_at`** _(string)_
  The date and time of the BGV's request
- **`submitted_at`** _(string)_
  The date and time of the candidate's submission
- **`completed_at`** _(string)_
  The date and time of the BGV's completion
- **`expires_at`** _(string)_
  The date and time of the BGV's expiry
- **`created_at`** _(string)_
  The date and time of the BGV's creation
- **`updated_at`** _(string)_
  The date and time of the BGV's last update
- **`etag`** _(string)_
  The unique identifier for the specific version of the resource
- **`remote_data`** _(object)_
  Raw data returned from the remote API call.

## Code examples

### Truto CLI

```bash
truto unified hris bgv \
  -m create \
  -a '<integrated_account_id>' \
  -b '{
  "candidate": {},
  "package": {},
  "documents": [],
  "send_invite": true,
  "consent_url": "your_consent_url",
  "verifications": {},
  "remote_data": {}
}' \
  -o json
```

### Truto TS SDK

```typescript
import Truto from '@truto/truto-ts-sdk';

const truto = new Truto({
  token: '<your_api_token>',
});

const result = await truto.unifiedApi.create(
  'hris',
  'bgv',
  {
  "candidate": {},
  "package": {},
  "documents": [],
  "send_invite": true,
  "consent_url": "your_consent_url",
  "verifications": {},
  "remote_data": {}
},
  { integrated_account_id: '<integrated_account_id>' }
);

console.log(result);
```

### Truto Python SDK

```python
import asyncio
from truto_python_sdk import TrutoApi

truto_api = TrutoApi(token="<your_api_token>")

async def main():
    result = await truto_api.unified_api.create(
        "hris",
        "bgv",
        {
        "candidate": {},
        "package": {},
        "documents": [],
        "send_invite": True,
        "consent_url": "your_consent_url",
        "verifications": {},
        "remote_data": {}
},
        {"integrated_account_id": "<integrated_account_id>"}
    )
    print(result)

asyncio.run(main())
```

### curl

```bash
curl -X POST 'https://api.truto.one/unified/hris/bgv?integrated_account_id=<integrated_account_id>' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "candidate": {},
  "package": {},
  "documents": [],
  "send_invite": true,
  "consent_url": "your_consent_url",
  "verifications": {},
  "remote_data": {}
}'
```

### JavaScript

```javascript
const integratedAccountId = '<integrated_account_id>';

const body = {
  "candidate": {},
  "package": {},
  "documents": [],
  "send_invite": true,
  "consent_url": "your_consent_url",
  "verifications": {},
  "remote_data": {}
};

const response = await fetch(`https://api.truto.one/unified/hris/bgv?integrated_account_id=${integratedAccountId}`, {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/unified/hris/bgv"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
    "integrated_account_id": "<integrated_account_id>"
}
payload = {
    "candidate": {},
    "package": {},
    "documents": [],
    "send_invite": True,
    "consent_url": "your_consent_url",
    "verifications": {},
    "remote_data": {}
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())
```
