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

# Update a Nucleus contact

> Partially updates a contact. The contact's ID is passed in the JSON body as `contactId` (NOT in the URL path, this endpoint operates on the collection root).

**Allowed fields:** `name`, `email`, `phone`, `company`, `role`, `notes`, `relationshipType`. At least one must be present.

Returns the updated contact. Returns 404 if no contact with that ID is owned by the caller.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/nucleus/contacts
openapi: 3.1.0
info:
  title: Audity Agent API
  version: 1.0.0
  summary: >-
    The agent-facing surface of Audity AI: projects, leads, Nucleus, and
    account.
  description: >-
    Audity is a B2B SaaS for consultants who run automated business audits. This
    API is the agent-facing slice: a deliberately small set of task-shaped
    endpoints that lets external AI agents (Claude, ChatGPT, Cursor, n8n) act on
    a consultant's Audity workspace on their behalf.


    **Authentication:** Bearer token (`aky_...`) issued from
    `https://app.auditynow.com/dashboard/settings/api-tokens`. The middleware
    resolves the token to a Clerk user identity; tier and Row-Level Security
    gates apply automatically.


    **Rate limits:** reads 100/min, writes 20/min, async job polling 120/min;
    some expensive or high-volume endpoints have stricter caps. 429 responses
    include `Retry-After`.


    **Tier gating:** public plan names can change faster than API enum names.
    Use `GET /api/user/tier` and any `requiredTier` field in 403 responses as
    the source of truth for a specific account. Read-only or
    lead-generation-focused plans can read available data; audit-capable paid
    plans unlock writes, subject to token scope and credits.
  contact:
    name: Audity Support
    email: support@auditynow.com
    url: https://app.auditynow.com
  license:
    name: Proprietary
    identifier: LicenseRef-Audity-Proprietary
  termsOfService: https://auditynow.com/terms
servers:
  - url: https://app.auditynow.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: >-
      Audit project lifecycle, create, list, fetch, trigger analysis, get
      deliverables.
  - name: Leads
    description: ReadyLink-sourced leads, list, fetch, convert into projects.
  - name: Nucleus
    description: >-
      Nucleus is Audity's persistent memory + insight layer. Search memories,
      capture notes, read proactive insights, manage contacts.
  - name: Account
    description: Identity, tier, credits, usually called once per session for context.
  - name: ReadyLinks
    description: >-
      Manage ReadyLinks, the survey distribution links that generate leads. CRUD
      operations for links, customization, lead tracking.
  - name: Assessment Configs
    description: >-
      Manage assessment configurations that define survey questions, order,
      scoring, and customization.
  - name: Jobs
    description: >-
      Monitor async job status for long-running operations like audit analysis
      synthesis.
paths:
  /api/nucleus/contacts:
    patch:
      tags:
        - Nucleus
      summary: Update a Nucleus contact
      description: >-
        Partially updates a contact. The contact's ID is passed in the JSON body
        as `contactId` (NOT in the URL path, this endpoint operates on the
        collection root).


        **Allowed fields:** `name`, `email`, `phone`, `company`, `role`,
        `notes`, `relationshipType`. At least one must be present.


        Returns the updated contact. Returns 404 if no contact with that ID is
        owned by the caller.
      operationId: updateContact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactInput'
            example:
              contactId: 550e8400-e29b-41d4-a716-446655440000
              role: VP of Engineering
              notes: Promoted Q2.
      responses:
        '200':
          description: Contact updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NucleusContact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/NucleusForbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    UpdateContactInput:
      type: object
      description: >-
        Partial update payload. The target contact ID is passed in the JSON
        body, not the URL path.
      properties:
        contactId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        email:
          type:
            - string
            - 'null'
          format: email
        phone:
          type:
            - string
            - 'null'
        company:
          type:
            - string
            - 'null'
        role:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
        relationshipType:
          type:
            - string
            - 'null'
          enum:
            - client
            - prospect
            - partner
            - referral
            - null
      required:
        - contactId
    NucleusContact:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type:
            - string
            - 'null'
          format: email
        phone:
          type:
            - string
            - 'null'
        company:
          type:
            - string
            - 'null'
        role:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
        relationshipType:
          type:
            - string
            - 'null'
          enum:
            - client
            - prospect
            - partner
            - referral
        lastInteractionAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - createdAt
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
        details:
          type: string
          description: Additional context (development only).
      required:
        - error
    ErrorWithCode:
      type: object
      description: >-
        Error response with an optional stable `code` field. When present,
        branch on `code` (the human-readable `error` may change). Some 403/400
        responses omit `code` (e.g. generic feature-disabled gates).
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: >-
            Stable error code, when applicable. Examples: `EMPTY_PATCH`,
            `INVALID_DESCRIPTION_TYPE`, `DESCRIPTION_TOO_LONG`, `PAT_MALFORMED`,
            `PAT_ROUTE_NOT_ALLOWED`, `PAT_NOT_SUPPORTED_FOR_ENDPOINT`,
            `PAT_SCOPE_INSUFFICIENT`, `PAT_DISABLED`.
      required:
        - error
  responses:
    BadRequest:
      description: Validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
    NucleusForbidden:
      description: >-
        One of three cases:

        - Nucleus is not enabled for this user (free Nucleus flag).

        - The PAT is missing a required scope (write endpoints need `write`;
        reads succeed if the token has `read` OR no explicit scopes).

        - The PAT is hitting an endpoint the agent allowlist excludes (rare on
        Nucleus).


        Branch on the `code` field: `PAT_SCOPE_INSUFFICIENT` for scope errors,
        otherwise treat as Nucleus disabled.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorWithCode'
          examples:
            nucleusDisabled:
              summary: Nucleus feature flag off
              value:
                error: Nucleus is not available
            scopeInsufficient:
              summary: Token missing write scope on a write endpoint
              value:
                error: 'Token missing required scope(s): write'
                code: PAT_SCOPE_INSUFFICIENT
    NotFound:
      description: Resource not found, or you don't have access (RLS).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Audity Personal Access Token (aky_...)
      description: >-
        A Personal Access Token issued from
        https://app.auditynow.com/dashboard/settings/api-tokens. Format:
        `aky_<32 random chars>`.

````