# Deprecated field-first history write

This retired address for writing a trader's field value always returns `404 ROUTE_NOT_FOUND` and never saves anything.

- Endpoint: `POST https://api.returning.ai/v1/communities/{communityId}/user-fields/{fieldId}/users/{userId}/histories`
- Section: Users and data / Field history
- Authentication: `Authorization: Bearer <API_KEY>` (Community API key)
- Permission: `None` (No permission is checked; every request returns the same 404)
- Retries: Never succeeds; don't retry, move to the current write
- Guide: hand-written
- Verified: live, 2026-09-27
- Last updated: 26 Sep 2026
- Web page: https://docs.returning.ai/api-reference/user-fields-user-field-history/deprecated-field-first-history-write

## When to use this

- Older code still calls this address and gets `404 ROUTE_NOT_FOUND`; move it to the current write.
- You're checking whether an old integration can still write field values this way. It can't.

**Instead:** Use [Update a user field value](https://docs.returning.ai/api-reference/user-fields-user-field-history/update-a-user-field-value.md) instead. It takes the same body, with the trader before the field in the path.

**Deprecated:** This address no longer works. Every request returns `404 ROUTE_NOT_FOUND`, whatever the key, community, field, trader or body.

## Authentication

- Header: `Authorization: Bearer <API_KEY>`
- Permission: `None`

This address checks no API key and no permission: every request gets the same `404`. The current write, [Update a user field value](https://docs.returning.ai/api-reference/user-fields-user-field-history/update-a-user-field-value.md), needs a Community API key with the `userFields` permission, shown in the dashboard as User Fields.

## Behaviour

This is the old field-first shape of the field value write. It's retired: it never writes a value and never adds a history entry. To move to the current write, swap the two path segments and keep everything else:

```
Old: /v1/communities/{communityId}/user-fields/{fieldId}/users/{userId}/histories
New: /v1/communities/{communityId}/users/{userId}/user-fields/{fieldIdOrName}/histories
```

The body stays the same, for example `{"value": "verified", "action": "overwrite"}`. The current write also accepts an `Idempotency-Key` header.

## Request

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `communityId` | `string` | Yes | Not checked. Any value gets the same `404`. |
| `fieldId` | `string` | Yes | Not checked. In the current write, the field key or `_id` goes after the trader. |
| `userId` | `string` | Yes | Not checked. In the current write, the trader comes before the field. |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | `string` | No | Not checked. Any key, or none, gets the same `404`. (`Bearer <API_KEY>`) |

### Example request

```bash
curl --request POST \
  --url https://api.returning.ai/v1/communities/66f000000000000000000010/user-fields/kycstatus/users/3247779/histories \
  --header 'Authorization: Bearer <API_KEY>'
```

## Response

There's no success response. Every request returns `404` with `meta.code` `ROUTE_NOT_FOUND` and `meta.replacementRoute` naming the current write. The `method` and `route` fields tell this apart from a trader or field that doesn't exist.

## Errors

The code is in `meta.code`. The one exception is a request with no `Authorization` header and a JSON body, which returns `400` with a non-JSON body instead.

### Fix the request

| Status | Code | What to do |
| --- | --- | --- |
| 400 | - | No `Authorization` header was sent with a JSON body. This returns `400` with a non-JSON body (`Request body must encrypted`) before the address is even checked. The address is still retired; move to Update a user field value. |

### Do not retry

| Status | Code | What to do |
| --- | --- | --- |
| 404 | `ROUTE_NOT_FOUND` | The address is retired. Call Update a user field value, `POST /v1/communities/{communityId}/users/{userId}/user-fields/{fieldIdOrName}/histories`, with the same body. `meta.replacementRoute` names it. This 404 doesn't mean the trader or field is missing. |

**Retries:** Don't retry. This address never succeeds, however often you call it or with whatever key. Move the call to [Update a user field value](https://docs.returning.ai/api-reference/user-fields-user-field-history/update-a-user-field-value.md) instead.

## Next step

- [Update a user field value](https://docs.returning.ai/api-reference/user-fields-user-field-history/update-a-user-field-value.md): `POST /v1/communities/{communityId}/users/{userId}/user-fields/{fieldIdOrName}/histories`. The current write. Same body, such as `{"value": "verified", "action": "overwrite"}`, with the trader before the field in the path.
- [Read the result back with Get a trader's field history](https://docs.returning.ai/api-reference/user-fields-user-field-history/get-a-traders-field-history.md): `GET /v1/communities/{communityId}/users/{userId}/user-fields/{fieldIdOrName}/histories`.
