# Bug OP-7467 - Filters does not accept user id for principal in API memberships

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-7467

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 11.0.0 |
| Observed in versions |  |
| Sprint | 11.0.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### **Environment**:

Your OpenProject Version: docker openproject/community:9.0.4

Windows 10 / Firefox / English:

### **Steps to reproduce:**

1.  Create user
2.  Generate access token
3.  Use this query with filled in user's id in the principal's values `http://localhost:8080/api/v3/memberships?filters=[{ "principal": { "operator": "=", "values": ["YOUR USER ID HERE"] } }, { "project": { "operator": "=", "values": ["1"] } }, { "role": { "operator": "=", "values": ["4"] } }]` in Postman
4.  Observe response

### **Actual Behavior**

Response: 400 Bad Request

``` text
{
    "_type": "Error",
    "errorIdentifier": "urn:openproject-org:api:v3:errors:InvalidQuery",
    "message": [
        "Filters Principal is not set to one of the allowed values."
    ]
}
```

### **Expected Behavior**

Returns collection with memberships based on the filters (try default admin's id to see correct result).

Hi, 

the problem is, this does not work for newly created users, but if I add the user to some other project for instance, then it works like it should and I do not get this error message.

Are there some limitations/rules about who can be the principal or something that I am missing (I have not found anything in the docs)?

Thanks,

Best regards,

Adam
