Creating regions
Use the following endpoints to create (POST) a region:
- POST
/admin/v1/regions - POST
/admin/v1/users/{userId}/regions - POST
/admin/v1/groups/{groupId}/regions
The only required field is the region name. Each region name must be
unique.
For example, the following request creates the US state of Washington region.
Command
POST /admin/v1/regions
Request
{
"data": {
"attributes": {
"name": "Washington"
}
}
}
Response
{
"data": {
"attributes": {
"id": "cc:Sj0KaTWM3tqJlaULUXA2f",
"name": "Washington"
},
...Associating a region with a user
In this example, a user (Samara Morgan) in ClaimCenter
(cc:SUdo6f9ApMOjeo8axIAOz) is designated to cover a certain
region (the US state of Washington (cc:Sj0KaTWM3tqJlaULUXA2)). An
object in the request uses the region id to supply this information.
Command
POST /admin/v1/users/cc:SUdo6f9ApMOjeo8axIAOz/regionsRequest
{
"data": {
"attributes": {
"region": {
"id": "cc:Sj0KaTWM3tqJlaULUXA2f"
}
}
}
}Response
{
"data": {
"attributes": {
"id": "cc:SF9mh1OtCMcMZH6MLhlob",
"region": {
"displayName": "Washington",
"id": "cc:Sj0KaTWM3tqJlaULUXA2f",
"type": "Region",
"uri": "/admin/v1/regions/cc:Sj0KaTWM3tqJlaULUXA2f"
}
},
...