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

# Create or Update Account



## OpenAPI

````yaml POST /accounts
openapi: 3.0.3
info:
  title: HacktionBase Public API
  version: 1.0.0
  description: Public ingestion API for users, accounts and events tracking.
servers:
  - url: https://api.hacktionbase.com/v1
security:
  - bearerAuth: []
paths:
  /accounts:
    post:
      summary: Create or update an account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountUpsertRequest'
      responses:
        '202':
          description: Accepted
      security:
        - bearerAuth: []
components:
  schemas:
    AccountUpsertRequest:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          example: org_456
        name:
          type: string
        plans:
          type: array
          description: >
            Reserved structured attribute — the account's commercial plans.
            Sending this array replaces the account's plans entirely; an empty
            array clears them; omitting it leaves them unchanged.
          items:
            $ref: '#/components/schemas/PlanItem'
        attributes:
          type: object
          additionalProperties: true
    PlanItem:
      type: object
      required:
        - key
        - label
      properties:
        key:
          type: string
          description: >-
            Free-form, lowercased plan identifier used for filtering and
            segmentation.
          example: pro
        label:
          type: string
          description: Human-readable plan name.
          example: Pro Monthly
        period:
          type: string
          enum:
            - daily
            - weekly
            - monthly
            - yearly
            - custom
        price:
          type: number
          minimum: 0
        currency:
          type: string
          description: ISO 4217 code. Required when `price` is set.
          example: USD
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: APIKey

````