The status code alone will not be sufficient to indicate a partial response. Status code 206 sounds close by name, but is used when the client specifically requests a partial data set based on the headers.
Use 200. The request was successful in the end, and the reason for the smaller dataset is the property of your API, so additional metadata in the response to indicate that the message may be sufficient.
Assuming a JSON response:
{
"data": [ ... ],
"messages": [
"Only some data was returned due to permissions."
]
}
If you have many consumers and are concerned about backward compatibility, you can also specify the type of JSON media for a particular provider:
"Content-Type": "application/vnd.myorg-v2+json"
source
share