# Source: https://infisical.com/docs/api-reference/overview/examples/integration.md

# Configure native integrations via API

> How to use Infisical API to sync secrets to external secret managers

The Infisical API allows you to create programmatic integrations that connect with third-party secret managers to synchronize secrets from Infisical.

This guide will primarily demonstrate the process using AWS Secret Store Manager (AWS SSM), but the steps are generally applicable to other secret management integrations.

<Info>
  For details on setting up AWS SSM synchronization and understanding its prerequisites, refer to the [AWS SSM integration setup documentation](../../../integrations/cloud/aws-secret-manager).
</Info>

<Steps>
  <Step title="Authenticate with AWS SSM">
    Authentication is required for all integrations. Use the [Integration Auth API](../../endpoints/integrations/create-auth) with the following parameters to authenticate.

    <ParamField body="integration" type="string" initialValue="aws-secret-manager" required>
      Set this parameter to **aws-secret-manager**.
    </ParamField>

    <ParamField body="workspaceId" type="string" required>
      The Infisical project ID for the integration.
    </ParamField>

    <ParamField body="accessId" type="string" required>
      The AWS IAM User Access ID.
    </ParamField>

    <ParamField body="accessToken" type="string" required>
      The AWS IAM User Access Secret Key.
    </ParamField>

    ```bash Request theme={"dark"}
    curl --request POST \
        --url https://app.infisical.com/api/v1/integration-auth/access-token \
        --header 'Authorization: <authorization>' \
        --header 'Content-Type: application/json' \
        --data '{
        "workspaceId": "<workspaceid>",
        "integration": "aws-secret-manager",
        "accessId": "<aws iam user access id>",
        "accessToken": "<aws iam user access secret key>"
    }'
    ```
  </Step>

  <Step title="Configure the Synchronization Setup">
    Once authentication between AWS SSM and Infisical is established, you can configure the synchronization behavior.
    This involves specifying the source (environment and secret path in Infisical) and the destination in SSM to which the secrets will be synchronized.

    Use the [integration API](../../endpoints/integrations/create) with the following parameters to configure the sync source and destination.

    <ParamField body="integrationAuthId" type="string" required>
      The ID of the integration authentication object used with AWS, obtained from the previous API response.
    </ParamField>

    <ParamField body="isActive" type="boolean">
      Indicates whether the integration should be active or inactive.
    </ParamField>

    <ParamField body="app" type="string" required>
      The secret name for saving in AWS SSM, which can be arbitrarily chosen.
    </ParamField>

    <ParamField body="region" type="string" required>
      The AWS region where the SSM is located, e.g., `us-east-1`.
    </ParamField>

    <ParamField body="sourceEnvironment" type="string" required>
      The Infisical environment slug from which secrets will be synchronized, e.g., `dev`.
    </ParamField>

    <ParamField body="secretPath" type="string" required>
      The Infisical folder path from which secrets will be synchronized, e.g., `/some/path`. The root path is `/`.
    </ParamField>

    ```bash Request theme={"dark"}
    curl --request POST \
        --url https://app.infisical.com/api/v1/integration \
        --header 'Authorization: <authorization>' \
        --header 'Content-Type: application/json' \
        --data '{
        "integrationAuthId": "<integrationauthid>",
        "sourceEnvironment": "<sourceenvironment>",
        "secretPath": "<secret-path, default is '/' >",
        "app": "<app>",
        "region": "<aws-ssm-region>"
    }'
    ```
  </Step>
</Steps>

<Check>
  Congratulations! You have successfully set up an integration to synchronize secrets from Infisical with AWS SSM.
  For more information, [view the integration API reference](../../endpoints/integrations).
</Check>