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

# Update Work Experience

> Update an existing work experience entry

## Endpoint

```
PATCH /api/v1/job-seekers/me/work-experiences/:expId
```

**Base URL**: `http://localhost:3000/api/v1`

<Note>This endpoint requires **authentication** and **Job Seeker role**.</Note>

## URL Parameters

| Parameter | Type   | Required | Description            |
| --------- | ------ | -------- | ---------------------- |
| `expId`   | string | Yes      | The work experience ID |

## Authentication

Include the access token in the Authorization header:

```bash theme={null}
Authorization: Bearer YOUR_ACCESS_TOKEN
```

## Description

Update an existing work experience entry. Only fields provided in the request body will be updated (partial update).

## Request Body

All fields are optional for updates:

| Field         | Type    | Description                          |
| ------------- | ------- | ------------------------------------ |
| `companyName` | string  | Name of the company                  |
| `jobTitle`    | string  | Title of the position                |
| `description` | string  | Job description and responsibilities |
| `location`    | string  | Work location                        |
| `startDate`   | string  | Start date (ISO 8601 format)         |
| `endDate`     | string  | End date (ISO 8601 format)           |
| `isCurrent`   | boolean | Currently working here               |

### Example Request Body

```json theme={null}
{
  "jobTitle": "Lead Software Engineer",
  "description": "Led team of 5 developers and microservices architecture"
}
```

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true,
  "data": {
    "id": "exp-123-uuid",
    "companyName": "Tech Corp",
    "jobTitle": "Lead Software Engineer",
    "description": "Led team of 5 developers and microservices architecture",
    "location": "Cairo, Egypt",
    "startDate": "2023-01-15T00:00:00.000Z",
    "endDate": null,
    "isCurrent": true,
    "jobSeekerId": "js-456-uuid",
    "createdAt": "2024-01-10T10:30:00.000Z",
    "updatedAt": "2024-01-15T14:20:00.000Z"
  },
  "message": "Success",
  "meta": {
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/job-seekers/me/work-experiences/exp-123-uuid",
    "method": "PATCH"
  }
}
```

### Response Fields

<ResponseField name="id" type="string">
  Unique identifier for the work experience entry.
</ResponseField>

## Error Responses

### 401 Unauthorized

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Unauthorized",
    "statusCode": 401,
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/job-seekers/me/work-experiences/exp-123-uuid",
    "method": "PATCH",
    "details": "Unauthorized"
  }
}
```

### 403 Forbidden

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Forbidden resource",
    "statusCode": 403,
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/job-seekers/me/work-experiences/exp-123-uuid",
    "method": "PATCH",
    "details": "Forbidden"
  }
}
```

### 404 Not Found

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Work experience not found",
    "statusCode": 404,
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/job-seekers/me/work-experiences/exp-123-uuid",
    "method": "PATCH",
    "details": "Not Found"
  }
}
```

### 400 Bad Request - Validation Error

```json theme={null}
{
  "success": false,
  "error": {
    "message": ["companyName must be a string", "startDate must be a valid date string"],
    "statusCode": 400,
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/job-seekers/me/work-experiences/exp-123-uuid",
    "method": "PATCH",
    "details": "Bad Request"
  }
}
```

## Example Request

```bash theme={null}
curl -X PATCH http://localhost:3000/api/v1/job-seekers/me/work-experiences/exp-123-uuid \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "jobTitle": "Lead Software Engineer",
    "description": "Led team of 5 developers"
  }'
```

## Notes

<Info>
  **Partial Update**: Only provide the fields you want to update. All other fields will remain
  unchanged.
</Info>

<Tip>
  **Updating Current Job**: To mark a past job as current, set `isCurrent` to `true` and remove
  `endDate`.
</Tip>
