# POST /api/tags

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Request body: application/json (required)

Type: object

Schema: [CreateTagDTO](https://sourcey-gauzy.pages.dev/api-reference/models/createtagdto/index.md)

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (optional)
  Type: object

- `organizationId` (optional)
  Type: string

- `sentTo` (optional)
  Type: string

- `name` (required)
  Type: string

- `color` (required)
  Type: string

- `textColor` (optional)
  Type: string

- `description` (optional)
  Type: string

- `icon` (optional)
  Type: string

- `tagTypeId` (optional)
  Type: string

- `organizationTeamId` (optional)
  Type: string

Responses:

- 201: 

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/tags' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "name": "string",
  "color": "string",
  "textColor": "string",
  "description": "string",
  "icon": "string",
  "tagTypeId": "string",
  "organizationTeamId": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "name": "string",
  "color": "string",
  "textColor": "string",
  "description": "string",
  "icon": "string",
  "tagTypeId": "string",
  "organizationTeamId": "string"
}`;

const response = await fetch('http://localhost:3000/api/tags', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "name": "string",
  "color": "string",
  "textColor": "string",
  "description": "string",
  "icon": "string",
  "tagTypeId": "string",
  "organizationTeamId": "string"
}'''

response = requests.post(
    'http://localhost:3000/api/tags',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
