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

# Update a target

> Replaces the target value and confirms authorization for the new value. Changing a value resets status to pending and clears the previous review note. The new value must be approved before testing. Approval status cannot be set by this endpoint.



## OpenAPI

````yaml /reference/openapi.yaml patch /targets/{id}
openapi: 3.1.0
info:
  title: Antigen API
  version: v1
  description: >-
    Work with the same agents, runs, and resources your team uses in Antigen.
    Requests and responses use camelCase fields. List endpoints return arrays.
    See the [overview](/reference) for authentication, updates, and errors.
servers:
  - url: https://api.antigen.sh/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Retrieve, compose, and register agent configurations.
  - name: Models
    description: Models available to agents in your organization.
  - name: Targets
    description: Submit testing scope for human approval.
  - name: Runs
    description: Execute agents and control their work.
  - name: Vulnerabilities
    description: Track weaknesses, remediation, status, and assignment.
  - name: Evidence
    description: Read supporting file metadata and retrieve file contents.
  - name: Reports
    description: Read and export captured engagement results.
  - name: Human tasks
    description: Ask people for help and follow their responses.
  - name: Hooks
    description: Connect status and assignment changes to your own service.
  - name: Asset Map
    description: Read your organization’s infrastructure graph.
  - name: Integrations
    description: Inspect and disconnect provider connections.
  - name: API keys
    description: Create and revoke credentials for automation.
paths:
  /targets/{id}:
    patch:
      tags:
        - Targets
      summary: Update a target
      description: >-
        Replaces the target value and confirms authorization for the new value.
        Changing a value resets status to pending and clears the previous review
        note. The new value must be approved before testing. Approval status
        cannot be set by this endpoint.
      operationId: updateTarget
      parameters:
        - name: id
          in: path
          required: true
          description: Opaque resource identifier.
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TargetInput'
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Target'
              example:
                id: target_123
                value: api.staging.example.com
                status: pending
                reviewNote: null
                createdAt: '2026-09-13T10:00:00.000Z'
                updatedAt: '2026-09-13T10:00:00.000Z'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '429':
          $ref: '#/components/responses/Error429'
components:
  schemas:
    TargetInput:
      type: object
      properties:
        value:
          type: string
          description: >-
            Domain, wildcard domain, or IP address. Submit each value as a
            separate target.
          minLength: 1
        attested:
          type: boolean
          const: true
          description: Confirms that your organization is authorized to test this target.
      required:
        - value
        - attested
      additionalProperties: false
      example:
        value: api.example.com
        attested: true
    Target:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        value:
          type: string
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
        reviewNote:
          type:
            - string
            - 'null'
          description: Review note from the Antigen team.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - value
        - status
        - reviewNote
        - createdAt
        - updatedAt
      additionalProperties: false
      example:
        id: target_123
        value: api.example.com
        status: approved
        reviewNote: null
        createdAt: '2026-09-13T10:00:00.000Z'
        updatedAt: '2026-09-13T10:00:00.000Z'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable error code.
            message:
              type: string
              description: Description of the problem.
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      example:
        error:
          code: invalid_request
          message: The target value is required.
  responses:
    Error400:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: Check the request fields and values.
    Error401:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Supply a valid API key.
    Error403:
      description: Permission denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: The API key does not permit this operation or requested scope.
    Error404:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: The resource does not exist in this organization.
    Error409:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: conflict
              message: The resource’s current state does not allow this operation.
    Error429:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Retry after the interval in Retry-After.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 1
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key from your organization. Supply the value directly, without a
        Bearer prefix.

````