Skip to content

Commit

Permalink
docs: Fix bulk-identities API example
Browse files Browse the repository at this point in the history
  • Loading branch information
rolodato authored Jun 19, 2024
1 parent 8d46e06 commit 4e5f7a5
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions docs/docs/clients/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,23 +378,32 @@ assert delete_identity_response.status_code == 204

### Bulk Uploading Identities and Traits

You can achieve this with a `POST` to the `identities` endpoint:
You can achieve this with a `POST` to the `bulk-identities` endpoint. To delete a trait, set its `trait_value` to `null`.

```bash
curl -X "POST" "https://edge.api.flagsmith.com/api/v1/identities/?identifier=<identity_id>" \
-H 'X-Environment-Key: <Your Environment Key>' \
-H 'Content-Type: application/json; charset=utf-8' \
curl -i -X POST "https://edge.api.flagsmith.com/api/v1/bulk-identities" \
-H "X-Environment-Key: ${FLAGSMITH_ENVIRONMENT_KEY}" \
-H 'Content-Type: application/json' \
-d $'{
"traits": "traits": [
{
"trait_key": "this_key",
"trait_value": "this_value"
},
{
"trait_key": "this_key2",
"trait_value": "this_value2"
}
],
"identifier": "<identity_id>"
}'
"data": [
{
"identifier": "my_identifier_1",
"traits": [
{
"trait_key": "my_key_name",
"trait_value": "set from POST /bulk-identities"
}
]
},
{
"identifier": "my_identifier_2",
"traits": [
{
"trait_key": "some_other_key_name",
"trait_value": "if this identity does not exist, it will be created by this request"
}
]
}
]
}'
```

0 comments on commit 4e5f7a5

Please sign in to comment.