Integration APIs

1. Overview

This page contains the APIs that are used for retrieving and updating integrations. An integration is a third party API that has been integrated into FusionAuth. These APIs are used to enable and configure these third party integration.

2. Retrieve Integrations

This API is used to retrieve integrations.

2.1. Request

Retrieve Integrations

URI

GET /api/integration

2.2. Response

The response for this API contains the Integrations.

Table 1. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

503

The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Table 2. Response Body

integration.cleanspeak.apiKey [String]

The API key that is used when calling CleanSpeak for moderation.

integration.cleanspeak.enabled [Boolean]

True if CleanSpeak integration is enabled.

integration.cleanspeak.url [String]

The URL of the CleanSpeak WebService service (i.e. http://localhost:8001/).

integration.cleanspeak.usernameModeration.applicationId [UUID]

The Id of the CleanSpeak Application where usernames are sent for moderation.

integration.cleanspeak.usernameModeration.enabled [Boolean]

True if CleanSpeak username moderation is enabled.

integration.kafka.defaultTopic [String]

The name of the Kafka topic to send messages.

integration.kafka.enabled [Boolean]

True if the Kafka integration is enabled.

integration.kafka.producer [Map<String, String>]

String key value pairs to be used when building the Kafka Producer.

integration.twilio.accountSID [String]

The Twilio Account ID to use when connecting to the Twilio API. This can be found in your Twilio dashboard.

integration.twilio.authToken [String]

The Twilio Auth Token to use when connecting to the Twilio API. This can be found in your Twilio dashboard.

integration.twilio.enabled [Boolean]

True if the Twilio integration is enabled.

integration.twilio.fromPhoneNumber [String]

The configured Twilio phone number that will be used to send messages. This can be found in your Twilio dashboard.

integration.twilio.messagingServiceSid [String]

The Twilio message service Id, this is used when using Twilio Copilot to load balance between numbers. This can be found in your Twilio dashboard.

When using the Twilio Messaging Services Id, you may omit the fromPhoneNumber field.

Example Response JSON
{
  "integrations": {
    "cleanspeak": {
      "apiKey": "97f3d194-ef95-480a-9ee4-eea7dbdc450a",
      "enabled": true,
      "url": "http://localhost:8001",
      "usernameModeration": {
        "applicationId": "27a7e845-79ec-4b24-a36d-66a224055395",
        "enabled": true
      }
    },
    "kafka": {
      "defaultTopic": "FusionAuth",
      "enabled": true,
      "producer": {
        "request.timeout.ms": "2000",
        "bootstrap.servers": "localhost:9092",
        "max.block.ms": "5000"
      }
    },
    "twilio": {
      "accountSID": "_superSecreteAccountSID",
      "authToken": "_superSecretAuthToken",
      "enabled": true,
      "fromPhoneNumber": "555-555-5555",
      "url": "https://api.twilio.com"
    }
  }
}

3. Update Integrations

This API is used to update the global System Configuration object.

3.1. Request

Update Integrations

URI

PUT /api/integration

Table 3. Request Body

integration.cleanSpeakConfiguration.apiKey [String] Optional

The API key that is used when calling CleanSpeak for moderation.

integration.cleanSpeakConfiguration.enabled [Boolean] Optional defaults to false

True if CleanSpeak integration is enabled.

integration.cleanSpeakConfiguration.url [String] Optional

The URL of the CleanSpeak WebService service (i.e. http://localhost:8001/). Required when the CleanSpeak integration is enabled.

integration.cleanSpeakConfiguration.usernameModeration.applicationId [UUID] Optional

The Id of the CleanSpeak Application where usernames are sent for moderation.

integration.cleanSpeakConfiguration.usernameModeration.enabled [Boolean] Optional defaults to false

True if CleanSpeak username moderation is enabled.

integration.kafka.defaultTopic [String] Optional

The name of the Kafka topic to send messages. Required when the Kafka integration is enabled.

integration.kafka.enabled [Boolean] Optional defaults to false

True if the Kafka integration is enabled.

integration.kafka.producer [Map<String, String>] Optional

String key value pairs to be used when building the Kafka Producer.

integration.twilio.accountSID [String] Optional

The Twilio Account ID to use when connecting to the Twilio API. This can be found in your Twilio dashboard. Required when the Twilio integration is enabled.

integration.twilio.authToken [String] Optional

The Twilio Auth Token to use when connecting to the Twilio API. This can be found in your Twilio dashboard. Required when the Twilio integration is enabled.

integration.twilio.enabled [Boolean] Optional defaults to false

True if the Twilio integration is enabled.

integration.twilio.fromPhoneNumber [String] Optional

The configured Twilio phone number that will be used to send messages. This can be found in your Twilio dashboard.

integration.twilio.messagingServiceSid [String] Optional

The Twilio message service Id, this is used when using Twilio Copilot to load balance between numbers. This can be found in your Twilio dashboard.

When using the Twilio Messaging Services Id, you may omit the fromPhoneNumber field.

Example Request JSON
{
  "integrations": {
    "cleanspeak": {
      "apiKey": "97f3d194-ef95-480a-9ee4-eea7dbdc450a",
      "enabled": true,
      "url": "http://localhost:8001",
      "usernameModeration": {
        "applicationId": "27a7e845-79ec-4b24-a36d-66a224055395",
        "enabled": true
      }
    },
    "kafka": {
      "defaultTopic": "FusionAuth",
      "enabled": true,
      "producer": {
        "request.timeout.ms": "2000",
        "bootstrap.servers": "localhost:9092",
        "max.block.ms": "5000"
      }
    },
    "twilio": {
      "accountSID": "_superSecreteAccountSID",
      "authToken": "_superSecretAuthToken",
      "enabled": true,
      "fromPhoneNumber": "555-555-5555",
      "url": "https://api.twilio.com"
    }
  }
}

3.2. Response

The response for this API contains Integrations.

Table 4. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

503

The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Table 5. Response Body

integration.cleanspeak.apiKey [String]

The API key that is used when calling CleanSpeak for moderation.

integration.cleanspeak.enabled [Boolean]

True if CleanSpeak integration is enabled.

integration.cleanspeak.url [String]

The URL of the CleanSpeak WebService service (i.e. http://localhost:8001/).

integration.cleanspeak.usernameModeration.applicationId [UUID]

The Id of the CleanSpeak Application where usernames are sent for moderation.

integration.cleanspeak.usernameModeration.enabled [Boolean]

True if CleanSpeak username moderation is enabled.

integration.kafka.defaultTopic [String]

The name of the Kafka topic to send messages.

integration.kafka.enabled [Boolean]

True if the Kafka integration is enabled.

integration.kafka.producer [Map<String, String>]

String key value pairs to be used when building the Kafka Producer.

integration.twilio.accountSID [String]

The Twilio Account ID to use when connecting to the Twilio API. This can be found in your Twilio dashboard.

integration.twilio.authToken [String]

The Twilio Auth Token to use when connecting to the Twilio API. This can be found in your Twilio dashboard.

integration.twilio.enabled [Boolean]

True if the Twilio integration is enabled.

integration.twilio.fromPhoneNumber [String]

The configured Twilio phone number that will be used to send messages. This can be found in your Twilio dashboard.

integration.twilio.messagingServiceSid [String]

The Twilio message service Id, this is used when using Twilio Copilot to load balance between numbers. This can be found in your Twilio dashboard.

When using the Twilio Messaging Services Id, you may omit the fromPhoneNumber field.

Example Response JSON
{
  "integrations": {
    "cleanspeak": {
      "apiKey": "97f3d194-ef95-480a-9ee4-eea7dbdc450a",
      "enabled": true,
      "url": "http://localhost:8001",
      "usernameModeration": {
        "applicationId": "27a7e845-79ec-4b24-a36d-66a224055395",
        "enabled": true
      }
    },
    "kafka": {
      "defaultTopic": "FusionAuth",
      "enabled": true,
      "producer": {
        "request.timeout.ms": "2000",
        "bootstrap.servers": "localhost:9092",
        "max.block.ms": "5000"
      }
    },
    "twilio": {
      "accountSID": "_superSecreteAccountSID",
      "authToken": "_superSecretAuthToken",
      "enabled": true,
      "fromPhoneNumber": "555-555-5555",
      "url": "https://api.twilio.com"
    }
  }
}