PilotFoxDocs

Replace a user's traits

PUT
/api/v1/sites/{siteId}/users/{userId}/traits

Replaces every trait of the user's profile (a null value drops that key), creating the profile when there is none; the traits take 4 KB of JSON at most (400 past it).

Requires users:write on the site (an API key, or a signed-in member's role). Share links: 401.

Authorization

headerx-api-key<token>

An organization API key (ak_…), with the permissions and the sites it was created with. For servers and scripts: no cookie and no Origin check. Also accepted as Authorization: Bearer ak_… (apiKeyBearer). A request carries one credential: a key sent with a share token or a live session cookie is 400 (details.reason: ambiguous_credentials).

Scope: users:write

Path Parameters

siteId*string
userId*string
Length1 <= length <= 255

Request Body

application/json
  1. body
traits*

Response Body

OK

application/json
  1. response
data*
Example Request
curl -X PUT 'https://pilotfox.app/api/v1/sites/string/users/string/traits' \  -H 'Content-Type: application/json' \  -d '{  "traits": {    "property1": "string",    "property2": "string"  }}'
Example Response200
{  "data": {    "user_id": "string",    "traits": {      "property1": "string",      "property2": "string"    },    "first_seen_at": "string",    "updated_at": "string"  }}