> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List source webhooks

> List the webhooks declared in the source files of a project, a branch or an environment to see what a deployment creates; returns the declared webhooks, the discovery diagnostics and the source files that could not be read, without pagination.

`sourceWebhooks(projectReference: ID!, input: SourceWebhooksInput): SourceWebhookList!`

Requires project.agents.read.

## Arguments

| Argument | Type | Required | Description |
| - | - | - | - |
| `projectReference` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Yes | Project UUID or slug. |
| `input` | [`SourceWebhooksInput`](https://veryfront.com/docs/cloud/graphql/types/sourcewebhooksinput) | No | |

## Input fields

### input

[`SourceWebhooksInput`](https://veryfront.com/docs/cloud/graphql/types/sourcewebhooksinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `sourceTargetKind` | [`WebhookSourceTargetKind`](https://veryfront.com/docs/cloud/graphql/types/webhooksourcetargetkind) | No | The source to read; default runtimeTargetKind, else project. |
| `runtimeTargetKind` | [`WebhookRuntimeTargetKind`](https://veryfront.com/docs/cloud/graphql/types/webhookruntimetargetkind) | No | |
| `targetEnvironmentId` | [`ID`](https://veryfront.com/docs/cloud/graphql/types/id) | No | Required with runtimeTargetKind environment. |
| `targetBranchId` | [`ID`](https://veryfront.com/docs/cloud/graphql/types/id) | No | Required with runtimeTargetKind preview\_branch. |

## Response

Returns [`SourceWebhookList!`](https://veryfront.com/docs/cloud/graphql/types/sourcewebhooklist). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `data` | [`[SourceWebhook!]!`](https://veryfront.com/docs/cloud/graphql/types/sourcewebhook) | |
| `diagnostics` | [`[ProjectSourceFileDiagnostic!]!`](https://veryfront.com/docs/cloud/graphql/types/projectsourcefilediagnostic) | |
| `errors` | [`[ProjectSourceFileDiagnostic!]!`](https://veryfront.com/docs/cloud/graphql/types/projectsourcefilediagnostic) | Source files that could not be read or parsed. |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
query SourceWebhooks($projectReference: ID!, $input: SourceWebhooksInput) {
  sourceWebhooks(projectReference: $projectReference, input: $input) {
    data {
      id
      name
      definitionSource
      description
      editMode
    }
    diagnostics {
      code
      details
      kind
      message
      sourceId
    }
    errors {
      code
      details
      kind
      message
      sourceId
    }
  }
}
```

```json title="variables.json" theme={null}
{
  "projectReference": "00000000-0000-4000-8000-000000000001"
}
```

<details>
  <summary>Try this query</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Query

  Variables (JSON)
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.