---
name: "files_define"
area: "files"
title: "Define a tag, type, field or correspondent"
price: "$0.001"
method: "POST"
url: "https://api.conecto.chat/v1/tools/files_define"
mcp_server: "https://api.conecto.chat/mcp/files"
auth: "Authorization: Bearer <conecto_sk_ key>"
docs_url: "https://conecto.chat/tools/files/files_define"
---

# Define a tag, type, field or correspondent (`files_define`)

Adds, renames or deletes a tag, a document type, a custom field or a correspondent to file things with.

Add, rename or delete one of the account's own ways to file things: a tag, a document_type (Invoice, Contract, Receipt), a custom field (field_type: text, number, money, date, boolean (yes/no) or url; a money field has a default currency) or a correspondent (link it to a CRM company_id or contact_id). Matched by name, any case. Deleting takes it off every file (a field's values go with it). $0.001.

Price: $0.001 a call. A call that fails costs nothing.

## Use it when

Files need a tag, type, field or correspondent that does not exist yet.

## Say this to your agent

> Add a Total field for amounts in dollars, so we can file invoices by their total.

## Inputs

| Name | Type | Required | Description | Allowed values | Default |
|---|---|---|---|---|---|
| `kind` | string | yes |  | `"tag"`, `"document_type"`, `"field"`, `"correspondent"` |  |
| `name` | string | yes | 1 to 200 characters. |  |  |
| `new_name` | string | no | Up to 200 characters. |  |  |
| `field_type` | string | no |  | `"text"`, `"number"`, `"money"`, `"date"`, `"boolean"`, `"url"` |  |
| `currency` | string or null | no | A money field's currency for values given without one. Matches ^[A-Za-z]{3}$. |  |  |
| `company_id` | integer or null | no | At least 1. |  |  |
| `contact_id` | integer or null | no | At least 1. |  |  |
| `delete` | boolean | no |  |  | `false` |

## Example

Written for Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon.

MCP: call `files_define` on the MCP server `https://api.conecto.chat/mcp/files` with these arguments:

```json
{
  "kind": "field",
  "name": "Total",
  "field_type": "money",
  "currency": "USD"
}
```

REST:

```bash
curl https://api.conecto.chat/v1/tools/files_define \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind": "field", "name": "Total", "field_type": "money", "currency": "USD"}'
```

## Response

```json
{
  "call_id": "5f0c8a2e-3b7d-4c1e-9a64-2d8e1f7b0c93",
  "tool": "files_define",
  "status": "succeeded",
  "replayed": false,
  "cost_usd": "$0.001",
  "balance_usd": "$19.75",
  "result": {
    "created": {
      "kind": "field",
      "name": "Total",
      "field_type": "money",
      "currency": "USD"
    }
  }
}
```

`result`: What was defined (its kind, name, type, currency, CRM link) and created, or what was deleted.

## Errors

| Code | Status | When | Fix |
|---|---|---|---|
| `invalid_input` | 400 | The name is empty or too long, or a new field has no field_type. | Give a name, and a field_type for a new field. |
| `name_taken` | 409 | Something of that kind has that name already. | Pick another name. |
| `not_found` | 404 | The CRM record or the thing to rename or delete does not exist. | Check it with files_definitions. |
| `type_fixed` | 409 | Files have values for the field, so its type stays. | Add a new field instead. |
| `limit_reached` | 409 | The business has as many of these as it may. | Delete some with files_define. |

The refusals every tool can give (401 key, 402 balance, 429 limits) are on the errors page: https://conecto.chat/docs/errors.md

## Related

- [files_upload](https://conecto.chat/tools/files/files_upload.md): Stores a file in the business's file store from its bytes, its text or a public link, with a download link. $0.001 a call.
- [files_upload_link](https://conecto.chat/tools/files/files_upload_link.md): A one-time link to upload one file of up to 25 MB, to use yourself or hand to a person. Free.
- [files_list](https://conecto.chat/tools/files/files_list.md): The business's files, newest first, filtered by name, words inside, tags, type, correspondent, document date or fields. Free up to 1,000,000 reads a month.
- [files_get](https://conecto.chat/tools/files/files_get.md): One file's details and a fresh download link, with the text of a small text file if asked. Free up to 1,000,000 reads a month.
- [files_read_text](https://conecto.chat/tools/files/files_read_text.md): The words in a file as Conecto read them: text files, PDFs, office files, HTML, and scans once read with OCR. Free up to 1,000,000 reads a month.
- [files_edit](https://conecto.chat/tools/files/files_edit.md): Says what one file is, or up to 100 at once: title, notes, document date, correspondent, type, tags and fields. $0.005 per file changed.
- [files_definitions](https://conecto.chat/tools/files/files_definitions.md): The tags, document types, custom fields and correspondents the business files with, each with how many files use it, and the OCR settings. Free up to 1,000,000 reads a month.
- [files_ocr](https://conecto.chat/tools/files/files_ocr.md): Reads the words in a scan with OCR: an image, or the pages of a PDF without text; the text is kept. $0.005 per page read.
- [files_ocr_settings](https://conecto.chat/tools/files/files_ocr_settings.md): Sets whether new scans are read with OCR as they arrive, and the languages OCR reads in. $0.001 a call.
- [files_delete](https://conecto.chat/tools/files/files_delete.md): Deletes a file for good; every download link to it stops working. Free.
- [files_add_storage](https://conecto.chat/tools/files/files_add_storage.md): Rents 10 GB more file storage, renewed monthly from the balance; this call pays the first month. $1.00 a call.
- [files_remove_storage](https://conecto.chat/tools/files/files_remove_storage.md): Stops renting one 10 GB block of storage, if the files still fit. Free.
