Skip to main content
BlueAI
Home/CRM/Companies

Companies

Register and manage partner companies.

|

Endpoints

GET/api/v1/crm/companiesList companies
POST/api/v1/crm/companiesCreate 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/companies

List companies

Retrieve companies within the organization with pagination. Supports name search.

Authentication requiredInclude session cookie or Bearer token

Query Parameters

NameTypeRequiredDescription
limit
integerOptionalNumber of items per page (default: 50, max: 200)
offset
integerOptionalNumber of items to skip
search
stringOptionalPartial match search by company name
sort
stringOptionalSort key (created_at, name)
order
stringOptionalSort order (asc / desc)

Response Fields

NameTypeRequiredDescription
Company[]OptionalArray of companies
total
numberOptionalTotal count
limit
numberOptionalItems per page
offset
numberOptionalNumber 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/companies

Create a company

Register a new company.

Authentication requiredInclude session cookie or Bearer token

Request Body

NameTypeRequiredDescription
name
stringRequiredCompany name
website
stringOptionalWebsite URL
phone
stringOptionalPhone number
address
stringOptionalAddress
industry
stringOptionalIndustry
email
stringOptionalPrimary email
note
stringOptionalNote

Response Fields

NameTypeRequiredDescription
CompanyOptionalCreated 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 requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringRequiredCompany ID

Response Fields

NameTypeRequiredDescription
CompanyOptionalCompany 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 requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringRequiredCompany ID

Request Body

NameTypeRequiredDescription
name
stringOptionalCompany name
website
stringOptionalWebsite URL
phone
stringOptionalPhone number
address
stringOptionalAddress
industry
stringOptionalIndustry
email
stringOptionalPrimary email
note
stringOptionalNote

Response Fields

NameTypeRequiredDescription
CompanyOptionalUpdated 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 requiredInclude session cookie or Bearer token

Path Parameters

NameTypeRequiredDescription
id
stringRequiredCompany ID

Response Fields

NameTypeRequiredDescription
success
booleanOptionalDeletion 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
}