---
# System prepended metadata

title: Module 6(Candidates CRUD)
tags: [general]

---

---
title: Module 6(Candidates CRUD)
tags: general
---

# List of APIs

### Module 6: Candidates Module

#### Prerequisites

**New Tables**

    - candidates
        - id: uuid
        - name
        - email
        - phoneNumber
        - DOB
        - highestQualification
        - pastCompany: string, nullable 
        - pastDesignation: string, nullable
        - pastCTC: string, nullable
        - totalExperience: number (default = 0)
        - location1
        - location2
        - location3
        - industry1
        - industry2
        - skill1
        - skill2
        - skill3
        - uploadedResumeUrl: string, url, nullable
        - about: Text, nullable
        - organizationId
        - createdResumeUrl: string, url
        - created_at
        - updated_at
        - created_by
        - updated_by
        
        
        Rec -- Cand



##### 1) Create candidate

**Endpoint:**: POST '/candidate'

**Requirement**: isRecruiterOrgAdmin or isRecruiterMember

##### 2) Get All candidates

**Endpoint:**: GET '/candidates'

**Response**: 

```
{
    meta: {
    ...
    },
    data: [{
     name, about, totalExperience, etc.
     
     industry
     skills
     
    }, ...]

}
```

##### 3) Edit candidate

**EndPoint**: PUT 'candidates/:candidate_id'

**Required**: isRecruiterOrgAdmin or isRecruiterMember

Process:

Same as other Edit table functions.


##### 5) Disable candidate

**EndPoint**: POST 'candidates/disable'

**Required**: isRecruiterOrgAdmin or member

Process:

Same as recruiter members, will work with the given candidateId.

Request Body: 
```
[{
    candidateId: {candidate's id}, 
    disable: true/false
}]
```

If disable == true then disable the client else enable it.

##### 6) Delete candidates

**EndPoint**: DELETE '/candidates'

**Required**: isRecruiterOrgAdmin or Member

Process:

Same as recruiter members, will work with the given candidate_id.

Request Body: 
```
[{
    candidateId: {candidate's id}
}]
```



##### 7) Filters on candidates

same as before


##### 8) Create PDF 

We need to create an action to create a PDf resume based on the details provided. 

Then we will use this action to create a pdf and store it in post and put operation of candidates.

Also, we will create an endpoint for this in case we need it


##### 9) Get candidates Resume PDF

**EndPoint**: POST '/candidates/resumes'

**Required**: isRecruiterOrgAdmin or Member

Process:

Fetch the createdResumeUrls

Request Body: 
```
[{
    candidateIds: [array of candidate ids]
}]
```

Response Body: 

```
{
  meta: {...},
  data: {
    candidate1_id: "resume_url1",
    candidate2_id: "resume_url2",
    candidate3_id: "resume_url3",
    ...
  }
}
```



