---
title: Create a case link
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Case Management
---

# Create a case link{% #create-a-case-link %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                         |
| ----------------- | ---------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/cases/link |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/cases/link |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/cases/link      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/cases/link      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/cases/link  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/cases/link     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/cases/link |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/cases/link |

### Overview

Creates a directional link between two cases (for example, case A blocks case B). The parent and child cases and their relationship type must be specified.

OAuth apps require the `cases_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#case-management) to access this endpoint.



### Request

#### Body Data (required)

Case link create request.

{% tab title="Model" %}

| Parent field | Field                                | Type   | Description                                                                                                                                                                                                                                                                                          |
| ------------ | ------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]               | object | Data object for creating a case link.                                                                                                                                                                                                                                                                |
| data         | attributes [*required*]         | object | Attributes describing a directional relationship between two entities (cases, incidents, or pages).                                                                                                                                                                                                  |
| attributes   | child_entity_id [*required*]    | string | The UUID of the child (target) entity in the relationship.                                                                                                                                                                                                                                           |
| attributes   | child_entity_type [*required*]  | string | The type of the child entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`.                                                                                                                                                                                                      |
| attributes   | parent_entity_id [*required*]   | string | The UUID of the parent (source) entity in the relationship.                                                                                                                                                                                                                                          |
| attributes   | parent_entity_type [*required*] | string | The type of the parent entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`.                                                                                                                                                                                                     |
| attributes   | relationship [*required*]       | string | The type of directional relationship. Allowed values: `RELATES_TO` (bidirectional association), `CAUSES` (parent causes child), `BLOCKS` (parent blocks child), `DUPLICATES` (parent duplicates child), `PARENT_OF` (hierarchical), `SUCCESSOR_OF` (sequence), `ESCALATES_TO` (priority escalation). |
| data         | type [*required*]               | enum   | JSON:API resource type for case links. Allowed enum values: `link`                                                                                                                                                                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d",
      "child_entity_type": "CASE",
      "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f",
      "parent_entity_type": "CASE",
      "relationship": "BLOCKS"
    },
    "type": "link"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing a single case link.

| Parent field | Field                                | Type   | Description                                                                                                                                                                                                                                                                                          |
| ------------ | ------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]               | object | A directional link representing a relationship between two entities. At least one entity must be a case.                                                                                                                                                                                             |
| data         | attributes [*required*]         | object | Attributes describing a directional relationship between two entities (cases, incidents, or pages).                                                                                                                                                                                                  |
| attributes   | child_entity_id [*required*]    | string | The UUID of the child (target) entity in the relationship.                                                                                                                                                                                                                                           |
| attributes   | child_entity_type [*required*]  | string | The type of the child entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`.                                                                                                                                                                                                      |
| attributes   | parent_entity_id [*required*]   | string | The UUID of the parent (source) entity in the relationship.                                                                                                                                                                                                                                          |
| attributes   | parent_entity_type [*required*] | string | The type of the parent entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`.                                                                                                                                                                                                     |
| attributes   | relationship [*required*]       | string | The type of directional relationship. Allowed values: `RELATES_TO` (bidirectional association), `CAUSES` (parent causes child), `BLOCKS` (parent blocks child), `DUPLICATES` (parent duplicates child), `PARENT_OF` (hierarchical), `SUCCESSOR_OF` (sequence), `ESCALATES_TO` (priority escalation). |
| data         | id [*required*]                 | string | The case link identifier.                                                                                                                                                                                                                                                                            |
| data         | type [*required*]               | enum   | JSON:API resource type for case links. Allowed enum values: `link`                                                                                                                                                                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d",
      "child_entity_type": "CASE",
      "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f",
      "parent_entity_type": "CASE",
      "relationship": "BLOCKS"
    },
    "id": "804cd682-55f6-4541-ab00-b608b282ea7d",
    "type": "link"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Unauthorized
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/cases/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d",
      "child_entity_type": "CASE",
      "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f",
      "parent_entity_type": "CASE",
      "relationship": "BLOCKS"
    },
    "type": "link"
  }
}
EOF 
                
{% /tab %}
