Skip to main content
BlueAI
Home/CRM/Tags

Tags

Manage tags for deals, companies, and contacts. Filter resources by tags.

|

Endpoints

GET/api/v1/crm/tagsList tags
POST/api/v1/crm/tagsCreate a tag
PATCH/api/v1/crm/tags/{id}Update a tag
DELETE/api/v1/crm/tags/{id}Delete a tag
POST/api/v1/crm/tag-assignmentsAssign a tag to a resource
DELETE/api/v1/crm/tag-assignments/{tag_id}Remove a tag from a resource
GET/api/v1/crm/tags

List tags

Retrieve all tags within the organization.

Authentication requiredInclude session cookie or Bearer token

Response Fields

NameTypeRequiredDescription
Tag[]OptionalArray of tags

Code Examples

curl "https://api.blueai.jp/api/v1/crm/tags" \
  -H "Cookie: better-auth.session_token=<token>"

Response Example

{
  "tags": [
    {
      "id": "tag_f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1",
      "name": "重要顧客",
      "color": "#EF4444",
      "created_at": "2026-01-15T09:00:00Z",
      "updated_at": "2026-01-15T09:00:00Z"
    },
    {
      "id": "tag_f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f2",
      "name": "新規開拓",
      "color": "#3B82F6",
      "created_at": "2026-01-20T10:00:00Z",
      "updated_at": "2026-01-20T10:00:00Z"
    }
  ]
}
POST/api/v1/crm/tags

Create a tag

Create a new tag. Tag names must be unique within the organization.

Authentication requiredInclude session cookie or Bearer token

Request Body

NameTypeRequiredDescription
name
stringRequiredTag name
color
stringRequiredTag color (HEX color code, e.g., #EF4444)

Response Fields

NameTypeRequiredDescription
tag
TagOptionalCreated tag

Code Examples

curl -X POST "https://api.blueai.jp/api/v1/crm/tags" \
  -H "Cookie: better-auth.session_token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "重要顧客",
  "color": "#EF4444"
}'

Response Example

{
  "tag": {
    "id": "tag_f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1",
    "name": "重要顧客",
    "color": "#EF4444",
    "created_at": "2026-02-20T09:00:00Z",
    "updated_at": "2026-02-20T09:00:00Z"
  }
}
PATCH/api/v1/crm/tags/{id}

Update a tag

Update the name or color of the specified tag.

Authentication requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringRequiredTag ID

Request Body

NameTypeRequiredDescription
name
stringOptionalTag name
color
stringOptionalTag color (HEX color code)

Response Fields

NameTypeRequiredDescription
tag
TagOptionalUpdated tag

Code Examples

curl -X PATCH "https://api.blueai.jp/api/v1/crm/tags/tag_123e4567e89b12d3a456426614174000" \
  -H "Cookie: better-auth.session_token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "VIP 顧客",
  "color": "#F59E0B"
}'

Response Example

{
  "tag": {
    "id": "tag_f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1",
    "name": "VIP 顧客",
    "color": "#F59E0B",
    "created_at": "2026-01-15T09:00:00Z",
    "updated_at": "2026-02-20T11:00:00Z"
  }
}
DELETE/api/v1/crm/tags/{id}

Delete a tag

Delete the specified tag. All tag assignments to resources are also removed.

Authentication requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringRequiredTag ID

Response Fields

NameTypeRequiredDescription
success
booleanOptionalDeletion success flag

Code Examples

curl -X DELETE "https://api.blueai.jp/api/v1/crm/tags/tag_123e4567e89b12d3a456426614174000" \
  -H "Cookie: better-auth.session_token=<token>"

Response Example

{
  "success": true
}
POST/api/v1/crm/tag-assignments

Assign a tag to a resource

Assign a tag to a deal, company, or contact. resource_type must be one of: deal, company, contact.

Authentication requiredInclude session cookie or Bearer token

Request Body

NameTypeRequiredDescription
tag_id
stringRequiredID of the tag to assign
resource_type
stringRequiredResource type (deal / company / contact)
resource_id
stringRequiredResource ID

Response Fields

NameTypeRequiredDescription
TagAssignmentOptionalCreated tag assignment

Code Examples

curl -X POST "https://api.blueai.jp/api/v1/crm/tag-assignments" \
  -H "Cookie: better-auth.session_token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
  "tag_id": "tag_f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1",
  "resource_type": "deal",
  "resource_id": "deal_11111111111111111111111111111111"
}'

Response Example

{
  "assignment": {
    "id": "taga_abababababababababababababababab",
    "tag_id": "tag_f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1",
    "resource_type": "deal",
    "resource_id": "deal_11111111111111111111111111111111",
    "tag_name": "重要顧客",
    "tag_color": "#EF4444",
    "created_at": "2026-02-20T10:00:00Z"
  }
}
DELETE/api/v1/crm/tag-assignments/{tag_id}

Remove a tag from a resource

Remove a tag assignment from a resource. Specify resource_type and resource_id as query parameters.

Authentication requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
tag_id
stringRequiredTag ID

Query Parameters

NameTypeRequiredDescription
resource_type
stringOptionalResource type (deal / company / contact)
resource_id
stringOptionalResource ID

Response Fields

NameTypeRequiredDescription
success
booleanOptionalDeletion success flag

Code Examples

curl -X DELETE "https://api.blueai.jp/api/v1/crm/tag-assignments/:tag_id" \
  -H "Cookie: better-auth.session_token=<token>"

Response Example

{
  "success": true
}