Request

Create a context within your organization. Creating a context means issuing a new context ID and defining what it can access.

NOTE: products and resources cannot be present together.

Security
BearerAuth
Bodyapplication/json
allowTracingstring
Example:"false"
productsArray of objects

Cannot be present with resources

resourcesArray of objects

Cannot be present with products

namestring
Example:"My Context"
descriptionstring
Example:"This is my context"
curl -i -X POST \
  https://edge-platform-context-api.sitecorecloud.io/api/context/user/v1/contexts \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "allowTracing": "false",
    "products": [
      {
        "productCode": "XMCloud",
        "tenantId": "g6c3b17d-1816-40ef-bbf3-ae670311452c",
        "environment": "Live"
      }
    ],
    "resources": [
      {
        "id": "SitecorePesonalizeResource",
        "name": "My Sitecore personalize resource",
        "type": "personalize",
        "tenantId": "g6c3b17d-1816-40ef-bbf3-ae670311452c",
        "properties": [
          {
            "id": "POS",
            "value": "playwebsite"
          }
        ]
      }
    ],
    "name": "My Context",
    "description": "This is my context"
  }'

Responses

Created

Bodyapplication/json
organizationIdstringrequired
Example:"org_123ABC"
sitecoreContextIdstringrequired
Example:"f9c3b17d181640efbbf3ae670311452d"
allowTracingstringrequired
Example:"false"
typestringrequired
Example:"custom"
accountIdstringrequired
Example:"account001"
resourcesArray of items
namestring
Example:"My Context"
descriptionstring
Example:"This is my context"
createdAtstring
Example:"2025-09-22T01:00:00Z"
updatedAtstring
Example:"2025-09-22T01:00:00Z"
Response
{ "organizationId": "org_123ABC", "sitecoreContextId": "f9c3b17d181640efbbf3ae670311452d", "allowTracing": "false", "type": "custom", "accountId": "account001", "resources": [ [ … ] ], "name": "My Context", "description": "This is my context", "createdAt": "2025-09-22T01:00:00Z", "updatedAt": "2025-09-22T01:00:00Z" }