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

# Update User Status

> Flip only the lifecycle `status` of a user — `ACTIVE`/`FLAGGED`/`BLOCKED` (NOT session statuses). `BLOCKED` adds the `vendor_data` to the system blocklist; moving away from `BLOCKED` removes that entry. Each change is recorded as a `STATUS_CHANGED` activity on the user.

export const AgentPromptAccordion = ({prompt, title = "AI Agent Integration Prompt"}) => {
  const [copied, setCopied] = React.useState(false);
  const handleCopy = e => {
    e.stopPropagation();
    if (!prompt) return;
    navigator.clipboard.writeText(prompt.trim()).then(() => {
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    });
  };
  const agents = ["Claude Code", "Codex", "Cursor", "Devin", "Windsurf", "GitHub Copilot"];
  return <div className="didit-agent-card">
      {}
      <div className="didit-agent-titlebar">
        <div className="didit-agent-dots" aria-hidden="true">
          <span className="didit-agent-dot didit-agent-dot-red"></span>
          <span className="didit-agent-dot didit-agent-dot-yellow"></span>
          <span className="didit-agent-dot didit-agent-dot-green"></span>
        </div>
        <span className="didit-agent-filename">{title}</span>
        <button type="button" className={`didit-agent-copy ${copied ? "didit-agent-copy-copied" : ""}`} onClick={handleCopy} title="Copy prompt to clipboard" aria-label={copied ? "Copied!" : "Copy prompt to clipboard"}>
          {copied ? <>
              <svg width="13" height="13" viewBox="0 0 16 16" fill="none">
                <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
              </svg>
              <span>Copied</span>
            </> : <>
              <svg width="13" height="13" viewBox="0 0 16 16" fill="none">
                <rect x="5" y="5" width="9" height="9" rx="1.5" stroke="currentColor" strokeWidth="1.5" />
                <path d="M11 5V3.5A1.5 1.5 0 0 0 9.5 2h-6A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5" stroke="currentColor" strokeWidth="1.5" />
              </svg>
              <span>Copy</span>
            </>}
        </button>
      </div>

      {}
      <pre className="didit-agent-body"><code>{prompt.trim()}</code></pre>

      {}
      <div className="didit-agent-footer">
        <span className="didit-agent-footer-label">Paste into</span>
        <div className="didit-agent-chips">
          {agents.map(name => <span key={name} className="didit-agent-chip">{name}</span>)}
        </div>
      </div>
    </div>;
};

<AgentPromptAccordion
  title="Update User Status Prompt"
  prompt={`Goal: Flip ONLY the lifecycle status of a Didit User entity. Use the full PATCH /v3/users/{vendor_data}/ when you also need to touch other fields.

Endpoint: PATCH https://verification.didit.me/v3/users/{vendor_data}/update-status/
Auth header: x-api-key: <DIDIT_API_KEY>
Content-Type: application/json

Path param:
- vendor_data (string, REQUIRED) — free-form string, NOT a UUID. URL-encode.

Request body:
- status (enum, REQUIRED) — "ACTIVE" | "FLAGGED" | "BLOCKED" (VendorUserStatusChoices, NOT the session enum).

Status semantics:
- ACTIVE  → normal. New sessions allowed for this vendor_data.
- FLAGGED → still accepted, highlighted in Console for manual review; filterable with ?status=FLAGGED.
- BLOCKED → terminal. Adds vendor_data to the system blocklist. Subsequent session creations for the same identifier are rejected with a blocklist hit. Flipping back to ACTIVE/FLAGGED removes the blocklist entry automatically.

curl:
curl -X PATCH 'https://verification.didit.me/v3/users/user-abc-123/update-status/' \\
-H 'x-api-key: YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{"status": "BLOCKED"}'

Response 200: full updated UserDetailItem (same shape as GET /v3/users/{vendor_data}/). See /reference/data-models.

Side effects:
- Toggles the system blocklist entry when entering/leaving BLOCKED.
- Writes one entry to the user's comments activity log (actor = API key identity).
- Idempotent — re-sending the same status is a no-op (no extra audit row, no extra blocklist toggle).

Failure modes:
- 400 — validation:
{ "status": "This field is required." }
{ "status": "Invalid status. Valid options are: ACTIVE, FLAGGED, BLOCKED" }
- 401 — missing/invalid x-api-key. { "detail": "Authentication credentials were not provided." }
- 403 — lacks update-status:users. { "detail": "You do not have permission to perform this action." }
- 404 — vendor_data not found (or soft-deleted). { "detail": "Not found." }
- 429 — rate-limited.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`}
/>

## Overview

Moves a [User entity](/entities/users/overview) between `ACTIVE`, `FLAGGED`, and `BLOCKED`. See [entity lifecycle](/entities/lifecycle) for the full state machine.

## When to use it

* **Block a user** after confirming fraud or a compliance breach.
* **Flag a user** pending manual review without hard-blocking them.
* **Unblock** a user after successful remediation.
* **Propagate external signals** — e.g. when your own fraud engine scores a user above a threshold, move them to `FLAGGED` via this endpoint.

## Notes

* Valid values: `ACTIVE`, `FLAGGED`, `BLOCKED`. Invalid values return 400.
* Passing a `reason` string is recommended — it is persisted and surfaced in the [audit log](/console/audit-logs) and webhook payload.
* `BLOCKED` users have all new sessions auto-declined and all new transactions auto-declined.
* Emits a `user.status.updated` webhook with `previous_status`, `status`, and `reason`.

## Enforcement

| Status    | Effect on new sessions              | Effect on new transactions                      |
| --------- | ----------------------------------- | ----------------------------------------------- |
| `ACTIVE`  | Normal flow                         | Normal flow                                     |
| `FLAGGED` | Permitted but routed to `IN_REVIEW` | Permitted; may auto-escalate depending on rules |
| `BLOCKED` | Auto-declined                       | Auto-declined                                   |

## Permissions

Role must grant `update-status:users`.

## Related

* [Entity lifecycle](/entities/lifecycle)
* [User blocklist](/entities/users/blocklist)
* [Entity webhooks](/entities/webhooks)


## OpenAPI

````yaml PATCH /v3/users/{vendor_data}/update-status/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/users/{vendor_data}/update-status/:
    patch:
      tags:
        - Users
      summary: Update user status
      description: >-
        Flip only the lifecycle `status` of a user —
        `ACTIVE`/`FLAGGED`/`BLOCKED` (NOT session statuses). `BLOCKED` adds the
        `vendor_data` to the system blocklist; moving away from `BLOCKED`
        removes that entry. Each change is recorded as a `STATUS_CHANGED`
        activity on the user.
      operationId: update_user_status
      parameters:
        - name: vendor_data
          in: path
          required: true
          schema:
            type: string
          description: Your unique identifier for the user.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - ACTIVE
                    - FLAGGED
                    - BLOCKED
                  description: >-
                    New lifecycle status. `BLOCKED` also adds the `vendor_data`
                    to the system blocklist.
            examples:
              Activate:
                summary: Reactivate the user
                value:
                  status: ACTIVE
              Flag:
                summary: Flag the user for review
                value:
                  status: FLAGGED
              Block:
                summary: Block the user (adds to system blocklist)
                value:
                  status: BLOCKED
      responses:
        '200':
          description: User status updated. Full user record returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetailItem'
              examples:
                Blocked:
                  value:
                    didit_internal_id: f4e5e1f2-94a9-4f86-8c16-2b7d9b4db418
                    vendor_data: user-abc-123
                    display_name: null
                    full_name: John Michael Doe
                    date_of_birth: '1990-05-15'
                    effective_name: John Michael Doe
                    status: BLOCKED
                    metadata:
                      tier: premium
                      source: website
                    portrait_image_url: https://<media-host>/...
                    session_count: 3
                    approved_count: 2
                    declined_count: 0
                    in_review_count: 1
                    issuing_states:
                      - USA
                    approved_emails:
                      - john@example.com
                    approved_phones:
                      - '+14155551234'
                    features:
                      ID_VERIFICATION: Approved
                      LIVENESS: Approved
                      FACE_MATCH: Approved
                      AML: Approved
                    features_list:
                      - feature: ID_VERIFICATION
                        status: Approved
                      - feature: LIVENESS
                        status: Approved
                      - feature: FACE_MATCH
                        status: Approved
                      - feature: AML
                        status: Approved
                    last_session_at: '2025-06-15T10:30:00Z'
                    last_activity_at: '2025-06-15T10:30:00Z'
                    first_session_at: '2025-06-01T08:00:00Z'
                    tags:
                      - uuid: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
                        tag:
                          uuid: e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b
                          name: VIP
                          color: '#2567FF'
                          description: null
                          source: custom
                          created_at: '2025-05-01T09:00:00Z'
                          updated_at: '2025-05-01T09:00:00Z'
                        added_by_email: analyst@acme.com
                        added_by_name: Jane Analyst
                        created_at: '2025-06-02T11:00:00Z'
                    comments:
                      - uuid: c1111111-2222-4333-8444-555555555555
                        comment_type: STATUS_CHANGED
                        comment: null
                        actor_email: null
                        actor_name: null
                        previous_status: ACTIVE
                        new_status: BLOCKED
                        previous_value: null
                        new_value: null
                        changed_fields: []
                        metadata: null
                        mentioned_emails: []
                        created_at: '2025-06-15T10:30:00Z'
                    created_at: '2025-06-01T08:00:00Z'
                    updated_at: '2025-06-15T10:30:00Z'
        '400':
          description: Missing or invalid `status`.
          content:
            application/json:
              examples:
                Missing status:
                  value:
                    status:
                      - This field is required.
                Bad status:
                  value:
                    status:
                      - >-
                        Invalid status. Valid options are: ACTIVE, FLAGGED,
                        BLOCKED
        '401':
          description: >-
            No credentials supplied. Requests to `/v3/users/*` paths without an
            `x-api-key` header (or `Authorization: Bearer` token) are rejected
            by the authentication middleware before reaching the API.
          content:
            application/json:
              examples:
                Missing credentials:
                  value:
                    detail: >-
                      You must be authenticated with a valid access token to
                      access this endpoint.
        '403':
          description: >-
            Invalid or revoked API key, or the key cannot update users for this
            application. Note: on this endpoint an *invalid* key returns `403`
            (not `401`).
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: >-
            No (non-deleted) user with the supplied `vendor_data` exists for
            this application.
          content:
            application/json:
              examples:
                Not found:
                  value:
                    detail: Not found.
        '429':
          description: >-
            Rate limit exceeded; back off and retry after the interval indicated
            in `Retry-After`.
          content:
            application/json:
              examples:
                Rate limited:
                  value:
                    detail: Request was throttled. Expected available in 30 seconds.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X PATCH
            'https://verification.didit.me/v3/users/user-abc-123/update-status/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"status": "BLOCKED"}'
        - lang: python
          label: Python
          source: |-
            import requests

            resp = requests.patch(
                'https://verification.didit.me/v3/users/user-abc-123/update-status/',
                headers={'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json'},
                json={'status': 'BLOCKED'},
            )
            resp.raise_for_status()
            print(resp.json()['status'])
        - lang: javascript
          label: JavaScript
          source: >-
            const resp = await
            fetch('https://verification.didit.me/v3/users/user-abc-123/update-status/',
            {
              method: 'PATCH',
              headers: { 'x-api-key': process.env.DIDIT_API_KEY, 'Content-Type': 'application/json' },
              body: JSON.stringify({ status: 'BLOCKED' }),
            });

            const user = await resp.json();

            console.log(user.status);
components:
  schemas:
    UserDetailItem:
      type: object
      description: >-
        Full user detail. Extends UserListItem with metadata, comments, and
        updated_at.
      allOf:
        - $ref: '#/components/schemas/UserListItem'
        - type: object
          properties:
            metadata:
              type: object
              description: >-
                Custom metadata JSON you attached to this user. Defaults to
                `{}`.
            tags:
              type: array
              description: >-
                Tag assignments. NOTE: on detail responses each entry is a tag
                *link* object (`{uuid, tag: {...}, added_by_email,
                added_by_name, created_at}`), unlike the flat `{uuid, name,
                color}` shape used on list responses.
              items:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                    description: UUID of the tag assignment (not the tag itself).
                  tag:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      name:
                        type: string
                      color:
                        type: string
                      description:
                        type: string
                        nullable: true
                      source:
                        type: string
                        enum:
                          - didit
                          - custom
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                  added_by_email:
                    type: string
                    nullable: true
                  added_by_name:
                    type: string
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
            comments:
              type: array
              items:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                  comment_type:
                    type: string
                    enum:
                      - COMMENT
                      - STATUS_CHANGED
                      - METADATA_UPDATED
                      - TAG_ADDED
                      - TAG_REMOVED
                      - PROFILE_UPDATED
                  comment:
                    type: string
                    nullable: true
                  actor_email:
                    type: string
                    nullable: true
                  actor_name:
                    type: string
                    nullable: true
                  previous_status:
                    type: string
                    nullable: true
                    enum:
                      - ACTIVE
                      - FLAGGED
                      - BLOCKED
                      - null
                  new_status:
                    type: string
                    nullable: true
                    enum:
                      - ACTIVE
                      - FLAGGED
                      - BLOCKED
                      - null
                  previous_value:
                    type: object
                    nullable: true
                    description: Previous field values for PROFILE_UPDATED entries.
                  new_value:
                    type: object
                    nullable: true
                    description: New field values for PROFILE_UPDATED entries.
                  changed_fields:
                    type: array
                    items:
                      type: string
                    description: Names of the fields changed by a PROFILE_UPDATED entry.
                  metadata:
                    type: object
                    nullable: true
                  mentioned_emails:
                    type: array
                    items:
                      type: string
                  created_at:
                    type: string
                    format: date-time
              description: >-
                Activity log and comments for this user (status changes, profile
                edits, manual notes).
            updated_at:
              type: string
              format: date-time
    UserListItem:
      type: object
      description: A verified user.
      properties:
        didit_internal_id:
          type: string
          format: uuid
          description: Didit's stable internal UUID for this user.
        vendor_data:
          type: string
          nullable: true
          description: >-
            Your unique identifier for this user (passed when creating
            sessions). This can be null when no vendor identifier was supplied.
        display_name:
          type: string
          nullable: true
          description: Custom display name set by you
        full_name:
          type: string
          nullable: true
          description: Full name extracted from verified documents
        date_of_birth:
          type: string
          format: date
          nullable: true
        effective_name:
          type: string
          nullable: true
          description: 'Best available name: display_name if set, otherwise full_name'
        status:
          type: string
          enum:
            - ACTIVE
            - FLAGGED
            - BLOCKED
          description: >-
            Lifecycle status of the user record (NOT a session status). `ACTIVE`
            is the default, `FLAGGED` marks the user for manual attention,
            `BLOCKED` prevents new sessions for this `vendor_data`.
        portrait_image_url:
          type: string
          nullable: true
          description: >-
            Presigned URL of the user's portrait photo (expires after a few
            hours)
        session_count:
          type: integer
          description: Total number of verification sessions for this user
        approved_count:
          type: integer
          description: Number of approved sessions
        declined_count:
          type: integer
          description: Number of declined sessions
        in_review_count:
          type: integer
          description: Number of sessions in review
        issuing_states:
          type: array
          items:
            type: string
          description: >-
            ISO 3166-1 alpha-3 codes of issuing countries seen on this user's
            approved ID documents, e.g. `["USA", "ESP"]`. Empty array when none.
        approved_emails:
          type: array
          items:
            type: string
          description: >-
            Verified email addresses collected from this user's approved
            sessions, e.g. `["john@example.com"]`.
        approved_phones:
          type: array
          items:
            type: string
          description: >-
            Verified phone numbers collected from this user's approved sessions,
            e.g. `["+14155551234"]`.
        features:
          type: object
          description: >-
            Aggregated per-feature status across all of this user's sessions.
            Possible keys: `ID_VERIFICATION`, `NFC`, `LIVENESS`, `FACE_MATCH`,
            `POA`, `QUESTIONNAIRE`, `EMAIL_VERIFICATION`, `PHONE`, `AML`,
            `IP_ANALYSIS`, `AGE_ESTIMATION`, `DATABASE_VALIDATION`. Possible
            values: `Approved`, `Declined`, `In Review`, `Not Finished`, `Resub
            Requested`.
        features_list:
          type: array
          items:
            type: object
            properties:
              feature:
                type: string
              status:
                type: string
          description: >-
            Same data as `features`, as an ordered array of `{feature, status}`
            objects.
        last_session_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the most recent session
        first_session_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the first session
        last_activity_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Timestamp of the most recent activity on this user (session,
            transaction, status change, data edit, etc.).
        tags:
          type: array
          items:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              name:
                type: string
              color:
                type: string
          description: Tags assigned to this user
        created_at:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````