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

# Jobs API

> Access job opportunities and employment listings in Dzaleka

## GET /api/jobs

Retrieve a list of all job opportunities in Dzaleka Refugee Camp.

### Query Parameters

This endpoint does not require any query parameters.

### Response Format

<ResponseField name="status" type="string" required>
  Status of the API response ("success" or "error")
</ResponseField>

<ResponseField name="count" type="number" required>
  Total number of jobs returned
</ResponseField>

<ResponseField name="data" type="object" required>
  Container for the jobs data

  <ResponseField name="jobs" type="array" required>
    Array of job objects

    <ResponseField name="id" type="string">
      Unique identifier for the job
    </ResponseField>

    <ResponseField name="collection" type="string">
      Collection name ("jobs")
    </ResponseField>

    <ResponseField name="title" type="string">
      Job title
    </ResponseField>

    <ResponseField name="organization" type="string">
      Hiring organization name
    </ResponseField>

    <ResponseField name="location" type="string">
      Job location (e.g., "Remote", "Dzaleka", "Remote / Dzaleka")
    </ResponseField>

    <ResponseField name="type" type="string">
      Job type (e.g., "full-time", "part-time", "contract", "internship")
    </ResponseField>

    <ResponseField name="category" type="string">
      Job category (e.g., "business", "technology", "education")
    </ResponseField>

    <ResponseField name="posted" type="string">
      Date posted (YYYY-MM-DD)
    </ResponseField>

    <ResponseField name="deadline" type="string">
      Application deadline (YYYY-MM-DD)
    </ResponseField>

    <ResponseField name="status" type="string">
      Job status ("open", "closed", "filled")
    </ResponseField>

    <ResponseField name="featured" type="boolean">
      Whether the job is featured
    </ResponseField>

    <ResponseField name="description" type="string">
      Job description summary
    </ResponseField>

    <ResponseField name="skills" type="array">
      Array of required skills
    </ResponseField>

    <ResponseField name="contact" type="object">
      Contact information

      <ResponseField name="email" type="string">
        Application email
      </ResponseField>

      <ResponseField name="website" type="string">
        Organization website
      </ResponseField>

      <ResponseField name="phone" type="string">
        Contact phone number
      </ResponseField>
    </ResponseField>
  </ResponseField>
</ResponseField>

### Error Responses

<ResponseField name="status" type="string">
  "error"
</ResponseField>

<ResponseField name="message" type="string">
  Error message description
</ResponseField>

<ResponseField name="error" type="string">
  Detailed error information
</ResponseField>

**Status Codes:**

* `200` - Success
* `429` - Rate limit exceeded (60 requests per minute)
* `500` - Internal server error

### Rate Limiting

All API endpoints are rate-limited to 60 requests per minute per IP address. Rate limit headers are included in responses:

* `X-RateLimit-Limit`: Maximum requests per window
* `X-RateLimit-Remaining`: Remaining requests in current window
* `X-RateLimit-Reset`: Timestamp when the rate limit resets
* `Retry-After`: Seconds to wait before retrying (only on 429 responses)

### Example Request

```bash theme={null}
curl -X GET "https://services.dzaleka.com/api/jobs" \
  -H "Content-Type: application/json"
```

### Example Response

```json theme={null}
{
  "status": "success",
  "count": 1,
  "data": {
    "jobs": [
      {
        "id": "Content-Curator-and-Editor",
        "collection": "jobs",
        "title": "Content Curator & Editor",
        "organization": "Dzaleka Digital Heritage",
        "location": "Remote / Dzaleka",
        "type": "part-time",
        "category": "business",
        "posted": "2025-03-12",
        "deadline": "2025-05-12",
        "status": "open",
        "featured": true,
        "description": "Join Dzaleka Digital Heritage as a Content Curator & Editor to help shape and refine the digital narratives that showcase the stories of Dzaleka's community. Bring your creativity to the forefront by managing and curating multimedia content for our platform.",
        "skills": [
          "Content creation",
          "Editing & proofreading",
          "Digital storytelling",
          "Multimedia curation",
          "Content management systems (CMS)",
          "Photography & video editing",
          "Collaborative Teamwork"
        ],
        "contact": {
          "email": "dzalekaconnect@gmail.com",
          "website": "https://services.dzaleka.com",
          "phone": ""
        }
      }
    ]
  }
}
```

## POST /api/jobs

Retrieve jobs data with optional metadata and statistics.

### Request Body

<ParamField body="options" type="object">
  Optional configuration for the response

  <ParamField body="includeMetadata" type="boolean">
    Include export metadata in response
  </ParamField>

  <ParamField body="includeStats" type="boolean">
    Include statistics in response
  </ParamField>
</ParamField>

### Response Format

Same as GET endpoint, with optional additional fields:

<ResponseField name="metadata" type="object">
  Export metadata (only if `includeMetadata: true`)

  <ResponseField name="exportDate" type="string">
    ISO 8601 timestamp of export
  </ResponseField>

  <ResponseField name="collection" type="string">
    Collection name
  </ResponseField>
</ResponseField>

<ResponseField name="stats" type="object">
  Statistics (only if `includeStats: true`)

  <ResponseField name="totalItems" type="number">
    Total number of items
  </ResponseField>

  <ResponseField name="collection" type="string">
    Collection name
  </ResponseField>
</ResponseField>

### Example Request

```bash theme={null}
curl -X POST "https://services.dzaleka.com/api/jobs" \
  -H "Content-Type: application/json" \
  -d '{
    "options": {
      "includeMetadata": true,
      "includeStats": true
    }
  }'
```

### Example Response

```json theme={null}
{
  "status": "success",
  "count": 15,
  "data": {
    "jobs": [
      {
        "id": "Content-Curator-and-Editor",
        "title": "Content Curator & Editor",
        "organization": "Dzaleka Digital Heritage",
        "type": "part-time",
        "status": "open"
      }
    ]
  },
  "metadata": {
    "exportDate": "2025-03-09T12:00:00.000Z",
    "collection": "jobs"
  },
  "stats": {
    "totalItems": 15,
    "collection": "jobs"
  }
}
```

## Implementation

The Jobs API is implemented using the `createGetHandler` and `createPostHandler` utility functions from `src/utils/api-utils.ts:118`.

Source code: `src/pages/api/jobs.ts:5`
