How to set import mode(or strategy) when insert or import org with web api?

I got “message” : "Found matching object for given reference, but import mode is CREATE. Identifier was UID, and object was …

when I using importStrategy=CREATE_AND_UPDATE,it’s still got this error.
I learn from the api doc:
stategy: CREATE_AND_UPDATE, CREATE, UPDATE, DELETE
importMode COMMIT, VALIDATE
importStrategy CREATE_AND_UPDATE, CREATE, UPDATE, DELETE

this option also no help to the problem!!

https://play.dhis2.org/2.34.3/api/34/organisationUnits?strategy=UPDATE&importStrategy(strategy)=UPDATE&mergeMode=REPLACE&importMode=UPDATE
this URL has been tested, still got :
{
“httpStatus” : “Conflict”,
“httpStatusCode” : 409,
“status” : “ERROR”,
“message” : “One more more errors occurred, please see full details in import report.”,
“response” : {
“responseType” : “ObjectReport”,
“uid” : “DiszpKrYNg8”,
“klass” : “org.hisp.dhis.organisationunit.OrganisationUnit”,
“errorReports” : [ {
“message” : “Found matching object for given reference, but import mode is CREATE. Identifier was UID, and object was Ngelehun CHC [DiszpKrYNg8] (OrganisationUnit).”,
“mainKlass” : “org.hisp.dhis.organisationunit.OrganisationUnit”,
“errorCode” : “E5000”,
“mainId” : “DiszpKrYNg8”,
“errorProperties” : [ “UID”, “Ngelehun CHC [DiszpKrYNg8] (OrganisationUnit)” ]
} ]
}
}

now I can deal with update specified org with api: [api/34/organisationUnits?](https://play.dhis2.org/2.34.3/api/34/organisationUnits/{org_id}?mergeMode=MERGE (PUT method)
I don’t know whether this is the only way to update org?

Hi @lin_xd, back to your question, orgUnits are metadatas. Metadatas can be created (POST) or updated (PATCH / PUT).

Fore more information, you can check this link on API operations on Metadata: Web API - DHIS2 Documentation

Thanks