Companies
Register and manage partner companies.
|
Endpoints
| GET | /api/v1/crm/companies | List companies |
| POST | /api/v1/crm/companies | Create a company |
| GET | /api/v1/crm/companies/{id} | Get company details |
| PATCH | /api/v1/crm/companies/{id} | Update a company |
| DELETE | /api/v1/crm/companies/{id} | Delete a company |
GET
/api/v1/crm/companiesList companies
Retrieve companies within the organization with pagination. Supports name search.
Authentication required— Include session cookie or Bearer token
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | Optional | Number of items per page (default: 50, max: 200) |
offset | integer | Optional | Number of items to skip |
search | string | Optional | Partial match search by company name |
sort | string | Optional | Sort key (created_at, name) |
order | string | Optional | Sort order (asc / desc) |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Company[] | Optional | Array of companies | |
total | number | Optional | Total count |
limit | number | Optional | Items per page |
offset | number | Optional | Number of items skipped |
Code Examples
curl "https://api.blueai.jp/api/v1/crm/companies" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"items": [
{
"id": "comp_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "株式会社サンプル",
"website": "https://example.com",
"phone": "03-1234-5678",
"address": "東京都渋谷区...",
"industry": "IT",
"email": "info@example.com",
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-02-01T12:00:00Z"
}
],
"total": 18,
"limit": 50,
"offset": 0
}POST
/api/v1/crm/companiesCreate a company
Register a new company.
Authentication required— Include session cookie or Bearer token
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Required | Company name |
website | string | Optional | Website URL |
phone | string | Optional | Phone number |
address | string | Optional | Address |
industry | string | Optional | Industry |
email | string | Optional | Primary email |
note | string | Optional | Note |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Company | Optional | Created company |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/crm/companies" \
-H "Cookie: better-auth.session_token=<token>" \
-H "Content-Type: application/json" \
-d '{
"name": "株式会社サンプル",
"website": "https://example.com",
"phone": "03-1234-5678",
"address": "東京都渋谷区...",
"industry": "IT"
}'Response Example
{
"company": {
"id": "comp_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "株式会社サンプル",
"website": "https://example.com",
"phone": "03-1234-5678",
"address": "東京都渋谷区...",
"industry": "IT",
"email": "info@example.com",
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-02-01T12:00:00Z"
}
}GET
/api/v1/crm/companies/{id}Get company details
Retrieve detailed information for the specified company.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Company ID |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Company | Optional | Company details |
Code Examples
curl "https://api.blueai.jp/api/v1/crm/companies/comp_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"company": {
"id": "comp_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "株式会社サンプル",
"website": "https://example.com",
"phone": "03-1234-5678",
"address": "東京都渋谷区...",
"industry": "IT",
"email": "info@example.com",
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-02-01T12:00:00Z"
}
}PATCH
/api/v1/crm/companies/{id}Update a company
Update information for the specified company.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Company ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Optional | Company name |
website | string | Optional | Website URL |
phone | string | Optional | Phone number |
address | string | Optional | Address |
industry | string | Optional | Industry |
email | string | Optional | Primary email |
note | string | Optional | Note |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Company | Optional | Updated company |
Code Examples
curl -X PATCH "https://api.blueai.jp/api/v1/crm/companies/comp_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>" \
-H "Content-Type: application/json" \
-d '{
"name": "株式会社サンプル(更新)",
"phone": "03-9876-5432"
}'Response Example
{
"company": {
"id": "comp_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"name": "株式会社サンプル(更新)",
"website": "https://example.com",
"phone": "03-9876-5432",
"address": "東京都渋谷区...",
"industry": "IT",
"email": "info@example.com",
"created_at": "2026-01-10T09:00:00Z",
"updated_at": "2026-02-01T12:00:00Z"
}
}DELETE
/api/v1/crm/companies/{id}Delete a company
Delete the specified company.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Company ID |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | Deletion success flag |
Code Examples
curl -X DELETE "https://api.blueai.jp/api/v1/crm/companies/comp_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"success": true
}