> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talview.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Standard Schedule Integration Flow

To schedule a interview in Talview Workflow Tools (WFT) application,please follow the below steps.

### Prerequisites

1. An workflow with Technical Round needs to be pre configured.

## Interview Schedule Technical Steps

### 1. Authentication

* Use this [guide](../Authentication) to generate an **`access_token`**.
* The token generated will go in `Authorization` header for all API calls.

### 2. Schedule API

Every invitation send to Talview System, must follow below the payload structure.

**Request header definition:**

| Method       | POST                                               |
| :----------- | :------------------------------------------------- |
| **Host**     | [https://api.talview.com](https://api.talview.com) |
| Route        | /api/rest/external/workflow/schedule               |
| Content type | application/json                                   |

**Request payload definition: Standard**

| Attribute                     | Mandatory | Data Type       | Description                                                                                                                                |
| :---------------------------- | :-------- | :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
| organizer\_email              | yes       | String          | Organizer of interview email address                                                                                                       |
| interviewers                  | yes       | Array of String | Array of emails of the interviewers                                                                                                        |
| candidate\_email              | yes       | String          | Candidate's email address                                                                                                                  |
| candidate\_reference\_id      | yes       | String          | Candidate's ID in External System                                                                                                          |
| timezone                      | no        | String          | The timezone to be used for the schedule                                                                                                   |
| candidate\_name               | no        | String          | Candidate's name (first + last ) name                                                                                                      |
| start\_time                   | yes       | timestampz      | Start time of the interview. ISO 8601 format: yyyy-MM-dd'T'HH:mm:ss.SSSZ                                                                   |
| status                        | yes       | String          | Status to manage schedule: Possible values:  1. SCHEDULE 2. CANCEL 3. UPDATE                                                               |
| callback\_url                 | yes       | String          | Url of External Service to be used for sending the reports,scores,playbacy video,etc..                                                     |
| duration                      | yes       | Number          | Duration of interview in minutes Possible values: 30 \| 45 \| 60 \| 90 \| 120, default: 30                                                 |
| meeting\_id                   | no        | Number          | Meeting\_id in Talview System <br />(*Used when doing CANCEL/UPDATE actions)*                                                              |
| workflow\_step\_id            | yes       | String          | Talview Workflow ID                                                                                                                        |
| workflow\_step\_reference\_id | no        | String          | WorkflowStep ID from external client system<br />( *Note : Need to send either workflow\_reference\_id or workflow\_step\_reference\_id )* |

**Sample response payload:**

1. Success response: HTTP status code - 201

   ```json theme={null}
   {
     "meeting_id": 1293,
     "candidate": { "external_id": 2932, "email": "abc@xyz.com" },
     "meeting_status" : "SCHEDULED"
   }

   ```
2. Error response: HTTP status code - 422

   ```json theme={null}
   {
   	"errors": [{
   		"field": "start_time",
   		"message": "Start time cannot be in the past"
   	}]
   }

   ```
3. Error response: HTTP status code - 400

   ```json theme={null}
   {
   	"errors": [{
   		"field": "start_time",
   		"message": "Start time cannot be blank"
   	}]
   }
   ```

**Sample CURL request:**

```bash theme={null}
curl --request POST \
  --url https://api.talview.com/api/rest/external/workflow/schedule \
  --header 'Authorization: Bearer <:access_token:>' \
  --data '{
   "status": "SCHEDULE",
   "meeting_id": null,
   "workflow_step_id": "39121",
   "start_time": "2024-06-08T08:30:00.000Z",
   "duration": 30,
   "timezone": "Asia/Kolkata",
   "candidate_name": "candidate name",
   "candidate_email": "candidate@email.com",
   "candidate_reference_id": "CAN_LAT_10045",
   "interviewers": ["inerviewer1@email.com", "inerviewer2@email.com"],
   "organizer_email": "organizer@email.com",
   "workflow_step_reference_id" : "LA-1-1",
   "callback_url" : "https://<external_service_host_url>.com/scores"
}'
```
