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

# Rename a User Personal Access Token

### Auth

Requires `pats:create`, not `pats:delete` — a rename leaves the token's `value` intact, so it relabels the credential rather than revoking it. The rename applies to the caller's own Logto personal access tokens, keyed on the token's subject. No active organization is needed — user PATs aren't org-bound.

### Response

Same shape as one element of the [List User Personal Access Tokens](/api-reference/pats/list-user-pats) response, reflecting the new name.

### Errors

| Status          | Cause                                                          |
| --------------- | -------------------------------------------------------------- |
| `404 Not Found` | No token with the given current `name` in Logto for this user. |
| `409 Conflict`  | A token with `new_name` already exists for the caller.         |


## OpenAPI

````yaml PATCH /user-pats/{name}
openapi: 3.1.0
info:
  title: anycrm-api
  version: 0.0.1
servers: []
security: []
tags:
  - name: Customer Intelligence
    description: >-
      Company research and ICP-fit scoring — create a research run, track its
      progress, and read back scored companies as leads.
  - name: Outreach
    description: >-
      The cold-email management console — domains, mailboxes, and campaigns — as
      a thin control plane over the SalesForge stack.
  - name: AnyCard
    description: >-
      Authenticated CRUD for AnyCard, the org's digital business-card /
      lead-capture product.
  - name: AnyCard Events
    description: >-
      Event-attribution analytics for AnyCard — which captured leads converted,
      broken down by source, owner, and deal.
  - name: AnyCard Share Links
    description: >-
      Unauthenticated endpoints reached by anyone who scans a QR code or opens a
      shared AnyCard link.
  - name: AI
    description: >-
      A streaming (SSE) AI chat endpoint with account-commit actions it can take
      on the caller's behalf.
  - name: Analytics Assistant
    description: >-
      The natural-language analytics assistant — a guarded text-to-SQL loop
      (SSE) that answers ad-hoc questions over the org's CRM data as a
      least-privilege, read-only database role.
  - name: Account Readiness
    description: >-
      Account Readiness Profiles — AI-scored signals on whether an account is
      ready for outreach or expansion, computed via a Temporal workflow.
  - name: Integrations
    description: >-
      Pipedream Connect — issuing connect tokens and managing the org's
      connected third-party accounts.
  - name: Feedback
    description: >-
      User-submitted platform feedback (bug reports, feature requests) — global,
      not scoped to one organization.
  - name: Public Media
    description: >-
      Unauthenticated image reads for publicly-embeddable assets (card photos,
      inline email images) — allowlisted by key shape; everything else in the
      storage bucket stays private.
  - name: Service Health
    description: Service liveness.
paths:
  /user-pats/{name}:
    patch:
      tags:
        - User PATs
      summary: Rename User Pat
      operationId: rename_user_pat_user_pats__name__patch
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            description: >-
              The PAT's current name, not an id — user PATs are addressed by
              name and have no local database row.
            title: Name
          description: >-
            The PAT's current name, not an id — user PATs are addressed by name
            and have no local database row.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPatRenameRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPatResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UserPatRenameRequest:
      properties:
        new_name:
          type: string
          title: New Name
          description: >-
            New name for the token; must still be unique among the caller's user
            PATs (409 on collision).
      type: object
      required:
        - new_name
      title: UserPatRenameRequest
    UserPatResponse:
      properties:
        name:
          type: string
          title: Name
        value:
          type: string
          title: Value
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Expires At
      type: object
      required:
        - name
        - value
      title: UserPatResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````