Skip to main content

Reflexes API

Reflexes are reusable tool collections attached to neurons. They can be sensory or effector, and they are typically composed from one or more integrations.

List Reflexes

Get a list of reflexes with optional filtering.
GET /v1/reflexes

Query Parameters

ParameterTypeDescription
typestringFilter by type: sensory or effector
searchstringSearch by name or description
limitnumberMaximum number of results (default: 20)
offsetnumberOffset for pagination
sortBystringSort field: created_at, updated_at, name
sortDirectionstringSort direction: asc or desc

Example Request

const reflexes = await auvy.reflexes.list({
  type: 'sensory'
})

Get Reflex

Get a single reflex by ID.
GET /v1/reflexes/:id

Path Parameters

ParameterTypeDescription
idstringReflex UUID

Response

Returns the reflex object directly.

Create Reflex

Create a new reflex. A reflex must define integration-backed tools, internal behavior, or a server-backed implementation.
POST /v1/reflexes

Request Body

FieldTypeRequiredDescription
namestringYesReflex name
typestringYessensory or effector
descriptionstringNoReflex description
toolsarrayNoArray of { integration_id: string, tools: string[] }
metadataobjectNoFor internal/server-based reflexes
is_activebooleanNoActive status (default: true)
is_corebooleanNoCore reflex flag (default: false)

Reflex Types

  • Sensory - Provide input to neurons (webhooks, API calls)
  • Effector - Execute actions based on neuron output (send email, update database)

Example Request

const reflex = await auvy.reflexes.create({
  name: 'My Reflex',
  description: 'A sample reflex',
  type: 'sensory',
  tools: [
    {
      integration_id: 'integration-uuid',
      tools: ['tool1', 'tool2']
    }
  ],
  is_active: true
})

Update Reflex

Update an existing reflex.
PUT /v1/reflexes/:id

Path Parameters

ParameterTypeDescription
idstringReflex UUID

Request Body

All fields optional:
FieldTypeDescription
namestringReflex name (min 1 char)
descriptionstringReflex description
toolsarrayArray of {integration_id: string, tools: string[]}
metadataobjectReflex metadata
is_activebooleanActive status
is_corebooleanCore reflex flag

Delete Reflex

Delete a reflex.
DELETE /v1/reflexes/:id

Path Parameters

ParameterTypeDescription
idstringReflex UUID

Response

{
  "success": true
}

Reflex Connections

Reflex-specific connection routes exist for dashboard flows that connect the integrations used by a reflex. Those JWT-only dashboard flows are intentionally outside this API-key-focused docs set.

Initiate Connection

Start a connection flow for the integrations required by a reflex.
POST /v1/reflexes/:id/connect
Alternative endpoint:
POST /v1/reflexes/:id/connections/initiate

Path Parameters

ParameterTypeDescription
idstringReflex UUID

Request Body

FieldTypeRequiredDescription
callbackUrlstringNoOptional callback URL for OAuth redirect

Response

{
  "redirectUrl": "https://oauth-provider.com/authorize?...",
  "connectionRequestId": "request-uuid"
}

Handle OAuth Callback

Complete a previously initiated reflex connection flow.
GET /v1/reflexes/:id/callback

Query Parameters

ParameterTypeRequiredDescription
connectionRequestIdstringYesConnection request ID from initiate endpoint
request_idstringNoAlternative parameter name for connectionRequestId

Response

{
  "connectedAccountId": "account-uuid",
  "success": true
}

Get Connection Status

Check if a reflex has an active connection.
GET /v1/reflexes/:id/connection

Response

{
  "connectedAccountId": "account-uuid",
  "connected": true
}

Check Connection Status

Get detailed status for the integrations required by a reflex.
GET /v1/reflexes/:id/connections/check

Response

Returns a ReflexConnectionStatus object with connection details for each integration required by the reflex.

Batch Get Connections

Get the currently selected account for multiple reflexes at once.
POST /v1/reflexes/connections/batch

Request Body

FieldTypeRequiredDescription
reflexIdsarrayYesArray of reflex UUIDs (max 100)

Response

{
  "connections": [
    {
      "reflexId": "reflex-uuid",
      "connectedAccountId": "account-uuid",
      "connected": true
    }
  ]
}

Batch Check Connections

Check detailed connection status for multiple reflexes.
POST /v1/reflexes/connections/check-batch

Request Body

FieldTypeRequiredDescription
reflexIdsarrayNoArray of reflex UUIDs (max 100). If omitted, checks all reflexes.

Response

{
  "statuses": [
    {
      "reflexId": "reflex-uuid",
      "status": { /* ReflexConnectionStatus object */ }
    }
  ]
}

Disconnect Reflex

Disconnect a reflex from its integrations.
DELETE /v1/reflexes/:id/connection

Response

{
  "success": true
}