Catalog Attributes

Assign terms to attributes in batch

Assign terms to catalog item attributes.

Terms assigned through the API always have the source MANUAL.

The request accepts a data array of 1 to 100 items, where each item names one attribute in attributeUrn and the terms to assign to it in termUrns. Each item is processed independently: a failure on one item doesn't affect the other items. Results are returned in the same order as the request items, and each item can carry an optional id of your choice, which is returned in the corresponding result item.

An item fails with the status TERM_ALREADY_ASSIGNED when a term is already assigned to the attribute. To make a migration safe to rerun, treat this status as success or skip the terms that are already assigned.

post/catalog/v1/attributes/term-assignments/batch/assign

Request

Request body

Example request

{
  "data": [
    {
      "id": "item-1",
      "attributeUrn": "urn:ata:acme-corp:catalog:catalog-attribute:123e4567-e89b-12d3-a456-426614174000",
      "termUrns": [
        "urn:ata:acme-corp:catalog:term:1ede1262-f76b-4d00-9929-e92c15d8a5ba"
      ]
    },
    {
      "id": "item-2",
      "attributeUrn": "urn:ata:acme-corp:catalog:catalog-attribute:8875f356-1b8c-43f4-8e15-651feacfca2e",
      "termUrns": [
        "urn:ata:acme-corp:catalog:term:1ede1262-f76b-4d00-9929-e92c15d8a5ba"
      ]
    }
  ]
}

Response

Batch request processed. The meta summary reports the totals (total, success, fail), and results reports the per-item outcomes in the same order as the request items. Each result reports its own status: OK when all terms in the item were processed. Any other value indicates failure and is accompanied by an error whose type matches the status.

The results don't return the attribute's assigned terms. To verify the outcome, retrieve the attribute with GET /catalog/v1/attributes/{urn}.

Example response

{
  "meta": {
    "total": 2,
    "success": 2
  },
  "results": [
    {
      "status": "OK"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.