POST
/
user
/
relationships
curl --request POST \
--url https://api.village.do/v1/user/relationships \
--header 'Content-Type: application/json' \
--header 'user-identifier: <user-identifier>' \
--header 'x-access-token: <api-key>' \
--data '{
"defaultScore": 7,
"relationships": [
"[email protected]",
"linkedin.com/in/johndoe",
"[email protected]"
]
}'
{
  "success": true,
  "summary": {
    "processed": 3,
    "created": 2,
    "updated": 1,
    "failed": 0
  },
  "results": [
    {
      "identifier": "[email protected]",
      "status": "created",
      "person": {
        "id": "person-123",
        "name": "John Doe",
        "linkedin": "linkedin.com/in/johndoe"
      }
    },
    {
      "identifier": "[email protected]",
      "status": "updated",
      "person": {
        "id": "person-456",
        "name": "Jane Smith",
        "linkedin": null
      }
    }
  ]
}

Authorizations

x-access-token
string
header
required

JWT token obtained from /users/authorization endpoint

Headers

user-identifier
string
required

Specify the user making the request. This identifier should match the one you used when integrating the user with Village. Not needed when using user token authentication.

Body

application/json
relationships
array
required

Array of relationship identifiers. Can be strings, objects with scores, or mixed.

Required array length: 1 - 100 elements
defaultScore
number

Optional default score applied to all relationships without explicit score

Required range: 0 <= x <= 10
Example:

7

Response

Relationships imported successfully

success
boolean
required

Whether the operation was successful

Example:

true

summary
object
required

Summary of the import operation

results
object[]
required

Detailed results for each relationship