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

# Create a firm

> Creates a service firm under the caller's owner and returns it with its Slate-assigned `firmId`; place accounts with it via a placement's `firmId` field.



## OpenAPI

````yaml /api-reference/accounts/openapi.yaml post /v1/firms
openapi: 3.0.0
info:
  title: Accounts API (DRAFT)
  version: 0.0.1
  contact:
    name: Slate API Support
    email: api-support@slate.inc
    url: https://slate.inc
  description: >-
    **DRAFT. Shapes, names, and field sets may change before this is finalized**

    The Accounts API is how an owner keeps Slate's view of its accounts in sync.
    An **account** is the primary data entity that Slate services against,
    mapping to the originating account that the debt is associated with.

    **Two identifiers.** Slate assigns each account a stable UUID, `accountId` —
    this is the canonical id and the key for every read and targeted update. You
    also carry your own identifier for the account, `crid` (the account number
    in your system), which is unique within your organization (`owner`). You do
    not know Slate's `accountId` until the account has been created, so the
    first write is an **upsert** keyed on your `crid`; the response returns the
    assigned `accountId`, which you use from then on (and can re-resolve any
    time via `GET /v1/accounts?crid=...`).

    **Upsert.** `POST /v1/accounts` idempotently creates the account if new or
    updates it if one already exists for your `(owner, crid)`. Send the
    account's current state as a full snapshot — this is how a daily inventory
    feed keeps Slate in sync. Targeted updates use a partial `PATCH
    /v1/accounts/{accountId}` — send only the fields that changed (balance,
    status, placement, legal, …) — for owners that prefer not to resend the
    whole account.

    **Scoping & auth.** Every request is scoped to a single `owner`; `crid` is
    unique only within an owner. List requests take a required `owner` query
    parameter (which your token must be authorized to read); writes are scoped
    to the single `owner` on your bearer token.

    **Money.** All monetary amounts are **US dollars with two decimal places**,
    sent and returned as decimal **strings** (e.g. `"1250.75"`) to avoid
    floating-point rounding. Do not send minor units (cents) or bare JSON
    numbers.
servers:
  - url: https://api.slate.inc/accounts
    description: Production
  - url: https://api.uat.slate.inc/accounts
    description: UAT (staging)
security:
  - bearerAuth: []
paths:
  /v1/firms:
    post:
      summary: Create a firm
      description: >-
        Creates a service firm under the caller's owner and returns it with its
        Slate-assigned `firmId`; place accounts with it via a placement's
        `firmId` field.
      operationId: createFirm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FirmRequest'
      responses:
        '201':
          description: A new firm was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Firm'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    FirmRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Human-readable firm name.
        metadata:
          $ref: '#/components/schemas/Metadata'
    Firm:
      type: object
      description: A service firm managed by an owner. Placements reference it by `firmId`.
      required:
        - firmId
        - owner
        - firmCode
        - name
      properties:
        firmId:
          type: string
          format: uuid
          readOnly: true
          description: >-
            Slate's stable UUID for the firm — the canonical identifier,
            assigned by Slate on create.
        owner:
          type: string
          description: The organization that manages this firm.
        firmCode:
          type: string
          readOnly: true
          description: The firm's oliver firm code, generated by Slate on create.
        name:
          type: string
          description: Human-readable firm name.
        metadata:
          $ref: '#/components/schemas/Metadata'
    Metadata:
      type: object
      description: >-
        Custom key/value pairs you can attach to an object for reporting,
        analytics, or attributes Slate does not model natively — inspired by
        Stripe metadata. Values are strings. Limits: at most 50 keys, each key
        at most 40 characters and each value at most 500 characters. On a
        partial update (PATCH) the keys you send are merged into the existing
        metadata; send a key with an empty-string value to remove it. An account
        upsert (full snapshot) replaces the whole map.
      additionalProperties:
        type: string
      example:
        region: west
        portfolio_tier: gold
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: A human-readable description of what went wrong.
  responses:
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, invalid, or insufficiently scoped credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected internal error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Owner-scoped bearer token. The `owner` all requests are scoped to is
        derived from the token.

````