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

# Update target

> Rename a Target and change whether newly discovered members are admitted automatically.

Updates mutable Target metadata. Query criteria, `kind`, and the Target's member rows cannot be changed here.

## Request

<ParamField path="id" type="string" required>
  Target UUID.
</ParamField>

The JSON body is an object with no required properties and no unknown top-level properties:

<ParamField body="auto_admit" type="boolean">
  Optional. If omitted, retains the current value. `true` admits future discovered members as `watching` and immediately promotes existing `proposed` members. `false` changes future discovery to `proposed`; it does not demote existing `watching` members or undo previous admissions. `excluded` members stay excluded.
</ParamField>

<ParamField body="title" type="string">
  Optional display name, 1–80 characters before trimming. The service trims a non-empty value. A whitespace-only value passes the JSON length check but falls back to the existing title. If omitted, the current title is retained.
</ParamField>

An empty `{}` is valid, but when `auto_admit` is already true it can still promote currently proposed members and synchronize generated lists. It is not guaranteed to have no side effects.

## Response

`200 OK` returns `{ "data": Target }`, including counts, stored `query`, allocation fields, and the latest `job` summary. See [Get target](/api-reference/targets/get) for the complete schema. `job.id`, `job.phase`, `job.error`, and `linkedin_url` are nullable; the other documented Target fields are non-null.

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "data": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "kind": "people",
      "name": "Palantir FDE leavers, reviewed",
      "linkedin_url": null,
      "auto_admit": true,
      "watching_count": 12,
      "proposed_count": 0,
      "excluded_count": 1,
      "current_count": 12,
      "alum_count": 0,
      "enriched_count": 12,
      "member_count": 13,
      "allocation_used": 12,
      "in_graph_count": 0,
      "query": { "input": "Palantir FDE leavers" },
      "job": {
        "id": "7b1d9b3c-0b8f-4d4d-a8b4-72ef8fbb4c81",
        "status": "done",
        "phase": "done",
        "total": 12,
        "completed": 12,
        "failed": 0,
        "error": null
      }
    }
  }
  ```
</ResponseExample>

## Examples

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl --fail-with-body --max-time 30 -X PATCH "https://api.freshtalent.ai/v1/targets/550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer $FRESHTALENT_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"title":"Palantir FDE leavers, reviewed","auto_admit":true}'
  ```

  ```js JavaScript fetch theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const id = "550e8400-e29b-41d4-a716-446655440000";
  const response = await fetch(`https://api.freshtalent.ai/v1/targets/${id}`, {
    method: "PATCH",
    signal: AbortSignal.timeout(30_000),
    headers: {
      Authorization: `Bearer ${process.env.FRESHTALENT_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ auto_admit: true }),
  });
  const body = await response.json();
  if (!response.ok) throw new Error(`${response.status}: ${JSON.stringify(body)}`);
  console.log(body.data.name, body.data.auto_admit);
  ```

  ```python Python stdlib theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import json
  import os
  import urllib.request

  payload = json.dumps({"auto_admit": True}).encode()
  request = urllib.request.Request(
      "https://api.freshtalent.ai/v1/targets/550e8400-e29b-41d4-a716-446655440000",
      data=payload,
      method="PATCH",
      headers={
          "Authorization": f"Bearer {os.environ['FRESHTALENT_API_KEY']}",
          "Content-Type": "application/json",
      },
  )
  with urllib.request.urlopen(request, timeout=30) as response:
      body = json.load(response)
  print(body["data"]["name"], body["data"]["auto_admit"])
  ```
</RequestExample>

## Lifecycle, side effects, and retry safety

The update writes `auto_admit` and `title`. Renaming also renames the default list associated with the Target. Turning `auto_admit` on synchronously promotes currently `proposed` members and synchronizes lists. Turning it off is not a rollback of prior admissions. This PATCH does not itself enqueue enrichment for the members it promotes; use the member-status operation or later worker processing for that work. Promotion is not an enrichment-completion signal.

Do not blindly replay a timed-out PATCH. A retry may rename a list or promote members after the first request already succeeded. Re-read the Target and compare `name`/`auto_admit` first. The operation has no idempotency key.

## Errors and recovery

* `400 invalid_request`: invalid JSON, wrong type, or a string outside the declared length. Fix the body.
* `401 unauthorized`, `402 payment_required`: fix API key or organization access.
* `404 not_found`: the Target is not in the authenticated organization. Do not retry unchanged.
* `429`/`5xx`: for a known-safe read, back off; for an uncertain update, reconcile with [Get target](/api-reference/targets/get) before retrying.

## Next

* [Get target](/api-reference/targets/get) to verify the accepted state.
* [List target members](/api-reference/targets/members) to inspect promoted members.
* [Accept target members](/api-reference/targets/admit) for explicit per-member status changes.
