# Upsert a company

`POST /company/update`

Upsert a company on the Pinnacle platform

## Authentication

Send your API key in the `PINNACLE-API-Key` header.

## Request body

Optional.

Content type: `application/json`.

### Fields

- `companyId` — `string`, optional. Optional company ID. If provided, updates existing company. If not provided, creates a new company.
- `company` — `Company`, optional
- `company.id` — `integer`, optional. The unique identifier for the company
- `company.createdAt` — `string`, optional, format: date-time. The date and time when the company was created
- `company.name` — `string`, optional. The name of the company
- `company.category` — `CompanyCategory`, optional, values: `Entertainment`, `Finance`, `Food & Beverage`, `Games`, `Health`, `Misc`, `News`, `Other`, `Productivity`, `Shopping & Retail`, `Social`, `Sports`, `Travel`, `Utilities`. The category of the company
- `company.address` — `string`, optional. The address of the company
- `company.ein` — `string`, optional. The Employer Identification Number (EIN) of the company
- `company.description` — `string`, optional. A description of the company
- `company.brandColor` — `string`, optional. The brand color of the company
- `company.logoUrl` — `string`, optional. The URL of the company's logo
- `company.heroUrl` — `string`, optional. The URL of the company's hero image
- `company.primaryWebsiteUrl` — `string`, optional. The primary website URL of the company
- `company.primaryWebsiteLabel` — `string`, optional. The label for the primary website URL
- `company.primaryPhone` — `string`, optional. The primary phone number of the company
- `company.primaryPhoneLabel` — `string`, optional. The label for the primary phone number
- `company.primaryEmail` — `string`, optional. The primary email address of the company
- `company.primaryEmailLabel` — `string`, optional. The label for the primary email address
- `company.privacyPolicyUrl` — `string`, optional. The URL of the company's privacy policy
- `company.tosUrl` — `string`, optional. The URL of the company's terms of service
- `company.pocName` — `string`, optional. The name of the point of contact
- `company.pocTitle` — `string`, optional. The title of the point of contact
- `company.pocEmail` — `string`, optional. The email address of the point of contact
- `company.optIn` — `string`, optional. Explain how users will opt in to receive messages.
- `company.optOut` — `string`, optional. Explain how users will opt out of receiving messages.
- `company.optOutKeywords` — `string[]`, optional. Please provide the unique keywords to opt out. Each keyword should not contain spaces.
- `company.agentUseCase` — `string`, optional. Please define what your agent will do.
- `company.expectedAgentResponses` — `string`, optional. Please provide some example messages that your agent will send.
- `company.testNumbers` — `string[]`, optional. A list of test phone numbers
- `company.status` — `string`, optional. The approval status of the company
- `company.additionalWebsites` — `object[]`, optional. A list of additional websites
- `company.additionalWebsites[].url` — `string`, optional. The URL of the additional website
- `company.additionalWebsites[].label` — `string`, optional. The label for the additional website
- `company.additionalEmails` — `object[]`, optional. A list of additional email addresses
- `company.additionalEmails[].email` — `string`, optional. The additional email address
- `company.additionalEmails[].label` — `string`, optional. The label for the additional email address
- `company.additionalPhoneNumbers` — `object[]`, optional. A list of additional phone numbers
- `company.additionalPhoneNumbers[].label` — `string`, optional. The label for the additional phone number
- `company.additionalPhoneNumbers[].phone` — `string`, optional. The additional phone number
- `companyContact` — `object`, optional
- `companyContact.primaryWebsiteUrl` — `string`, format: url. Primary website URL.
- `companyContact.primaryWebsiteLabel` — `string`, maximum length: 25. Label for the primary website.
- `companyContact.primaryPhone` — `string`. Primary phone number in international format.
- `companyContact.primaryPhoneLabel` — `string`, maximum length: 25. Label for the primary phone number.
- `companyContact.primaryEmail` — `string`, format: email. Primary email address.
- `companyContact.primaryEmailLabel` — `string`, maximum length: 25. Label for the primary email address.
- `companyContact.privacyPolicyUrl` — `string`, format: url. URL of the privacy policy.
- `companyContact.tosUrl` — `string`, format: url. URL of the terms of service.
- `messaging` — `object`, optional
- `messaging.optIn` — `string`. Explain how users will opt in to receive messages.
- `messaging.optOut` — `string`. Explain how users will opt out of receiving messages.
- `messaging.optOutKeywords` — `string[]`. Please provide the unique keywords to opt out. Each keyword should not contain spaces.
- `messaging.agentUseCase` — `string`. Please define what your agent will do.
- `messaging.expectedAgentResponses` — `string`. Please provide some example messages that your agent will send.
- `pointOfContact` — `object`, optional
- `pointOfContact.pocName` — `string`. Point of contact's name.
- `pointOfContact.pocTitle` — `string`. Point of contact's title.
- `pointOfContact.pocEmail` — `string`, format: email. Point of contact's email address.
- `optionals` — `object`, optional
- `optionals.additionalWebsites` — `object[]`, optional. List of additional websites, up to 2.
- `optionals.additionalWebsites[].url` — `string`, format: url. URL of the additional website.
- `optionals.additionalWebsites[].label` — `string`, maximum length: 25. Label for the additional website.
- `optionals.additionalPhoneNumbers` — `object[]`, optional. List of additional phone numbers, up to 2.
- `optionals.additionalPhoneNumbers[].phone` — `string`. Additional phone number in international format.
- `optionals.additionalPhoneNumbers[].label` — `string`, maximum length: 25. Label for the additional phone number.
- `optionals.additionalEmails` — `object[]`, optional. List of additional email addresses, up to 2.
- `optionals.additionalEmails[].email` — `string`, format: email. Additional email address.
- `optionals.additionalEmails[].label` — `string`, maximum length: 25. Label for the additional email address.
- `optionals.testNumbers` — `string[]`, optional

### Example

```json
{
  "companyId": "resource_01J8K3R7M9",
  "company": {
    "id": 12,
    "createdAt": "2024-10-04T03:24:56.648252+00:00",
    "name": "Test Company",
    "address": "123 Test St",
    "ein": "123456789",
    "description": "Test Description",
    "brandColor": "#000000",
    "logoUrl": "https://www.google.com",
    "heroUrl": "https://www.google.com",
    "primaryWebsiteUrl": "https://www.testcompany.com",
    "primaryWebsiteLabel": "Test Website",
    "primaryPhone": "+12345678901",
    "primaryPhoneLabel": "Test Phone",
    "primaryEmail": "test@testcompany.com",
    "primaryEmailLabel": "Test Email",
    "privacyPolicyUrl": "https://www.testcompany.com/privacy",
    "tosUrl": "https://www.testcompany.com/tos",
    "pocName": "Test Name2",
    "pocTitle": "Test Title2",
    "pocEmail": "test@name2.com",
    "optIn": "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply “STOP” to unsubscribe. Standard message and data rates may apply.",
    "optOut": "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.",
    "optOutKeywords": [
      "STOP",
      "UNSUBSCRIBE"
    ],
    "agentUseCase": "Pinnacle’s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.",
    "expectedAgentResponses": "General Inquiry: “How can I assist you today?”\nOrder Status: “Provide your order number.”\nOpt-In: “You’re now subscribed!”\nOpt-Out: “You have unsubscribed.”\nEscalation: “Connecting to a live agent.”\n",
    "testNumbers": [
      "+12345678901"
    ],
    "status": "pending",
    "additionalWebsites": [
      {
        "url": "https://www.testcompany.com",
        "label": "Test Website"
      }
    ],
    "additionalEmails": [
      {
        "email": "ttt@gmail.com",
        "label": "Test Email"
      }
    ],
    "additionalPhoneNumbers": [
      {
        "label": "Test Phone",
        "phone": "+12345678901"
      }
    ]
  },
  "companyContact": {
    "primaryWebsiteUrl": "https://pinnacle.sh",
    "primaryWebsiteLabel": "https://pinnacle.sh",
    "primaryPhone": "+14155550142",
    "primaryPhoneLabel": "+14155550142",
    "primaryEmail": "avery@example.com",
    "primaryEmailLabel": "avery@example.com",
    "privacyPolicyUrl": "https://pinnacle.sh",
    "tosUrl": "https://pinnacle.sh"
  },
  "messaging": {
    "optIn": "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply “STOP” to unsubscribe. Standard message and data rates may apply.",
    "optOut": "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.",
    "optOutKeywords": [
      "STOP",
      "UNSUBSCRIBE"
    ],
    "agentUseCase": "Pinnacle’s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.",
    "expectedAgentResponses": "General Inquiry: “How can I assist you today?”\nOrder Status: “Provide your order number.”\nOpt-In: “You’re now subscribed!”\nOpt-Out: “You have unsubscribed.”\nEscalation: “Connecting to a live agent.”\n"
  },
  "pointOfContact": {
    "pocName": "Acme Support",
    "pocTitle": "Welcome to Pinnacle",
    "pocEmail": "avery@example.com"
  },
  "optionals": {
    "additionalWebsites": [
      {
        "url": "https://pinnacle.sh",
        "label": "Customer support"
      }
    ],
    "additionalPhoneNumbers": [
      {
        "phone": "+14155550142",
        "label": "+14155550142"
      }
    ],
    "additionalEmails": [
      {
        "email": "avery@example.com",
        "label": "avery@example.com"
      }
    ],
    "testNumbers": [
      "+14155550142"
    ]
  }
}
```

## Responses

### 200

Successfully registered/updated brand

Content type: `application/json`. Schema: `object`.

- `brand` — `object`
- `brand.name` — `string`
- `brand.id` — `number`

Example:

```json
{
  "brand": {
    "id": 36,
    "name": "Test Company"
  }
}
```

### 400

Bad request due to invalid parameters like missing company id

Content type: `application/json`. Schema: `object`.

- `errors` — `string[]`, optional

Example:

```json
{
  "errors": [
    "Error Code: invalid_type\nError Message: companyId is required\nError Field: companyId\nAdditional Info: {\"expected\":\"string\",\"received\":\"undefined\"}\n"
  ]
}
```

### 401

Unauthorized access due to invalid or missing API key

Content type: `application/json`. Schema: `object`.

- `errors` — `string[]`, optional

Example:

```json
{
  "errors": [
    "Unauthorized. Please reach out to founders@trypinnacle.app for an API key."
  ]
}
```

### 500

Error updating company

Content type: `application/json`. Schema: `object`.

- `errors` — `string[]`, optional

Example:

```json
{
  "errors": [
    "Failed to update company. Please try again later."
  ]
}
```

## Machine-readable schema

[OpenAPI 3.1 JSON](https://docs.pinnacle.sh/openapi.json)
