> ## Documentation Index
> Fetch the complete documentation index at: https://wundergraphinc-brendan-add-sof-link.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Request Payload Structure

> Definition of the request payload structure for Subgraph Check Extension.

When the Subgraph Check Extension is triggered, your registered endpoint receives a request with a `JSON` payload
containing information about the check. You can use this information to decide whether to discard the check or perform
any additional linting on your subgraphs.

If no option is enabled in the [namespace configuration](/studio/subgraph-check-extensions#configuration), no file
is generated and the `url` field will be `undefined` or not present in the request payload.

## SubgraphCheckExtensionPayload

| Field            | Type                                          | Description                                                                                                                                  |
| ---------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `actorId`        | `string`                                      | The unique identifier of the actor that triggered the check.                                                                                 |
| `checkId`        | `string`                                      | The unique identifier of the check.                                                                                                          |
| `labels`         | [`LabelInfo[]`](#labelinfo)                   | Contains the labels used to trigger the check. This field will not be present when `subgraphs` is defined.                                   |
| `organization`   | [`OrganizationContext`](#organizationcontext) | Information about the organization that triggered the check.                                                                                 |
| `namespace`      | [`NamespaceContext`](#namespacecontext)       | Information about the associated namespace.                                                                                                  |
| `vcsContext`     | [`VCSContext`](#vcscontext)                   | Details about the Version Control System (VCS) that triggered the check. This field is only included when the check is initiated from a VCS. |
| `affectedGraphs` | [`AffectedGraphInfo[]`](#affectedgraphinfo)   | A list of all graphs affected by the check.                                                                                                  |
| `subgraphs`      | [`SubgraphContext[]`](#subgraphcontext)       | A list of all subgraphs that triggered the check. This field is only included when the check is for an existing subgraph.                    |
| `url`            | `string` or `undefined`                       | The URL from which the bulk data file can be downloaded.                                                                                     |

<Note>
  You can access the URL provided in the `url` field for *5 minutes* after the request arrives.
</Note>

### LabelInfo

Provides information about the labels used to trigger the check.

| Field  | Type     | Description            |
| ------ | -------- | ---------------------- |
| `key`  | `string` | The key of the label.  |
| `name` | `string` | The name of the label. |

### OrganizationContext

Provides information about the organization that triggered the check.

| Field  | Type     | Description                                |
| ------ | -------- | ------------------------------------------ |
| `id`   | `string` | The unique identifier of the organization. |
| `slug` | `string` | The slug of the organization.              |

### NamespaceContext

Provides information about the associated namespace.

| Field  | Type     | Description                             |
| ------ | -------- | --------------------------------------- |
| `id`   | `string` | The unique identifier of the namespace. |
| `name` | `string` | The display name of the namespace.      |

### VCSContext

Provides details about the Version Control System (VCS) that triggered the check. This field is only included when the check is initiated from a VCS.

| Field       | Type     | Description                                          |
| ----------- | -------- | ---------------------------------------------------- |
| `author`    | `string` | The email address of the commit author.              |
| `commitSha` | `string` | The SHA hash of the commit that triggered the check. |
| `branch`    | `string` | The branch name associated with the commit.          |

### AffectedGraphInfo

Provides information about the graphs affected by the check.

| Field  | Type     | Description                         |
| ------ | -------- | ----------------------------------- |
| `id`   | `string` | The unique identifier of the graph. |
| `name` | `string` | The name of the graph.              |

### SubgraphContext

Provides information about the subgraphs that triggered the check. This field is only included when the check is for an existing subgraph.

| Field       | Type                        | Description                                                      |
| ----------- | --------------------------- | ---------------------------------------------------------------- |
| `id`        | `string`                    | The unique identifier of the subgraph.                           |
| `labels`    | [`LabelInfo[]`](#labelinfo) | The list of labels the subgraph is associated with.              |
| `name`      | `string`                    | The name of the subgraph.                                        |
| `isDeleted` | `boolean`                   | Indicates whether the check was triggered by a deleted subgraph. |

## TypeScript definition

```typescript theme={null}
interface LabelInfo {
  key: string;
  name: string;
}

interface OrganizationInfo {
  id: string;
  slug: string;
}

interface NamespaceInfo {
  id: string;
  name: string;
}

interface VCSContext {
  author: string;
  commitSha: string;
  branch: string;
}

interface AffectedGraphInfo {
  id: string;
  name: string;
  namespace: NamespaceInfo;
}

interface SubgraphInfo {
  id: string;
  labels: LabelInfo[];
  name: string;
  isDeleted: boolean;
}

interface SubgraphCheckExtensionPayload {
  actorId: string;
  checkId: string;
  labels: LabelInfo[] | undefined;
  organization: OrganizationInfo;
  namespace: NamespaceInfo;
  vcsContext: VCSContext | undefined;
  affectedGraphs: AffectedGraphInfo[];
  url: string;
  subgraphs: SubgraphInfo[] | undefined;
}
```
