Flagsmith / flagsmith

Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
https://flagsmith.com/
BSD 3-Clause "New" or "Revised" License
4.61k stars 350 forks source link

Implement a bulk Identity/Trait upload endpoint #1212

Open dabeeeenster opened 2 years ago

dabeeeenster commented 2 years ago

Use the async processor to queue these up and process them async.

Suggest a limit of 100 identities per request.

Implement in SDKs:

Add docs

dabeeeenster commented 1 year ago

To test and deploy!

matthewelwell commented 1 year ago

This has now been deployed to our Edge API. An example cURL request is here:

curl --location --request POST 'https://edge.api.flagsmith.com/api/v1/bulk-identities' \
--header 'Content-Type: application/json' \
-- header 'X-Environment-Key: <your key>' \
--data-raw '{
    "data": [
        {"identifier": "identity_1", "traits": [{"trait_key": "foo", "trait_value": "bar"}]},
        {"identifier": "identity_2", "traits": [{"trait_key": "foo", "trait_value": "bar"}]}
    ]
}'

We now need to work on implementing this across our server side SDKs. I've added a checklist to the description of this issue.

matthewelwell commented 1 year ago

As per a request from a customer, we should add the option to merge existing traits to this by adding a separate PUT endpoint at the same URI (with the same request body)