For the POST API request can you help with below request body?

Hi,
I am using Postman for requestingn the datasets for various entity.
However its giving me error.
Can you please guide?
POST request :
https://api.opensanctions.org/match/default?algorithm=best&include_dataset=us_sam_exclusions&include_dataset=gb_hmt_sanctions&include_dataset=eu_fsf&include_dataset=un_sc_sanctions

As per the document: yente
If I post the request body as :
“queries”: {
“entity1”: {
“schema”: “Person”,
“properties”: {
“name”: [“John Doe”],
“birthDate”: [“1975-04-21”],
“nationality”: [“us”]
}
},
“entity2”: {
“schema”: “Company”,
“properties”: {
“name”: [“Brilliant Amazing Limited”],
“jurisdiction”: [“hk”],
“registrationNumber”: [“84BA99810”]
}
}
}

It gives me error:
422
Unprocessable Content

Can you please help?
I can get reuls for below:
{
“queries”: {
“query1”: {
“schema”: “Organization”,
“properties”: {
“name”: [“SSAB EMEA AB”],
“jurisdiction”: [“se”]

        }
    }
}

}

Hi, thanks for reaching out!

I just tried with the query (which I had to modify a bit because Discourse mangled the quotes, likely)

BATCH = {
        "queries": {
            "entity1": {
                "schema": "Person",
                "properties": {
                    "name": ["John Doe"],
                    "birthDate": ["1975-04-21"],
                    "nationality": ["us"]
                    }
                },
            "entity2": {
                "schema": "Company",
                "properties": {
                    "name": ["Brilliant Amazing Limited"],
                    "jurisdiction": ["hk"],
                    "registrationNumber": ["84BA99810"]
                    }
                }
            }
        }

and got the following back:

{'entity1': {'query': {'id': None,
                       'properties': {'birthDate': ['1975-04-21'], 'name': ['John Doe'], 'nationality': ['us']},
                       'schema': 'Person'},
             'results': [{'caption': 'JOHN DEE BONE JR',
                          'datasets': ['us_sam_exclusions'],
                          'features': {'person_name_jaro_winkler': 0.7999999999999999,
                                       'person_name_phonetic_match': 0.5},
                          'first_seen': '2024-05-09T07:55:01',
                          'id': 'us-fed-excl-john-dee-bone-83660-parma',
                          'last_change': '2024-12-08T07:55:03',
                          'last_seen': '2025-07-02T08:46:50',
                          'match': False,
                          'properties': {'address': ['PARMA, ID 83660, USA'],
                                         'country': ['us'],
                                         'createdAt': ['2017-10-24'],
                                         'firstName': ['JOHN'],
                                         'lastName': ['BONE'],
                                         'middleName': ['DEE'],
                                         'name': ['JOHN DEE BONE JR'],
                                         'topics': ['debarment']},
                          'referents': [],
                          'schema': 'Person',
                          'score': 0.64,
                          'target': True,
                          'token': None}],
             'status': 200,
             'total': {'relation': 'eq', 'value': 0}},
 'entity2': {'query': {'id': None,
                       'properties': {'jurisdiction': ['hk'],
                                      'name': ['Brilliant Amazing Limited'],
                                      'registrationNumber': ['84BA99810']},
                       'schema': 'Company'},
             'results': [],
             'status': 200,
             'total': {'relation': 'eq', 'value': 0}}}

So I’m not quite sure what the issue is here… maybe some malformatted JSON that you’re sending? Maybe you cloud play around with that a bit to make sure nothing is off there?

If it still doesn’t work, maybe there is a way for you to show the raw HTTP request that Postman is sending so I can look into this more?

All the best,
Leon

Hi Leon,

Thanks for reaching out.
I was able to make it work, you were right the JOSN format was not accurate.
I changed it and now it’s working like a charm. :slightly_smiling_face:

1 Like