## Field types

`GET /v1/userfields/tasks/types`

Returns the catalog of user field types that you can specify when creating a task field.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/userfields/tasks/types" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/userfields/tasks/types" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/userfields/tasks/types', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { success, data } = await res.json()
console.log(data.map((type) => type.userTypeId))
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/userfields/tasks/types', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of field types |
| `data[].userTypeId` | string | Type identifier — the `userTypeId` value for [`POST /v1/userfields/tasks`](/docs/userfields/tasks/create) |
| `data[].title` | string | Display name of the type |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "userTypeId": "string",
      "title": "String"
    },
    {
      "userTypeId": "integer",
      "title": "Integer"
    },
    {
      "userTypeId": "double",
      "title": "Number"
    },
    {
      "userTypeId": "boolean",
      "title": "Yes/No"
    },
    {
      "userTypeId": "enumeration",
      "title": "List"
    },
    {
      "userTypeId": "datetime",
      "title": "Date/Time"
    },
    {
      "userTypeId": "date",
      "title": "Date"
    },
    {
      "userTypeId": "money",
      "title": "Money"
    },
    {
      "userTypeId": "url",
      "title": "Link"
    },
    {
      "userTypeId": "address",
      "title": "Google Map address"
    },
    {
      "userTypeId": "file",
      "title": "File"
    },
    {
      "userTypeId": "employee",
      "title": "Link to a user"
    },
    {
      "userTypeId": "crm_status",
      "title": "Link to CRM directories"
    },
    {
      "userTypeId": "iblock_section",
      "title": "Link to information block sections"
    },
    {
      "userTypeId": "iblock_element",
      "title": "Link to information block elements"
    },
    {
      "userTypeId": "crm",
      "title": "Link to CRM items"
    }
  ]
}
```

## Error response example

401 — the `X-Api-Key` header was not passed:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "API key required. Pass via X-Api-Key header."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `TASK_CUSTOM_FIELDS_UNAVAILABLE` | The portal plan does not include task user fields |
| 403 | `SCOPE_DENIED` | The API key does not have the `task` scope |
| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens. For an application key, the `Authorization: Bearer USER_SESSION_TOKEN` header was not passed |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |

Full list of common API errors — [Errors](/docs/errors).

## Known specifics

**System field types are not in the catalog.** The system fields `UF_TASK_WEBDAV_FILES` and `UF_MAIL_MESSAGE` have the types `disk_file` and `mail_message` — they appear in the [field list](/docs/userfields/tasks/list), but not in the catalog.

## See also

- [Create field](/docs/userfields/tasks/create)
- [List fields](/docs/userfields/tasks/list)
- [Task fields](/docs/userfields/tasks)
- [User fields](/docs/userfields)
