> For the complete documentation index, see [llms.txt](https://developers.spiffy.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.spiffy.co/api/api-v1/v1-integrations.md).

# v1-integrations

Integration actions (v1)

## Create integration action

> Creates a new integration action triggered by an event.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"v1-integrations","description":"Integration actions (v1)"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["integrations"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promotions and their codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"V1ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error","error_description"]}}},"paths":{"/v1/integrations/actions":{"post":{"tags":["v1-integrations"],"summary":"Create integration action","description":"Creates a new integration action triggered by an event.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event_name":{"type":"string","description":"Event name to trigger on"},"integration_type":{"type":"string","description":"Integration type identifier"},"action_name":{"type":"string","description":"Action name"},"action_config":{"nullable":true,"description":"Action configuration object"},"reference_entity":{"type":"object","properties":{"type":{"type":"string","description":"Entity type (e.g. checkout, subscription)"},"id":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Entity ID"}},"required":["type","id"]}},"required":["event_name","integration_type","action_name","reference_entity"]}}}},"responses":{"200":{"description":"Success"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ErrorResponse"}}}},"403":{"description":"Forbidden / insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ErrorResponse"}}}}}}}}}
```

## Delete integration action

> Deletes an existing integration action.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"v1-integrations","description":"Integration actions (v1)"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["integrations"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promotions and their codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"V1ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error","error_description"]}}},"paths":{"/v1/integrations/actions/delete":{"post":{"tags":["v1-integrations"],"summary":"Delete integration action","description":"Deletes an existing integration action.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event_name":{"type":"string","description":"Event name"},"integration_type":{"type":"string","description":"Integration type identifier"},"action_name":{"type":"string","description":"Action name"},"action_config":{"nullable":true,"description":"Action configuration object (optional)"},"reference_entity":{"type":"object","properties":{"type":{"type":"string","description":"Entity type"},"id":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Entity ID"}},"required":["type","id"]}},"required":["event_name","integration_type","action_name","reference_entity"]}}}},"responses":{"200":{"description":"Success"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ErrorResponse"}}}},"403":{"description":"Forbidden / insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ErrorResponse"}}}}}}}}}
```
