# integrationReadiness

```graphql
query IntegrationReadiness($projectReference: String!, $name: String!, $toolName: String!) {
  integrationReadiness(projectReference: $projectReference, name: $name, toolName: $toolName) {
    version
    selection {
      projectId
      integration
      toolName
      requestedConnectionId
      state
      mode
      scope
      connectionId
      connectionGenerationId
    }
    connection {
      state
    }
    account {
      state
      id
      displayName
      evidence
    }
    credentials {
      evidence
      missingKeys
    }
    localEligibility {
      state
      basis
      requiredCapability
      blockers
      pendingChecks
    }
    providerVerification {
      state
    }
  }
}
```

Check whether one integration tool can run now in a project, before a run or to explain why a run was blocked; returns the selected connection, its state and the local blockers from stored metadata only, where a blocked or missing selection is a result and the provider is not contacted. Requires project.integrations.read.

## Arguments

| Name                             | Type    | Required | Description                                                                                                                     |
| -------------------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `projectReference`               | String! | Yes      | Project ID or slug. The caller needs project.integrations.read on it. Run tokens and service accounts are refused as forbidden. |
| `name`                           | String! | Yes      | Integration name, 1 to 128 characters.                                                                                          |
| `toolName`                       | String! | Yes      | Qualified tool name in the namespace of the integration, 1 to 256 characters.                                                   |
| `connectionId`                   | ID      |          | Exact connection to evaluate.                                                                                                   |
| `expectedConnectionGenerationId` | ID      |          | Observed generation of the connection. Requires connectionId.                                                                   |

## Variables

```json
{
  "projectReference": "string",
  "name": "string",
  "toolName": "string"
}
```

## Responses

| Status | Description                                                     |
| ------ | --------------------------------------------------------------- |
| 200    | The SelectedIntegrationReadiness! in data.integrationReadiness. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query IntegrationReadiness($projectReference: String!, $name: String!, $toolName: String!) {\n  integrationReadiness(projectReference: $projectReference, name: $name, toolName: $toolName) {\n    version\n    selection {\n      projectId\n      integration\n      toolName\n      requestedConnectionId\n      state\n      mode\n      scope\n      connectionId\n      connectionGenerationId\n    }\n    connection {\n      state\n    }\n    account {\n      state\n      id\n      displayName\n      evidence\n    }\n    credentials {\n      evidence\n      missingKeys\n    }\n    localEligibility {\n      state\n      basis\n      requiredCapability\n      blockers\n      pendingChecks\n    }\n    providerVerification {\n      state\n    }\n  }\n}",
  "variables": {
    "projectReference": "string",
    "name": "string",
    "toolName": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "integrationReadiness": {
      "version": 0,
      "selection": {
        "projectId": "string",
        "integration": "string",
        "toolName": "string",
        "requestedConnectionId": "string",
        "state": "string",
        "mode": "string",
        "scope": "string",
        "connectionId": "string",
        "connectionGenerationId": "string"
      },
      "connection": {
        "state": "string"
      },
      "account": {
        "state": "string",
        "id": "string",
        "displayName": "string",
        "evidence": "string"
      },
      "credentials": {
        "evidence": "string",
        "missingKeys": [
          "string"
        ]
      },
      "localEligibility": {
        "state": "string",
        "basis": "string",
        "requiredCapability": "string",
        "blockers": [
          "string"
        ],
        "pendingChecks": [
          "string"
        ]
      },
      "providerVerification": {
        "state": "string"
      }
    }
  }
}
```
