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

# Tashkil

> Add Arabic diacritics (tashkil) to text. The model performs best on Fusha and formal Arabic content.

## Endpoint

`POST /tashkil/diacritize`

## Authentication

Requires API key authentication with the `x-api-key` header.

```http theme={null}
x-api-key: YOUR_MUNSIT_API_KEY
```

## Request body

| Field  | Type   | Required | Description               |
| ------ | ------ | -------- | ------------------------- |
| `text` | string | Yes      | Arabic text to diacritize |

## Response

| Field                   | Type   | Description                 |
| ----------------------- | ------ | --------------------------- |
| `statusCode`            | number | HTTP-style status code      |
| `data.original_text`    | string | Original input text         |
| `data.diacritized_text` | string | Text with Arabic diacritics |
| `message`               | string | Request status message      |

## Example

```bash theme={null}
curl 'https://api.munsit.com/api/v1/tashkil/diacritize' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_MUNSIT_API_KEY' \
  -d '{
    "text": "ذهب الطالب الى المدرسة"
  }'
```

```json theme={null}
{
  "statusCode": 200,
  "data": {
    "original_text": "ذهب الطالب الى المدرسة",
    "diacritized_text": "ذَهَبَ الطَّالِبُ إِلَى المَدْرَسَةِ"
  },
  "message": "Success"
}
```

## Notes

* The model performs best on Fusha and formal Arabic text.
* Dialectal, noisy, or highly informal text may need additional review.

## Error responses

| HTTP status | `errorCode` | Scenario                                           |
| ----------- | ----------- | -------------------------------------------------- |
| `400`       | `40001`     | Missing or invalid `text` field                    |
| `401`       | `40101`     | Missing, invalid, expired, or revoked API key      |
| `413`       | `41301`     | Request body exceeds the maximum size limit        |
| `500`       | `50001`     | Internal error or upstream Tashkil service failure |

### Missing API key

```json theme={null}
{
  "errorCode": 40101,
  "errorMessage": "API key required"
}
```

### Invalid API key

```json theme={null}
{
  "errorCode": 40101,
  "errorMessage": "Invalid API key"
}
```

### Validation error

```json theme={null}
{
  "errorCode": 40001,
  "errorMessage": "text: Expected string"
}
```


## OpenAPI

````yaml POST /tashkil/diacritize
openapi: 3.1.0
info:
  title: Munsit API
  description: >-
    Munsit - First True Arabic Voice AI that speaks Dialects From Abu Dhabi to
    Rabat with Voice Cloning & On-prem support
  version: 1.0.0
servers:
  - url: https://api.munsit.com/api/v1
    description: Global production server
  - url: https://ae.api.faseeh.ai/api/v1
    description: UAE regional server
security:
  - apiKeyAuth: []
paths:
  /tashkil/diacritize:
    post:
      tags:
        - Tashkil
      summary: Diacritize Arabic Text
      description: >-
        Add Arabic diacritics (tashkil) to text. The model performs best on
        Fusha and formal Arabic content.
      operationId: diacritizeArabicText
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TashkilRequest'
            example:
              text: ذهب الطالب الى المدرسة
      responses:
        '200':
          description: Text diacritized successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TashkilResponse'
              example:
                statusCode: 200
                data:
                  original_text: ذهب الطالب الى المدرسة
                  diacritized_text: ذَهَبَ الطَّالِبُ إِلَى المَدْرَسَةِ
                message: Success
        '400':
          description: Bad Request - Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                validationError:
                  summary: Invalid text field
                  value:
                    errorCode: 40001
                    errorMessage: 'text: Expected string'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missingApiKey:
                  summary: Missing API key
                  value:
                    errorCode: 40101
                    errorMessage: API key required
                invalidApiKey:
                  summary: Invalid API key
                  value:
                    errorCode: 40101
                    errorMessage: Invalid API key
                expiredApiKey:
                  summary: Expired API key
                  value:
                    errorCode: 40101
                    errorMessage: API key has expired
        '413':
          description: Payload Too Large - Request body exceeds the maximum size limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errorCode: 41301
                errorMessage: >-
                  Request body exceeds the maximum size limit of 600MB. Please
                  reduce the file size or contact support for assistance.
        '500':
          description: >-
            Internal Server Error - Internal error or upstream Tashkil service
            failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                errorCode: 50001
                errorMessage: Internal server error
components:
  schemas:
    TashkilRequest:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          minLength: 1
          description: >-
            Arabic text to diacritize. Fusha and formal Arabic text are
            recommended for best results.
    TashkilResponse:
      type: object
      required:
        - statusCode
        - data
        - message
      properties:
        statusCode:
          type: integer
          example: 200
        data:
          type: object
          required:
            - original_text
            - diacritized_text
          properties:
            original_text:
              type: string
              description: Original input text.
            diacritized_text:
              type: string
              description: Text with Arabic diacritics.
        message:
          type: string
          example: Success
    Error:
      type: object
      required:
        - errorCode
        - errorMessage
      properties:
        errorCode:
          type: string
          description: Error code identifier
        errorMessage:
          type: string
          description: Human-readable error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````