> ## Documentation Index
> Fetch the complete documentation index at: https://docs.standardmetrics.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update company

> Partially update company fields. Different fields are editable based on company onboarding status.

**Online companies** (already onboarded):
Only the following fields can be updated:
1. `firm_sector` (the name of the Firm Sector for this company)
2. `investment_lead_id` (the user ID of the investment lead)

**Offline or Pending companies** (not onboarded; Pending means there's an active invite):
The following fields can be updated:
1. `firm_sector`
2. `investment_lead_id`
3. `city` (the city where the company is based)
4. `description` (a description of the company)
5. `fiscal_year_end` (formatted as 'MM/DD')
6. `name` (the company name)
7. `sector` (the company's standard sector from the supported list)
8. `website` (the company's website)

**Permissions:**
- User must be authenticated via OAuth.
- User must have access to the companies.
- User must have ADMIN or EDITOR role.



## OpenAPI

````yaml patch /companies/{company_id}/
openapi: 3.0.1
info:
  title: Standard Metrics API Documentation
  description: >-
    Welcome to Standard Metric's API docs!


    To use our API you will need to make an OAuth appliction (or use an existing
    one) in the developer settings tab on your settings page and then exchange
    your client id and secret for an access token (via the `/o/token/` endpoint.
    This token can then be sent in the `Authorization` header to authenticate
    your requests to our api. See below for an example.


    All endpoints are paginated and will return a maximum of 100 results per
    page. See the endpoints below and example responses for more details on
    pagination parameters. A maximum of 120 requests per minute can be made to
    our API.


    Authentication example (with python):

    ```>>> import base64

    >>> import base64

    >>> client_id = "YOUR_CLIENT_ID"

    >>> client_secret = "YOUR_CLIENT_SECRET"

    >>> credential = f"{client_id}:{client_secret}"

    >>> base64.b64encode(credential.encode("utf-8"))

    b'ENCODED_CREDENTIAL'


    You can now exchange this credential for an access token, eg:


    curl -X POST \
        -H "Authorization: Basic ENCODED_CREDENTIAL" \
        -H "Cache-Control: no-cache" \
        -H "Content-Type: application/x-www-form-urlencoded" \
        "https://api.standardmetrics.io/o/token/" \
        -d "grant_type=client_credentials"

    You will receive the following response:


    {
        "access_token": "YOUR_ACCESS_TOKEN",
        "expires_in": 36000,
        "token_type": "Bearer",
        "scope": "read write"
    }


    Make sure not to forget to prepend "Bearer " to your access token in the
    Authorization header while making requests.
  version: '1.0'
servers:
  - url: https://api.standardmetrics.io/v1
security:
  - Bearer: []
paths:
  /companies/{company_id}/:
    patch:
      tags:
        - companies
      summary: Update company
      description: >-
        Partially update company fields. Different fields are editable based on
        company onboarding status.


        **Online companies** (already onboarded):

        Only the following fields can be updated:

        1. `firm_sector` (the name of the Firm Sector for this company)

        2. `investment_lead_id` (the user ID of the investment lead)


        **Offline or Pending companies** (not onboarded; Pending means there's
        an active invite):

        The following fields can be updated:

        1. `firm_sector`

        2. `investment_lead_id`

        3. `city` (the city where the company is based)

        4. `description` (a description of the company)

        5. `fiscal_year_end` (formatted as 'MM/DD')

        6. `name` (the company name)

        7. `sector` (the company's standard sector from the supported list)

        8. `website` (the company's website)


        **Permissions:**

        - User must be authenticated via OAuth.

        - User must have access to the companies.

        - User must have ADMIN or EDITOR role.
      operationId: companies_partial_update
      parameters:
        - name: company_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                firm_sector:
                  type: string
                  description: Firm Sector (always update-able)
                investment_lead_id:
                  type: string
                  description: Investment lead user ID (always update-able)
                city:
                  type: string
                  description: >-
                    City where the company is based (Offline or Pending
                    companies)
                description:
                  type: string
                  description: Company description (Offline or Pending companies)
                fiscal_year_end:
                  type: string
                  description: >-
                    Fiscal year end, formatted as 'MM/DD' (Offline or Pending
                    companies)
                name:
                  type: string
                  description: Company name (Offline or Pending companies)
                sector:
                  type: string
                  description: Company standard sector (Offline or Pending companies)
                  enum:
                    - B2B Software
                    - Direct-to-consumer
                    - Consumer Internet/Mobile
                    - AR/VR
                    - Life Sciences
                    - Health Technology
                    - Hardware
                    - Edtech
                    - Media
                    - Fintech
                    - Govtech
                    - Crypto/blockchain
                    - Other
                    - Logistics
                    - Insurtech
                    - Software Infrastructure
                    - Security
                    - Artificial Intelligence
                    - AG-Tech
                    - Sustainability
                    - Gaming
                website:
                  type: string
                  description: Company website (Offline or Pending companies)
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
components:
  schemas:
    Company:
      required:
        - description
        - firm_sector
        - investment_lead_id
        - logo_url
        - name
        - sector
      type: object
      properties:
        city:
          title: City
          maxLength: 255
          type: string
        description:
          title: Description
          type: string
        firm_sector:
          title: Firm sector
          type: string
        fiscal_year_end:
          title: Fiscal year end
          maxLength: 10
          minLength: 1
          type: string
        id:
          title: Id
          type: string
          readOnly: true
        invested_fund_ids:
          type: array
          readOnly: true
          items:
            minLength: 1
            type: string
        investment_lead_id:
          title: Investment lead id
          type: string
          nullable: true
        logo_url:
          title: Logo url
          minLength: 1
          type: string
        name:
          title: Name
          maxLength: 255
          minLength: 1
          type: string
        reporting_currency:
          title: Reporting currency
          minLength: 1
          type: string
          readOnly: true
        sector:
          title: Sector
          type: string
        slug:
          title: Slug
          minLength: 1
          pattern: ^[-a-zA-Z0-9_]+$
          type: string
          format: slug
          readOnly: true
        status:
          title: Status
          type: string
          readOnly: true
        unique_ref:
          title: Unique ref
          type: string
          readOnly: true
        website:
          title: Website
          maxLength: 255
          type: string
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Your valid bearer token. All Auth tokens persist for all requests. Make
        sure to replace Client Credential `Basic` tokens with `Bearer` tokens
        after retrieving your bearer token. Go to the API Reference/Setup, User
        Guides/Initial Setup, or API Reference/Get API Access Token page to get
        your token.

````