# addCredentials

Adds new credentials to a connector to enable integration with an external service.

### Examples

{% tabs %}
{% tab title="GraphQL" %}

```graphql
mutation AddCredentials($addCredentialsInput: AddCredentialsInput!) {
  addCredentials(addCredentialsInput: $addCredentialsInput) {
    connector {
      id
      name
      displayName
      description
      hostURL
      iconURL
      family
      credentialsType
      credentialsTypes
      brokerSupportCredentialsTypes
      disabledMultiCredentialsTypes
      credentials {
        ... on UserPasswordOnlyCredentials {
          name
          password
          credentialsId
          credentialsName
          tokenExpirationDate
          credentialsType
          isCertChecksDisabled
          hostURL
          iv
          monitoredResources
          monitorAllResources
          monitorAllNewlyCreatedResources
          brokerUsername
          brokerPassword
          brokerEnabled
          brokerHost
          brokerPort
        }
      }
      isConfigured
      isResourceAvailable
      ffKeyResourceAvailable
      resourceOptions {
        resourceName
        hideMonitorNewResourcesCheckbox
        showSettingsPerResource
      }
      resources {
        type
      }
      isOxBuiltIn
      isOpenSource
      openSourceWebsiteUrl
      openSourceLicense
      openSourceAuthor
      defaultEnabled
      comingSoon
      isDemoEnabled
      aliasFor
      identityProviderInfo {
        baseURL
        urlParams
        scope
        configText
        user_scope
      }
      gitHubAppInfo {
        baseURL
        urlPath
        configText
      }
      bitbucketAppInfo {
        baseURL
        queryParameters
        configText
      }
      awsCloudFormationInfo {
        baseURL
        urlParams
      }
      awsCloudFormationOrganizationInfo {
        baseURL
        urlParams
      }
      connectionInstructions {
        type
        title
        details
        linksToDocs {
          href
          title
        }
        permissions
        hostURL
      }
      isDiscovered
      isEmptyOfRepos
      isDevelopment
      connectorExplanation
      optionalInputFields {
        name
        credsTypes
        inputType
        key
        ffKey
        value
      }
      conditionalOptionalTabs {
        tabTitle
        tabInputs {
          inputType
          inputTitle
          inputName
        }
      }
      dependsOn
      disabledBy
      externalLink
      textExternalLink
      internalLink
      textInternalLink
      ffKey
      beta
      supportedDisabledCertChecksTypes
      enableMultiCredentials
    }
  }
}
```

**Variables**

This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.

```json
{
  "addCredentialsInput": {
    "connectorID": "2",
    "hostURL": "example",
    "credentialsType": "UserPassword",
    "credentialsInput": {
      "name": "SomeName",
      "password": "example",
      "token": "example",
      "clientId": "example",
      "secretKey": "example",
      "awsRoleArn": "example",
      "awsExternalId": "example",
      "awsAccessKey": "example",
      "awsAccessSecret": "example",
      "tenant": "example",
      "idpToken": {
        "access_token": "example",
        "token_type": "example",
        "expires_in": 42,
        "created_at": 42,
        "refresh_token": "example",
        "scope": "example"
      },
      "projectId": "example",
      "installationId": 42,
      "installationToken": {
        "token": "example",
        "createdAt": "example",
        "expiresAt": "example"
      },
      "apiAccessKey": "example",
      "apiSecretKey": "example",
      "clientSecret": "example",
      "subscriptionId": "example",
      "tenantId": "example",
      "organizationId": "example",
      "apiKey": "example",
      "optionalFields": {
        "SSHKey": "example",
        "RepoSearchQuery": "example",
        "Config": "example",
        "buildIssueToCloud": true
      },
      "extraOptionalCreds": {
        "atlassian": {
          "organizationId": "example",
          "apiKey": "example"
        }
      },
      "apiUrl": "example",
      "deploymentName": "example",
      "appId": "30966426",
      "gitPassword": "example",
      "gitUsername": "example",
      "webhookUrl": "example",
      "hostURL": "example",
      "brokerUsername": "example",
      "brokerPassword": "example",
      "brokerSSHPublicKey": "example",
      "brokerEnabled": true,
      "isCertChecksDisabled": true
    },
    "credentialsName": "example",
    "isCertChecksDisabled": true
  }
}
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl -X POST \
https://api.cloud.ox.security/api/apollo-gateway \
-H 'Content-Type: application/json' \
-H 'Authorization: YOUR_API_TOKEN' \
-d '{
 "query": "mutation AddCredentials($addCredentialsInput: AddCredentialsInput!) { addCredentials(addCredentialsInput: $addCredentialsInput) { connector { id name displayName description hostURL iconURL family credentialsType credentialsTypes brokerSupportCredentialsTypes disabledMultiCredentialsTypes credentials { ... on UserPasswordOnlyCredentials { name password credentialsId credentialsName tokenExpirationDate credentialsType isCertChecksDisabled hostURL iv monitoredResources monitorAllResources monitorAllNewlyCreatedResources brokerUsername brokerPassword brokerEnabled brokerHost brokerPort } } isConfigured isResourceAvailable ffKeyResourceAvailable resourceOptions { resourceName hideMonitorNewResourcesCheckbox showSettingsPerResource } resources { type } isOxBuiltIn isOpenSource openSourceWebsiteUrl openSourceLicense openSourceAuthor defaultEnabled comingSoon isDemoEnabled aliasFor identityProviderInfo { baseURL urlParams scope configText user_scope } gitHubAppInfo { baseURL urlPath configText } bitbucketAppInfo { baseURL queryParameters configText } awsCloudFormationInfo { baseURL urlParams } awsCloudFormationOrganizationInfo { baseURL urlParams } connectionInstructions { type title details linksToDocs { href title } permissions hostURL } isDiscovered isEmptyOfRepos isDevelopment connectorExplanation optionalInputFields { name credsTypes inputType key ffKey value } conditionalOptionalTabs { tabTitle tabInputs { inputType inputTitle inputName } } dependsOn disabledBy externalLink textExternalLink internalLink textInternalLink ffKey beta supportedDisabledCertChecksTypes enableMultiCredentials } } }",
 "variables": {
    "addCredentialsInput": {
      "connectorID": "2",
      "hostURL": "example",
      "credentialsType": "UserPassword",
      "credentialsInput": {
        "name": "SomeName",
        "password": "example",
        "token": "example",
        "clientId": "example",
        "secretKey": "example",
        "awsRoleArn": "example",
        "awsExternalId": "example",
        "awsAccessKey": "example",
        "awsAccessSecret": "example",
        "tenant": "example",
        "idpToken": {
          "access_token": "example",
          "token_type": "example",
          "expires_in": 42,
          "created_at": 42,
          "refresh_token": "example",
          "scope": "example"
        },
        "projectId": "example",
        "installationId": 42,
        "installationToken": {
          "token": "example",
          "createdAt": "example",
          "expiresAt": "example"
        },
        "apiAccessKey": "example",
        "apiSecretKey": "example",
        "clientSecret": "example",
        "subscriptionId": "example",
        "tenantId": "example",
        "organizationId": "example",
        "apiKey": "example",
        "optionalFields": {
          "SSHKey": "example",
          "RepoSearchQuery": "example",
          "Config": "example",
          "buildIssueToCloud": true
        },
        "extraOptionalCreds": {
          "atlassian": {
            "organizationId": "example",
            "apiKey": "example"
          }
        },
        "apiUrl": "example",
        "deploymentName": "example",
        "appId": "30966426",
        "gitPassword": "example",
        "gitUsername": "example",
        "webhookUrl": "example",
        "hostURL": "example",
        "brokerUsername": "example",
        "brokerPassword": "example",
        "brokerSSHPublicKey": "example",
        "brokerEnabled": true,
        "isCertChecksDisabled": true
      },
      "credentialsName": "example",
      "isCertChecksDisabled": true
    }
  }
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const query = 'mutation AddCredentials($addCredentialsInput: AddCredentialsInput!) { addCredentials(addCredentialsInput: $addCredentialsInput) { connector { id name displayName description hostURL iconURL family credentialsType credentialsTypes brokerSupportCredentialsTypes disabledMultiCredentialsTypes credentials { ... on UserPasswordOnlyCredentials { name password credentialsId credentialsName tokenExpirationDate credentialsType isCertChecksDisabled hostURL iv monitoredResources monitorAllResources monitorAllNewlyCreatedResources brokerUsername brokerPassword brokerEnabled brokerHost brokerPort } } isConfigured isResourceAvailable ffKeyResourceAvailable resourceOptions { resourceName hideMonitorNewResourcesCheckbox showSettingsPerResource } resources { type } isOxBuiltIn isOpenSource openSourceWebsiteUrl openSourceLicense openSourceAuthor defaultEnabled comingSoon isDemoEnabled aliasFor identityProviderInfo { baseURL urlParams scope configText user_scope } gitHubAppInfo { baseURL urlPath configText } bitbucketAppInfo { baseURL queryParameters configText } awsCloudFormationInfo { baseURL urlParams } awsCloudFormationOrganizationInfo { baseURL urlParams } connectionInstructions { type title details linksToDocs { href title } permissions hostURL } isDiscovered isEmptyOfRepos isDevelopment connectorExplanation optionalInputFields { name credsTypes inputType key ffKey value } conditionalOptionalTabs { tabTitle tabInputs { inputType inputTitle inputName } } dependsOn disabledBy externalLink textExternalLink internalLink textInternalLink ffKey beta supportedDisabledCertChecksTypes enableMultiCredentials } } }';

fetch("https://api.cloud.ox.security/api/apollo-gateway", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_TOKEN"
  },
  body: JSON.stringify({
    query: query,
    // This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.
    variables: {
      addCredentialsInput: {
        connectorID: "2",
        hostURL: "example",
        credentialsType: "UserPassword",
        credentialsInput: {
          name: "SomeName",
          password: "example",
          token: "example",
          clientId: "example",
          secretKey: "example",
          awsRoleArn: "example",
          awsExternalId: "example",
          awsAccessKey: "example",
          awsAccessSecret: "example",
          tenant: "example",
          idpToken: {
            access_token: "example",
            token_type: "example",
            expires_in: 42,
            created_at: 42,
            refresh_token: "example",
            scope: "example"
          },
          projectId: "example",
          installationId: 42,
          installationToken: {
            token: "example",
            createdAt: "example",
            expiresAt: "example"
          },
          apiAccessKey: "example",
          apiSecretKey: "example",
          clientSecret: "example",
          subscriptionId: "example",
          tenantId: "example",
          organizationId: "example",
          apiKey: "example",
          optionalFields: {
            SSHKey: "example",
            RepoSearchQuery: "example",
            Config: "example",
            buildIssueToCloud: true
          },
          extraOptionalCreds: {
            atlassian: {
              organizationId: "example",
              apiKey: "example"
            }
          },
          apiUrl: "example",
          deploymentName: "example",
          appId: "30966426",
          gitPassword: "example",
          gitUsername: "example",
          webhookUrl: "example",
          hostURL: "example",
          brokerUsername: "example",
          brokerPassword: "example",
          brokerSSHPublicKey: "example",
          brokerEnabled: true,
          isCertChecksDisabled: true
        },
        credentialsName: "example",
        isCertChecksDisabled: true
      }
    }
  })
})
.then(response => response.json())
.then(result => console.log(JSON.stringify(result, null, 2)))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

query = 'mutation AddCredentials($addCredentialsInput: AddCredentialsInput!) { addCredentials(addCredentialsInput: $addCredentialsInput) { connector { id name displayName description hostURL iconURL family credentialsType credentialsTypes brokerSupportCredentialsTypes disabledMultiCredentialsTypes credentials { ... on UserPasswordOnlyCredentials { name password credentialsId credentialsName tokenExpirationDate credentialsType isCertChecksDisabled hostURL iv monitoredResources monitorAllResources monitorAllNewlyCreatedResources brokerUsername brokerPassword brokerEnabled brokerHost brokerPort } } isConfigured isResourceAvailable ffKeyResourceAvailable resourceOptions { resourceName hideMonitorNewResourcesCheckbox showSettingsPerResource } resources { type } isOxBuiltIn isOpenSource openSourceWebsiteUrl openSourceLicense openSourceAuthor defaultEnabled comingSoon isDemoEnabled aliasFor identityProviderInfo { baseURL urlParams scope configText user_scope } gitHubAppInfo { baseURL urlPath configText } bitbucketAppInfo { baseURL queryParameters configText } awsCloudFormationInfo { baseURL urlParams } awsCloudFormationOrganizationInfo { baseURL urlParams } connectionInstructions { type title details linksToDocs { href title } permissions hostURL } isDiscovered isEmptyOfRepos isDevelopment connectorExplanation optionalInputFields { name credsTypes inputType key ffKey value } conditionalOptionalTabs { tabTitle tabInputs { inputType inputTitle inputName } } dependsOn disabledBy externalLink textExternalLink internalLink textInternalLink ffKey beta supportedDisabledCertChecksTypes enableMultiCredentials } } }'

response = requests.post(
  "https://api.cloud.ox.security/api/apollo-gateway",
  headers={
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_TOKEN"
  },
  json={
    "query": query,
    # This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.
    "variables": {
      "addCredentialsInput": {
        "connectorID": "2",
        "hostURL": "example",
        "credentialsType": "UserPassword",
        "credentialsInput": {
          "name": "SomeName",
          "password": "example",
          "token": "example",
          "clientId": "example",
          "secretKey": "example",
          "awsRoleArn": "example",
          "awsExternalId": "example",
          "awsAccessKey": "example",
          "awsAccessSecret": "example",
          "tenant": "example",
          "idpToken": {
            "access_token": "example",
            "token_type": "example",
            "expires_in": 42,
            "created_at": 42,
            "refresh_token": "example",
            "scope": "example"
          },
          "projectId": "example",
          "installationId": 42,
          "installationToken": {
            "token": "example",
            "createdAt": "example",
            "expiresAt": "example"
          },
          "apiAccessKey": "example",
          "apiSecretKey": "example",
          "clientSecret": "example",
          "subscriptionId": "example",
          "tenantId": "example",
          "organizationId": "example",
          "apiKey": "example",
          "optionalFields": {
            "SSHKey": "example",
            "RepoSearchQuery": "example",
            "Config": "example",
            "buildIssueToCloud": true
          },
          "extraOptionalCreds": {
            "atlassian": {
              "organizationId": "example",
              "apiKey": "example"
            }
          },
          "apiUrl": "example",
          "deploymentName": "example",
          "appId": "30966426",
          "gitPassword": "example",
          "gitUsername": "example",
          "webhookUrl": "example",
          "hostURL": "example",
          "brokerUsername": "example",
          "brokerPassword": "example",
          "brokerSSHPublicKey": "example",
          "brokerEnabled": true,
          "isCertChecksDisabled": true
        },
        "credentialsName": "example",
        "isCertChecksDisabled": true
      }
    }
  }
)

if response.status_code == 200:
    result = response.json()
    print(result)
else:
    print(f"Error: {response.status_code}")
    print(response.text)
```

{% endtab %}
{% endtabs %}

### Arguments

You can use the following argument(s) to customize your `addCredentials` mutation.

| Argument                                                                                                                                                                                           | Description                                                                     | Supported fields                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| addCredentialsInput [`AddCredentialsInput!`](/api-documentation/api-reference/api--connectors/types/inputs/add-credentials-input.md) <mark style="color:red;background-color:red;">required</mark> | Input containing the connector ID, credentials type, and authentication details | <p>connectorID <code>String!</code><br>hostURL <code>String</code><br>credentialsType <a href="/pages/Iul3Kg3jD5gyL8K2stDI"><code>CredentialsType!</code></a><br>credentialsInput <a href="/pages/OY3FDNf9eZa5FPUC2v74"><code>CredentialsInput!</code></a><br>credentialsName <code>String</code><br>isCertChecksDisabled <code>Boolean</code></p> |

### Fields

Return type: [`ConnectorResponse`](/api-documentation/api-reference/api--connectors/types/objects/connector-response.md)

You can use the following field(s) to specify what information your `addCredentials` mutation will return. Please note that some fields may have their own subfields.

| Field                                                                                                | Description      | Supported fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| connector [`Connector`](/api-documentation/api-reference/api--connectors/types/objects/connector.md) | Connector object | <p>id <code>String</code><br>name <code>String</code><br>displayName <code>String</code><br>description <code>String</code><br>hostURL <code>String</code><br>iconURL <code>String</code><br>family <code>String</code><br>credentialsType <a href="/pages/Iul3Kg3jD5gyL8K2stDI"><code>CredentialsType</code></a><br>credentialsTypes <a href="/pages/Iul3Kg3jD5gyL8K2stDI"><code>\[CredentialsType]</code></a><br>brokerSupportCredentialsTypes <a href="/pages/Iul3Kg3jD5gyL8K2stDI"><code>\[CredentialsType]</code></a><br>disabledMultiCredentialsTypes <a href="/pages/Iul3Kg3jD5gyL8K2stDI"><code>\[CredentialsType]</code></a><br>credentials <a href="/pages/t1aK5AMnMSf1plabUIbl"><code>\[Credential]</code></a><br>isConfigured <code>Boolean</code><br>isResourceAvailable <code>Boolean</code><br>ffKeyResourceAvailable <code>String</code><br>resourceOptions <a href="/pages/Wn7tJ1e2SXhHHima9aG2"><code>ResourceOptions</code></a><br>resources <a href="/pages/UScyiG4rbAVy80ZSLCgi"><code>\[ResourceItem]</code></a><br>isOxBuiltIn <code>Boolean</code><br>isOpenSource <code>Boolean</code><br>openSourceWebsiteUrl <code>String</code><br>openSourceLicense <code>String</code><br>openSourceAuthor <code>String</code><br>defaultEnabled <code>Boolean</code><br>comingSoon <code>Boolean</code><br>isDemoEnabled <code>Boolean</code><br>aliasFor <code>String</code><br>identityProviderInfo <a href="/pages/u0SBnnziVfvcTAwLhgYF"><code>IdentityProviderInfo</code></a><br>gitHubAppInfo <a href="/pages/deKkSGoHDO5xmnhTqB7D"><code>GitHubAppInfo</code></a><br>bitbucketAppInfo <a href="/pages/b6eWbFBhBDOUhs3eejlr"><code>BitbucketAppInfo</code></a><br>awsCloudFormationInfo <a href="/pages/aij6MAlMdqoWFnJDsCqJ"><code>AWSCloudFormationInfo</code></a><br>awsCloudFormationOrganizationInfo <a href="/pages/aij6MAlMdqoWFnJDsCqJ"><code>AWSCloudFormationInfo</code></a><br>connectionInstructions <a href="/pages/AQu0UWXmbmy1hCM3SmfQ"><code>\[ConnectionInstructions]</code></a><br>isDiscovered <code>Boolean</code><br>isEmptyOfRepos <code>Boolean</code><br>isDevelopment <code>Boolean</code><br>connectorExplanation <code>String</code><br>optionalInputFields <a href="/pages/r9X5ze4T8Gp56BOwbMdN"><code>\[OptionalConnectorInput]</code></a><br>conditionalOptionalTabs <a href="/pages/Hk5xeNHTor3ysvbmhMJF"><code>\[ConditionalOptionalTabs]</code></a><br>dependsOn <code>String</code><br>disabledBy <code>\[String]</code><br>externalLink <code>String</code><br>textExternalLink <code>String</code><br>internalLink <code>String</code><br>textInternalLink <code>String</code><br>ffKey <code>String</code><br>beta <code>Boolean</code><br>supportedDisabledCertChecksTypes <code>\[String]</code><br>enableMultiCredentials <code>Boolean</code></p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ox.security/api-documentation/api-reference/api--connectors/mutations/add-credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
