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

# Personal Keys Create

> Create a personal API key with explicit access and password verification. The new key is returned once; it is not stored in an operation receipt. Requires the explicit operation scope and current actor access.

Create a personal API key with explicit access and password verification. The new key is returned once; it is not stored in an operation receipt.

Requires a scoped personal key, the authenticated account, and personal\_keys.manage. Current role and credential grants remain enforced. See [Agent messaging and project operations](https://docs.sendrealm.com/tutorials/agent-messaging-project-operations.md) for authorization and recovery.


## OpenAPI

````yaml api-reference/openapi.json POST /project-operations/personal_keys_create
openapi: 3.0.1
info:
  title: Sendrealm API
  description: >-
    API for email, push, audience resources, domains, campaign drafts,
    templates, events, topics, and automations
  license:
    name: MIT
  version: 0.4.0
servers:
  - url: https://api.sendrealm.com
security:
  - bearerAuth: []
paths:
  /project-operations/personal_keys_create:
    post:
      tags:
        - Agent project operations
      summary: >-
        Create a personal API key with explicit access and password
        verification. The new key is returned once; it is not stored in an
        operation receipt.
      description: >-
        Create a personal API key with explicit access and password
        verification. The new key is returned once; it is not stored in an
        operation receipt. Requires the explicit operation scope and current
        actor access.
      operationId: personal_keys_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/McpAdministrationPersonalKeysCreate'
      responses:
        '200':
          description: Authorized result, preparation, or durable execution receipt.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  data:
                    $ref: '#/components/schemas/McpProjectResource'
                additionalProperties: false
                required:
                  - status
                  - data
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Personal credential required or expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Scope, current role or project grant denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource unavailable or feature disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Stale preparation or conflicting resource state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Operational content validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    McpAdministrationPersonalKeysCreate:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
          description: Display name.
        current_password:
          type: string
          minLength: 1
          maxLength: 1024
          description: >-
            Write-only current account password. Required for creating keys or
            widening personal key access.
          writeOnly: true
        scopes:
          type: array
          minItems: 1
          maxItems: 100
          uniqueItems: true
          description: Explicit operation scopes supported by personal_keys_list.
          items:
            type: string
            minLength: 1
            maxLength: 120
            description: Operation scope.
        grants:
          type: array
          minItems: 1
          maxItems: 500
          description: Explicit team/project grants. No new grants are implied by omission.
          items:
            type: object
            additionalProperties: false
            properties:
              team_id:
                type: string
                minLength: 1
                maxLength: 36
                description: Granted team UUID from teams_list.
                format: uuid
              project_ids:
                type: array
                maxItems: 500
                uniqueItems: true
                items:
                  type: string
                  minLength: 1
                  maxLength: 36
                  description: Owned resource UUID from the matching list operation.
                  format: uuid
            required:
              - team_id
              - project_ids
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: Future expiry timestamp; null means no expiration.
        creator_access:
          type: boolean
          description: >-
            Allow this key to receive grants for teams/projects it creates.
            Requires explicit create scopes.
      required:
        - name
        - current_password
        - scopes
        - grants
      x-sendrealm-mcp-contract: true
    McpProjectResource:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        targeting:
          $ref: '#/components/schemas/McpTargetingDefinition'
        readiness:
          $ref: '#/components/schemas/McpJsonValue'
      additionalProperties:
        $ref: '#/components/schemas/McpJsonValue'
      required:
        - id
      x-sendrealm-mcp-contract: true
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              $ref: '#/components/schemas/JsonValue'
            issues:
              type: array
              items:
                $ref: '#/components/schemas/ValidationIssue'
    McpTargetingDefinition:
      type: object
      properties:
        version:
          type: integer
          enum:
            - 1
          description: Targeting contract version.
        base:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  description: Explicitly target all eligible contacts.
                  enum:
                    - all_contacts
              required:
                - type
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  description: Target the selected static audiences.
                  enum:
                    - static_audiences
                audience_ids:
                  type: array
                  items:
                    type: string
                    description: Audience UUID returned by audiences_list.
                    format: uuid
                  description: >-
                    Included audience IDs; empty means an incomplete draft,
                    never all contacts.
                  maxItems: 100
              required:
                - type
                - audience_ids
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  description: Explicitly target subscribed push devices.
                  enum:
                    - all_subscribed_devices
              required:
                - type
              additionalProperties: false
        excluded_audience_ids:
          type: array
          items:
            type: string
            description: Excluded audience UUID.
            format: uuid
          description: Audiences excluded after base selection.
          maxItems: 100
        contact_rules:
          $ref: '#/components/schemas/McpTargetingRule'
        push_rules:
          $ref: '#/components/schemas/McpTargetingRule'
      required:
        - version
        - base
      additionalProperties: false
      description: >-
        Canonical campaign targeting. Obtain audience IDs through
        audiences_list; never infer all-contact intent from an empty selection.
      x-sendrealm-mcp-contract: true
    McpJsonValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
        - type: boolean
        - type: array
          items:
            $ref: '#/components/schemas/McpJsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/McpJsonValue'
      description: >-
        JSON application data. Do not include credentials or unnecessary
        personal data.
      x-sendrealm-mcp-contract: true
    JsonValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
        - type: boolean
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
    ValidationIssue:
      type: object
      required:
        - code
        - path
        - message
      properties:
        code:
          type: string
        path:
          type: string
          nullable: true
        message:
          type: string
    McpTargetingRule:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              description: Boolean group.
              enum:
                - group
            operator:
              type: string
              description: Combine children using this operator.
              enum:
                - and
                - or
            children:
              type: array
              items:
                $ref: '#/components/schemas/McpTargetingRule'
              description: Nested rules; maximum five group levels and 200 total nodes.
              minItems: 1
              maxItems: 200
          required:
            - kind
            - operator
            - children
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              description: One predicate.
              enum:
                - rule
            source:
              type: string
              description: Contact sources only in email/contact targeting.
              enum:
                - contact
                - device
                - device_event
                - push_event
            field:
              type: string
              description: Property or event field path.
              minLength: 1
              maxLength: 160
            operator:
              type: string
              description: Comparison; event sources use has_happened/has_not_happened.
              enum:
                - eq
                - neq
                - in
                - not_in
                - exists
                - not_exists
                - gt
                - gte
                - lt
                - lte
                - between
                - within_last
                - has_happened
                - has_not_happened
            value:
              $ref: '#/components/schemas/McpJsonValue'
            window:
              type: object
              properties:
                amount:
                  type: integer
                  minimum: 1
                  maximum: 3650
                  description: Window size.
                unit:
                  type: string
                  description: Window unit.
                  enum:
                    - hours
                    - days
                    - weeks
              required:
                - amount
                - unit
              additionalProperties: false
          required:
            - kind
            - source
            - field
            - operator
          additionalProperties: false
      description: Version-one targeting predicate.
      x-sendrealm-mcp-contract: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Integration key for backend workloads, or a scoped personal key
        (sr_user_) for account discovery and supported project operations. MCP
        accepts only personal keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.