# टैग

> Activities को व्यवस्थित करने के लिए टैग बनाएँ और संभालें

- पेज: https://tbit.app/hi/docs/api/tags
- Base URL: `https://rest-api.tbit.app/v1`
- ऑथेंटिकेशन: हर request में आपकी key के साथ `X-API-Key` header (उदाहरण इसे `TBIT_API_KEY` environment variable से पढ़ते हैं)

## परिचय

टैग से आप activities को कैटेगरी में बाँट और व्यवस्थित कर सकते हैं। हर टैग का एक नाम, एक वैकल्पिक रंग और एक वैकल्पिक विवरण होता है। टैग आपके एजेंट से जुड़े होते हैं।

## Endpoints

| Method | Path | विवरण |
| --- | --- | --- |
| `GET` | `/v1/tags` | List all tags |
| `POST` | `/v1/tags` | Create a new tag |
| `PATCH` | `/v1/tags/:id` | Update a tag |
| `DELETE` | `/v1/tags/:id` | Delete a tag |

## टैग की लिस्ट

`GET /v1/tags`

```bash
curl "https://rest-api.tbit.app/v1/tags" \
  -H "X-API-Key: $TBIT_API_KEY"
```

## टैग बनाएँ

`POST /v1/tags`

```bash
curl -X POST "https://rest-api.tbit.app/v1/tags" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "VIP",
    "color": "#ef4444",
    "description": "High-priority customers"
  }'
```

## टैग अपडेट करें

`PATCH /v1/tags/tag_id_1`

```bash
curl -X PATCH "https://rest-api.tbit.app/v1/tags/tag_id_1" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Premium",
    "color": "#8b5cf6"
  }'
```

## टैग डिलीट करें

`DELETE /v1/tags/tag_id_1`

```bash
curl -X DELETE "https://rest-api.tbit.app/v1/tags/tag_id_1" \
  -H "X-API-Key: $TBIT_API_KEY"
```

## Response फ़ॉर्मेट

एक टैग ऑब्जेक्ट:

```json
{
  "data": [
    {
      "id": "tag_id_1",
      "name": "VIP",
      "color": "#ef4444",
      "description": "High-priority customers",
      "created_at": "2024-09-01T12:00:00Z",
      "updated_at": "2024-09-01T12:00:00Z"
    },
    {
      "id": "tag_id_2",
      "name": "New Lead",
      "color": "#3b82f6",
      "description": null,
      "created_at": "2024-09-02T08:00:00Z",
      "updated_at": "2024-09-02T08:00:00Z"
    }
  ]
}
```
