---
name: "authCategoryWritePermissionsSync"
mode: "kit"
versionRequirements:
  - { name: "HealthKit", version: "5.18.0" }
  - { name: "@ray-js/ray", version: "1.6.17" }
platform:
  - "iOS"
title: "health.authCategoryWritePermissionsSync - Request Category write permissions [iOS only]"
---

## authCategoryWritePermissionsSync

> [VERSION] HealthKit >= 5.18.0 | @ray-js/ray >= 1.6.17

> [PLATFORM] iOS

### Description

Request write permission for Category data types [iOS only]

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `permissions` | `string[]` | No | - | `5.18.3` | Permission types (used by the API for requesting read/write permissions); see the enum list below for values, e.g., ["1","2"] |
| `readPermissions` | `string[]` | No | - | `5.18.3` | Read permission types (used by the API that checks whether the user has already authorized); see the enum list below for values, e.g., ["1","2"] |
| `writePermissions` | `string[]` | No | - | `5.18.3` | Write permission types (used by the API that checks whether the user has already authorized); see the enum list below for values, e.g., ["1","2"] |
| `writePermission` | `number` | No | - | `5.18.3` | Write permission types (used by the API that checks whether write permission is granted); see the enum list below for values |
| `value` | `number` | No | - | `5.18.3` | Value to write (the specific measurement for Quantity or Category data types) |
| `unitType` | `string` | No | - | `5.18.3` | Unit to pass in, e.g., "mg/dL", "g", "cm", "count"; required when querying and writing Quantity-type data Refer to Apple's official HKTypeIdentifiers.h file for the unit corresponding to each data type |
| `startTime` | `number` | No | - | `5.18.3` | Start time, timestamp in seconds |
| `endTime` | `number` | No | - | `5.18.3` | End time, timestamp in seconds |
| `type` | `number` | No | - | `5.18.3` | Data types to read/write (used by read/write APIs); see the enum list below for values |

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1` | AppleHealthParamsError |

### Examples

#### Basic usage

```tsx
import { health } from '@ray-js/ray'

const { authCategoryWritePermissionsSync } = health;

authCategoryWritePermissionsSync({
  permissions: ['1', '2'],
});
```
