Skip to content

References

Create

The Batch API enables you to create multiple references simultaneously. Simply specify the desired operations under the references.create path in the Batch payload.

{
  "references": {
    "create": [
      {
        "body": {
          "source": "65970becbc241d0001ccdd43",
          "target": "c253c98231776d0c8a54879e",
          "type": 2
        }
      },
      {
        "body": {
          "source": "c253c98231776d0c8a54879e",
          "target": "4b131856bb51f7fa1aace0db",
          "type": 7
        }
      }
    ]
  }
}

A create operation consists of:

  • body: An object that represents the reference that you are creating. It MUST include a source, target and type.
  • batchId: An optional identifier provided by the user.

The following are the most common body fields used when creating a reference. The The Batch API schema contains a full overview of which fields may be included.

field Required Description Type
source yes The OID or Batch Id of the source component. string
target yes The OID or Batch Id of the target component. string
type yes The type identifier of the reference integer
displayText no An optional label that is displayed in some visualizations string
description no An optional description string
customFields no Custom fields and values for the component. object

Update

The Batch API enables you to update multiple references simultaneously. Simply specify the desired operations under the references.update path in the Batch payload.

{
  "references": {
    "create": [
      {
        "id": "86286a7786f678092872a797",
        "ifVersionMatch": "latest",
        "body": {   
          "source": "65970becbc241d0001ccdd43",
        }
      },
      {        
        "id": "a676520b982789b98bf87191",
        "ifVersionMatch": 13,
        "body": {          
          "target": "4b131856bb51f7fa1aace0db",          
        }
      }
    ]
  }
}

An update operation consists of the following:

  • id: The Ardoq OID of the reference that you are updating.
  • ifVersionMatch: Either the current version (integer) of the reference that you are updating or the string "latest" that will implicitly use the latest version. For more information we have a section that covers versioning. For most use cases simply using "latest" is fine.
  • body: An object that represents the changes that you wish to make.

When updating a reference only the fields included in the body will be updated. The The Batch API schema contains a full overview of which fields may be included. The most important are:

field Required Description Type
source no The OID or Batch Id of the source component. string
target no The OID or Batch Id of the target component. string
displayText no An optional label that is displayed in some visualizations string
description no An optional description string
customFields no Custom fields and values for the component. object

Delete

The Batch API enables you to delete multiple references simultaneously. Simply specify the desired operations under the references.delete path in the Batch payload.

{
  "references": {
    "delete": [
      {"id": "86286a7786f678092872a797"},
      {"id": "a676520b982789b98bf87191"},
      {"id": "779af5fa652387a2982789b8"}
    ]
  }
}

A delete operation consists of the following:

  • id: The Ardoq OID of the reference that you are deleting.