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

# Create snippet

> Create a snippet: a trigger phrase and the text it expands into. Requires snippets:write on a personal key (owk_live_). Returns 403 forbidden for managed users whose organization has turned off cloud backup.



## OpenAPI

````yaml /openapi.json post /snippets/create
openapi: 3.1.0
info:
  title: OpenWhispr API
  version: 1.0.0
  description: >-
    Manage notes, folders, transcriptions, dictionary words, snippets, and usage
    programmatically, and transcribe audio files (beta).
servers:
  - url: https://api.openwhispr.com/api/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /snippets/create:
    post:
      tags:
        - Snippets
      summary: Create snippet
      description: >-
        Create a snippet: a trigger phrase and the text it expands into.
        Requires snippets:write on a personal key (owk_live_). Returns 403
        forbidden for managed users whose organization has turned off cloud
        backup.
      operationId: createSnippet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SnippetCreateRequest'
      responses:
        '201':
          description: Created snippet.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Snippet'
        '400':
          description: >-
            Validation error — missing field or trigger outside 1-100
            characters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Missing snippets:write, a workspace key, or cloud backup turned off
            by your organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: A snippet with that trigger already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SnippetCreateRequest:
      type: object
      required:
        - trigger
        - replacement
      properties:
        trigger:
          type: string
          minLength: 1
          maxLength: 100
          description: Phrase that fires the snippet.
        replacement:
          type: string
          description: Text the trigger becomes.
    Snippet:
      type: object
      properties:
        id:
          type: string
        trigger:
          type: string
          description: Phrase that fires the snippet when dictated.
        replacement:
          type: string
          description: Text the trigger is replaced with.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key starting with owk_live_ (personal) or ow_wks_live_ (workspace —
        see space_id on the Notes/Folders endpoints below)

````