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

# Update Targets

> Updates a specific target by ID



## OpenAPI

````yaml PUT /targets/{targetid}
openapi: 3.0.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: http://base.url.com
security:
  - apiKey: []
paths:
  /targets/{targetid}:
    put:
      description: Updates a specific target by ID
      operationId: updateTargets
      requestBody:
        description: Target to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTarget'
        required: true
      responses:
        '200':
          description: Target updates successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Target'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: You do not have permission to access this resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
components:
  schemas:
    CreateTarget:
      type: object
      required:
        - first_name
        - last_name
        - email
        - position
      properties:
        first_name:
          type: string
          description: First name of the user
        last_name:
          type: string
          description: Last name of the user
        email:
          type: string
          format: email
          description: Email address of the user
        position:
          type: string
          description: Position or role of the user within the organization
        age:
          type: integer
          description: Age of the user
          format: int32
        gender:
          type: string
          description: Gender of the user
          enum:
            - Male
            - Female
            - Other
        phone_number:
          type: string
          description: Phone number of the user
        groups:
          type: array
          description: List of group IDs the user belongs to
          items:
            type: string
    Target:
      type: object
      required:
        - name
        - surname
        - email
        - position
        - phone
      properties:
        name:
          type: string
          description: First name of the target
        surname:
          type: string
          description: Surname of the target
        group:
          type: string
          description: Group the target belongs to
          nullable: true
        email:
          type: string
          format: email
          description: Email address of the target
        position:
          type: string
          description: Position or role of the target within the organization
        phone:
          type: string
          description: Phone number of the target
        gender:
          type: string
          description: Gender of the target
          enum:
            - male
            - female
            - other
          nullable: true
        age:
          type: integer
          description: Age of the target
          format: int32
          nullable: true
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    ForbiddenError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
          description: Error code representing the type of error
          example: 403
        message:
          type: string
          description: A message describing the error
          example: You do not have permission to access this resource.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-phishy-api-key

````