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

# Update participant

> Changes an existing participant. Only the given attributes are written, the others keep their value. The participant has to belong to the requesting user — identified by the private token or, for anonymous users, by the X-POLLUNIT-USER-IDENTIFIER header — and the poll has to still accept votes. Admins may additionally change other participants of voting and table polls that do not anonymize or hide their participants.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/polls/{poll_id}/voters/{id}
openapi: 3.0.1
info:
  title: PollUnit API
  version: v1
  description: Programmatic access to PollUnit.
servers:
  - url: https://pollunit.com
    description: Production
  - url: http://localhost:3000
    description: Development
security:
  - bearerAuth: []
paths:
  /api/v1/polls/{poll_id}/voters/{id}:
    parameters:
      - name: poll_id
        in: path
        description: Poll member_hash or admin_hash
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: Voter public_id
        required: true
        schema:
          type: string
      - name: organization_id
        in: query
        required: false
        description: >-
          public_id of an organization the user belongs to. When given, the
          request runs in that organization context instead of the personal
          account.
        schema:
          type: string
    patch:
      tags:
        - Voters
      summary: Update participant
      description: >-
        Changes an existing participant. Only the given attributes are written,
        the others keep their value. The participant has to belong to the
        requesting user — identified by the private token or, for anonymous
        users, by the X-POLLUNIT-USER-IDENTIFIER header — and the poll has to
        still accept votes. Admins may additionally change other participants of
        voting and table polls that do not anonymize or hide their participants.
      parameters:
        - name: X-POLLUNIT-USER-IDENTIFIER
          in: header
          required: false
          description: >-
            Your own identification of the user on whose behalf the request is
            made, any string. The user identifiers should not be guessable and
            stay secret, otherwise users could get access to other users'
            contents. Only used with a public API token: the created or changed
            object belongs to that anonymous user instead of the token owner,
            which keeps the user in control of it in later requests with the
            same identifier.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoterUpdateRequest'
      responses:
        '200':
          description: participant updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voter'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: forbidden (the participant belongs to somebody else)
        '404':
          description: participant not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '422':
          description: invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      security:
        - bearerAuth: []
components:
  schemas:
    VoterUpdateRequest:
      type: object
      properties:
        voter:
          type: object
          description: >-
            Only the given attributes are written, the others keep their value.
            Terms and privacy policy use their stored attribute names here, not
            the `terms` / `privacy_policy` names of the create request.
          properties:
            user_name:
              type: string
              nullable: true
            additional_attributes:
              type: object
              nullable: true
              description: >-
                Values for the poll's `additional_attributes`. Omit to keep the
                stored values; when given, the hash replaces all of them, so it
                has to carry every required value.
            terms_accepted:
              type: boolean
              nullable: true
            privacy_policy_accepted:
              type: boolean
              nullable: true
      required:
        - voter
    Voter:
      type: object
      description: >-
        A participant of the poll. Which fields are returned depends on the poll
        type and on your access level: `complete` only for surveys,
        `required_option_votes_complete` only when the poll requires a vote on
        all options, and the moderation fields only with admin access.
      properties:
        id:
          type: string
          description: Voter public_id
        user_name:
          type: string
          nullable: true
          description: >-
            Name of the participant. A generated name when the poll has
            `anonymize_voter_names`.
        changed_by_admin:
          type: boolean
          nullable: true
          description: The votes of this participant were changed by an admin.
        complete:
          type: boolean
          nullable: true
          description: 'Surveys only: the participant finished the survey.'
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
        fraudulent:
          type: boolean
          nullable: true
          description: Admin access only
        paid:
          type: boolean
          nullable: true
          description: >-
            Admin access only. `false` while a voting fee for this participant
            is still open.
        required_option_votes_complete:
          type: boolean
          nullable: true
          description: >-
            Admin access only, and only when the poll has
            `option_vote_requirement` `all_options`.
        privacy_policy_accepted:
          type: boolean
          nullable: true
          description: >-
            Admin access only, and only when the poll has
            `privacy_policy_for_voters`.
        terms_accepted:
          type: boolean
          nullable: true
          description: Admin access only, and only when the poll has `terms_for_voters`.
      required:
        - id
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
    NotFound:
      type: object
      properties:
        error:
          type: string
          example: Not Found
    Errors:
      type: object
      properties:
        error:
          type: string
          example: Unprocessable Entity
        errors:
          type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: Personal API token — find yours under My Account → API.

````