Create connector

POST /api/connectors

Create a connector with the given data.

application/json

Body Required

  • config object

    The connector config object that will be passed to the connector. The config object should be compatible with the connector factory.

  • connectorId string Required

    The connector factory ID for creating the connector.

    Minimum length is 1, maximum length is 128.

  • metadata object

    Custom connector metadata, will be used to overwrite the default connector factory metadata.

    Hide metadata attributes Show metadata attributes object
    • target string
    • name object

      Validator function

    • logoDark string | null
  • syncProfile boolean

    Whether to sync user profile from the identity provider to Logto at each sign-in. If false, the user profile will only be synced when the user is created.

  • enableTokenStorage boolean
  • id string

    The unique ID for the connector. If not provided, a random ID will be generated.

    Minimum length is 1, maximum length is 128.

Responses

  • 200 application/json

    The created connector.

    Hide response attributes Show response attributes object
    • id string Required
    • syncProfile boolean Required
    • config object Required

      arbitrary

    • metadata object Required
      Hide metadata attributes Show metadata attributes object
      • target string
      • name object

        Validator function

      • logoDark string | null
    • connectorId string Required

      Minimum length is 1, maximum length is 128.

    • target string Required
    • name object Required

      Validator function

    • description object Required

      Validator function

    • logoDark string | null Required
    • readme string Required
    • configTemplate string
    • formItems array[object]
      One of:
    • customData object
    • fromEmail string
    • platform string | null Required

      Values are Native, Universal, or Web.

    • isStandard boolean
    • isTokenStorageSupported boolean
    • type string Required

      Values are Email, Sms, or Social.

    • isDemo boolean
    • extraInfo object
    • usage number
  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    The tenant has reached the maximum number of connectors.

  • 422

    Invalid request body.

POST /api/connectors
curl \
 --request POST 'https://[tenant_id].logto.app/api/connectors' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"config":{},"connectorId":"string","metadata":{"target":"string","name":{},"logo":"string","logoDark":"string"},"syncProfile":true,"enableTokenStorage":true,"id":"string"}'
Request examples
{
  "config": {},
  "connectorId": "string",
  "metadata": {
    "target": "string",
    "name": {},
    "logo": "string",
    "logoDark": "string"
  },
  "syncProfile": true,
  "enableTokenStorage": true,
  "id": "string"
}
Response examples (200)
{
  "id": "string",
  "syncProfile": true,
  "config": {},
  "metadata": {
    "target": "string",
    "name": {},
    "logo": "string",
    "logoDark": "string"
  },
  "connectorId": "string",
  "target": "string",
  "name": {},
  "description": {},
  "logo": "string",
  "logoDark": "string",
  "readme": "string",
  "configTemplate": "string",
  "formItems": [
    {
      "type": "string",
      "selectItems": [
        {
          "value": "string",
          "title": "string"
        }
      ],
      "key": "string",
      "label": "string",
      "placeholder": "string",
      "required": true,
      "showConditions": [
        {
          "targetKey": "string"
        }
      ],
      "description": "string",
      "tooltip": "string",
      "isConfidential": true
    }
  ],
  "customData": {},
  "fromEmail": "string",
  "platform": "Native",
  "isStandard": true,
  "isTokenStorageSupported": true,
  "type": "Email",
  "isDemo": true,
  "extraInfo": {},
  "usage": 42.0
}