Sections
Theme

Integrations

REST API reference for integrations

This reference is generated from the Invitebase OpenAPI contract.

Connected event sources (RevenueCat, Adapty, Stripe, Segment).

Connect an event source

POST/v1/integrations

Creates a supported provider connection. The opaque credential is returned exactly once and is never persisted by Invitebase; configure it as a Bearer Authorization header at the provider.

Authentication

Authorization: Bearer <secret key>.

Request body

Required.

application/json schema:

{
  "$ref": "#/components/schemas/IntegrationCreate"
}

Responses

201

Integration connected. Save the credential now; it cannot be retrieved later.

application/json schema:

{
  "$ref": "#/components/schemas/IntegrationConnection"
}

400

The request was malformed or invalid.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

401

Missing or invalid API key.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

403

The API key is valid but is not permitted to call this endpoint.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

429

Too many requests.

Response headers:

{
  "Retry-After": {
    "description": "Seconds until the caller may retry.",
    "schema": {
      "type": "integer",
      "minimum": 1
    }
  }
}

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

List connected integrations

GET/v1/integrations

Event sources connected to this org (RevenueCat, Adapty, Stripe, Segment). Their events map into the same gate engine as SDK/API events.

Authentication

Authorization: Bearer <secret key>.

Parameters

NameInRequiredSchemaDescription
limitqueryNo{"type":"integer","minimum":1,"maximum":100,"default":25}
starting_afterqueryNo{"type":"string"}A cursor (object id) for pagination; returns the page after this object.

Responses

200

A list of integrations.

application/json schema:

{
  "allOf": [
    {
      "$ref": "#/components/schemas/ListResponse"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/Integration"
          }
        }
      }
    }
  ]
}

400

The request was malformed or invalid.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

401

Missing or invalid API key.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

403

The API key is valid but is not permitted to call this endpoint.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

429

Too many requests.

Response headers:

{
  "Retry-After": {
    "description": "Seconds until the caller may retry.",
    "schema": {
      "type": "integer",
      "minimum": 1
    }
  }
}

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

Rotate an integration credential

POST/v1/integrations/config/{sourceId}/rotate-credential

Immediately replaces a source credential and returns the replacement once. The source is re-enabled so the new provider configuration can start delivering events.

Authentication

Authorization: Bearer <secret key>.

Parameters

NameInRequiredSchemaDescription
sourceIdpathYes{"type":"string","format":"uuid"}

Responses

200

Credential rotated. Save the replacement now.

application/json schema:

{
  "$ref": "#/components/schemas/IntegrationConnection"
}

401

Missing or invalid API key.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

403

The API key is valid but is not permitted to call this endpoint.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

404

The requested resource does not exist.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

429

Too many requests.

Response headers:

{
  "Retry-After": {
    "description": "Seconds until the caller may retry.",
    "schema": {
      "type": "integer",
      "minimum": 1
    }
  }
}

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

Disconnect an event source

POST/v1/integrations/config/{sourceId}/disconnect

Disables provider ingress while retaining delivery history for auditability.

Authentication

Authorization: Bearer <secret key>.

Parameters

NameInRequiredSchemaDescription
sourceIdpathYes{"type":"string","format":"uuid"}

Responses

200

Integration disconnected.

application/json schema:

{
  "$ref": "#/components/schemas/Integration"
}

401

Missing or invalid API key.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

403

The API key is valid but is not permitted to call this endpoint.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

404

The requested resource does not exist.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

429

Too many requests.

Response headers:

{
  "Retry-After": {
    "description": "Seconds until the caller may retry.",
    "schema": {
      "type": "integer",
      "minimum": 1
    }
  }
}

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

Simulate a provider event

POST/v1/integrations/config/{sourceId}/simulations

Sends a synthetic subscription purchase through a RevenueCat or Adapty source's normal delivery ledger. Only available with a test-mode secret key.

Authentication

Authorization: Bearer <secret key>.

Parameters

NameInRequiredSchemaDescription
sourceIdpathYes{"type":"string","format":"uuid"}

Request body

Required.

application/json schema:

{
  "$ref": "#/components/schemas/IntegrationSimulation"
}

Responses

202

Synthetic provider delivery accepted.

application/json schema:

{
  "$ref": "#/components/schemas/EventSourceDelivery"
}

400

The request was malformed or invalid.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

401

Missing or invalid API key.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

403

The API key is valid but is not permitted to call this endpoint.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

404

The requested resource does not exist.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

429

Too many requests.

Response headers:

{
  "Retry-After": {
    "description": "Seconds until the caller may retry.",
    "schema": {
      "type": "integer",
      "minimum": 1
    }
  }
}

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

Receive a source integration delivery

POST/v1/integrations/{provider}/{sourceId}

Provider callback endpoint. It uses the opaque event-source credential issued when the source is connected, then the provider adapter verifies, maps, and emits canonical events into the same qualification engine as SDK events. Provider adapters define their own body contract.

Authentication

No API key required.

Parameters

NameInRequiredSchemaDescription
providerpathYes{"type":"string"}
sourceIdpathYes{"type":"string","format":"uuid"}
AuthorizationheaderYes{"type":"string"}The source's one-time Bearer es_… connection credential.

Responses

200

A provider webhook verification request was acknowledged.

application/json schema:

{
  "type": "object"
}

202

Delivery accepted or an already-processed delivery replayed.

application/json schema:

{
  "$ref": "#/components/schemas/EventSourceDelivery"
}

400

The request was malformed or invalid.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

401

Missing or invalid API key.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

404

The requested resource does not exist.

application/json schema:

{
  "$ref": "#/components/schemas/Error"
}

Schemas

Schema references below resolve against these definitions. Required fields, enums, bounds, and composed types are preserved from the contract.

The IntegrationCreate object

FieldTypeRequiredDescription
providerstringYesEvent-source provider to connect.

Full schema:

{
  "type": "object",
  "required": [
    "provider"
  ],
  "additionalProperties": false,
  "properties": {
    "provider": {
      "type": "string",
      "enum": [
        "revenuecat",
        "adapty"
      ],
      "description": "Event-source provider to connect."
    }
  }
}

The IntegrationConnection object

FieldTypeRequiredDescription
integrationIntegrationYes
connectionobjectYes

Full schema:

{
  "type": "object",
  "required": [
    "integration",
    "connection"
  ],
  "properties": {
    "integration": {
      "$ref": "#/components/schemas/Integration"
    },
    "connection": {
      "type": "object",
      "required": [
        "ingress_path",
        "credential"
      ],
      "properties": {
        "ingress_path": {
          "type": "string",
          "description": "Relative Invitebase API path to configure as the provider webhook URL."
        },
        "credential": {
          "type": "string",
          "description": "One-time opaque source credential. Store it at the provider; Invitebase cannot retrieve it again."
        }
      }
    }
  }
}

The Integration object

FieldTypeRequiredDescription
idstringYes
objectstringYes
providerstringYesRegistered provider key, e.g. revenuecat or adapty.
statusstringYes
credential_prefixstringNoSafe prefix of the one-time provider credential; the credential itself is never returned.
received_countintegerYes
processed_countintegerYes
failed_countintegerYes
last_received_atstring or nullNo
last_processed_atstring or nullNo
created_atstringYes

Full schema:

{
  "type": "object",
  "required": [
    "id",
    "object",
    "provider",
    "status",
    "received_count",
    "processed_count",
    "failed_count",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "object": {
      "type": "string",
      "const": "integration"
    },
    "provider": {
      "type": "string",
      "description": "Registered provider key, e.g. `revenuecat` or `adapty`."
    },
    "status": {
      "type": "string",
      "enum": [
        "waiting",
        "connected",
        "error",
        "disconnected"
      ]
    },
    "credential_prefix": {
      "type": "string",
      "description": "Safe prefix of the one-time provider credential; the credential itself is never returned."
    },
    "received_count": {
      "type": "integer",
      "format": "int64"
    },
    "processed_count": {
      "type": "integer",
      "format": "int64"
    },
    "failed_count": {
      "type": "integer",
      "format": "int64"
    },
    "last_received_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_processed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

The Error object

FieldTypeRequiredDescription
errorobjectYes

Full schema:

{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "type",
        "code",
        "message",
        "doc_url"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "invalid_request_error",
            "authentication_error",
            "rate_limit_error",
            "api_error"
          ]
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": "string"
        },
        "doc_url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}

The ListResponse object

FieldTypeRequiredDescription
objectstringYes
has_morebooleanYes
dataarrayYes

Full schema:

{
  "type": "object",
  "required": [
    "object",
    "data",
    "has_more"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "list"
    },
    "has_more": {
      "type": "boolean"
    },
    "data": {
      "type": "array",
      "items": {}
    }
  }
}

The IntegrationSimulation object

FieldTypeRequiredDescription
referred_user_idstringYesTest participant external id to receive the synthetic purchase.
product_idstringNoOptional provider product id for the synthetic purchase.

Full schema:

{
  "type": "object",
  "required": [
    "referred_user_id"
  ],
  "additionalProperties": false,
  "properties": {
    "referred_user_id": {
      "type": "string",
      "maxLength": 160,
      "description": "Test participant external id to receive the synthetic purchase."
    },
    "product_id": {
      "type": "string",
      "maxLength": 160,
      "description": "Optional provider product id for the synthetic purchase."
    }
  }
}

The EventSourceDelivery object

FieldTypeRequiredDescription
idstringYes
objectstringYes
statusstringYes
event_idsarrayYes

Full schema:

{
  "type": "object",
  "required": [
    "id",
    "object",
    "status",
    "event_ids"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "object": {
      "type": "string",
      "const": "event_source_delivery"
    },
    "status": {
      "type": "string",
      "enum": [
        "processed",
        "duplicate"
      ]
    },
    "event_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    }
  }
}

On this page