Flagsmith / Flagsmith/flagsmith

environments_identities_featurestates_update requires environment with key

Open
#2,275 3 comments 0 reactions 0 assignees View on GitHub
api bug
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

**Describe the bug**

Calling PUT endpoint `/api/v1/environments/{environment_api_key}/identities/{identity_pk}/featurestates/{id}/` with the enivronment_api_key supplied, and even with the server-side api key for the environment in the header fails unless the `environment` property is supplied.

Other similar endpoints don't need the environment explicitly specified, pulling it from the environment_api_key instead. For example using POST create the feature state

**To Reproduce**

1. Use the specified endpoint.
2. Don't provide the environment property, only the api key
3. Receive a 400 error with string "Invalid Identifier"

**Expected behavior**

Call would be successful since the environment can be determined from the key.
The error message is also unclear since it is not a problem with the identifier property.

**How are you running Flagsmith?**

- [x] Self Hosted with Docker
- [ ] Self Hosted with Kubernetes
- [ ] SaaS at flagsmith.com
- [ ] Some other way

**Additional context**

Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.