Integrations

Email inbox connections (Gmail/Outlook/IMAP/POP3) and tax-authority credential management.

16 endpoints·Scopes: integrations:read, integrations:write
POST/api/expenses/email-connect/gmail#

Run email connect/gmail (expenses)

scope · integrations:writerole · CONTRIBUTOR+SESSION-only

Performs the email-connect/gmail operation for the expenses feature.

Scope: integrations:write
Min role: CONTRIBUTOR or higher
Auth sources: SESSION only
Endpoint: POST /api/expenses/email-connect/gmail

Example request

curl -X POST "https://guliel.com/api/expenses/email-connect/gmail" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "organizationId": "abc123",
  "name": "Gmail"
}'

Request body

  • organizationIdreq
    string
  • namereq
    string

Response (200/201)

  • authorizeUrlreq
    stringURL the browser opens to start the Gmail OAuth flow.
  • statereq
    stringSigned CSRF state token — round-tripped on the callback.

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
POST/api/expenses/email-connect/outlook#

Run email connect/outlook (expenses)

scope · integrations:writerole · CONTRIBUTOR+SESSION-only

Performs the email-connect/outlook operation for the expenses feature.

Scope: integrations:write
Min role: CONTRIBUTOR or higher
Auth sources: SESSION only
Endpoint: POST /api/expenses/email-connect/outlook

Example request

curl -X POST "https://guliel.com/api/expenses/email-connect/outlook" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "organizationId": "abc123",
  "name": "Outlook"
}'

Request body

  • organizationIdreq
    string
  • namereq
    string

Response (200/201)

  • authorizeUrlreq
    stringURL the browser opens to start the Outlook OAuth flow.
  • statereq
    stringSigned CSRF state token — round-tripped on the callback.

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
DELETE/api/expenses/email-settings#

Remove email settings (expenses)

scope · integrations:writerole · MANAGER+

Removes the email-settings configuration for the expenses feature.

Scope: integrations:write
Min role: MANAGER or higher
Endpoint: DELETE /api/expenses/email-settings

Example request

curl -X DELETE "https://guliel.com/api/expenses/email-settings?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string
  • organizationIdreq
    string

Response (200/201)

  • successreq
    boolean

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
GET/api/expenses/email-settings#

Get email settings (expenses)

scope · integrations:read

Returns the email-settings data for the expenses feature.

Scope: integrations:read
Endpoint: GET /api/expenses/email-settings

Example request

curl "https://guliel.com/api/expenses/email-settings?organizationId=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • organizationIdreq
    string
  • id
    string

Response (200/201)

object | null | object

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
POST/api/expenses/email-settings#

Run email settings (expenses)

scope · integrations:writerole · MANAGER+

Performs the email-settings operation for the expenses feature.

Scope: integrations:write
Min role: MANAGER or higher
Endpoint: POST /api/expenses/email-settings

Example request

curl -X POST "https://guliel.com/api/expenses/email-settings" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "organizationId": "abc123",
  "name": "Sample",
  "provider": "GMAIL"
}'

Request body

  • organizationIdreq
    string
  • namereq
    string
  • providerreq
    enum<4>
    GMAIL · OUTLOOK · IMAP · POP3
  • enabled
    boolean
  • host
    string | null
  • port
    integer | null
  • useTls
    boolean
  • username
    string | null
  • password
    string | null
  • folderOrLabel
    string | null
  • subjectFilter
    string | null
  • senderWhitelist
    array<string>
  • autoPollEnabled
    boolean
  • pollIntervalDays
    integer

Response (200/201)

  • idreq
    string
  • organizationIdreq
    string
  • namereq
    string
  • providerreq
    string
  • enabledreq
    boolean
  • tokenExpiresAtreq
    string | null
  • hostreq
    string | null
  • portreq
    integer | null
  • useTlsreq
    boolean
  • usernamereq
    string | null
  • hasPasswordreq
    booleanWhether an IMAP/POP3 password is stored. The password itself is never returned.
  • folderOrLabelreq
    string | null
  • subjectFilterreq
    string | null
  • senderWhitelistreq
    array<string>
  • autoPollEnabledreq
    boolean
  • pollIntervalDaysreq
    integer
  • lastPolledAtreq
    string | null
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
PUT/api/expenses/email-settings#

Update email settings (expenses)

scope · integrations:writerole · MANAGER+

Mutates the email-settings configuration for the expenses feature.

Scope: integrations:write
Min role: MANAGER or higher
Endpoint: PUT /api/expenses/email-settings

Example request

curl -X PUT "https://guliel.com/api/expenses/email-settings" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "id": "abc123",
  "organizationId": "abc123"
}'

Request body

  • idreq
    string
  • organizationIdreq
    string
  • name
    string
  • enabled
    boolean
  • host
    string | null
  • port
    integer | null
  • useTls
    boolean
  • username
    string | null
  • password
    string | null
  • folderOrLabel
    string | null
  • subjectFilter
    string | null
  • senderWhitelist
    array<string>
  • autoPollEnabled
    boolean
  • pollIntervalDays
    integer
  • provider
    enum<4>
    GMAIL · OUTLOOK · IMAP · POP3

Response (200/201)

  • idreq
    string
  • organizationIdreq
    string
  • namereq
    string
  • providerreq
    string
  • enabledreq
    boolean
  • tokenExpiresAtreq
    string | null
  • hostreq
    string | null
  • portreq
    integer | null
  • useTlsreq
    boolean
  • usernamereq
    string | null
  • hasPasswordreq
    booleanWhether an IMAP/POP3 password is stored. The password itself is never returned.
  • folderOrLabelreq
    string | null
  • subjectFilterreq
    string | null
  • senderWhitelistreq
    array<string>
  • autoPollEnabledreq
    boolean
  • pollIntervalDaysreq
    integer
  • lastPolledAtreq
    string | null
  • createdAtreq
    string
  • updatedAtreq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
DELETE/api/expenses/email-settings/{id}/auto-scan#

Detach email settings/auto scan from an expense

scope · integrations:writerole · CONTRIBUTOR+

Removes the association without deleting the underlying record.

Scope: integrations:write
Min role: CONTRIBUTOR or higher
Endpoint: DELETE /api/expenses/email-settings/{id}/auto-scan

Example request

curl -X DELETE "https://guliel.com/api/expenses/email-settings/abc123/auto-scan?organizationId=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • organizationIdreq
    string
  • idreq
    string

Response (200/201)

  • connectionIdreq
    string
  • automationIdreq
    string | null
  • cadencereq
    enum<4>
    OFF · DAILY · WEEKLY · MONTHLY
  • automationStatusreq
    enum<3> | null

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
GET/api/expenses/email-settings/{id}/auto-scan#

List email settings/auto scan for an expense

scope · integrations:readrole · VIEWER+

Returns every email-settings/auto-scan row associated with the given expense.

Scope: integrations:read
Min role: VIEWER or higher
Endpoint: GET /api/expenses/email-settings/{id}/auto-scan

Example request

curl "https://guliel.com/api/expenses/email-settings/abc123/auto-scan?organizationId=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • organizationIdreq
    string
  • idreq
    string

Response (200/201)

  • connectionIdreq
    string
  • automationIdreq
    string | null
  • cadencereq
    enum<4>
    OFF · DAILY · WEEKLY · MONTHLY
  • automationStatusreq
    enum<3> | null

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
POST/api/expenses/email-settings/{id}/auto-scan#

Set a connection's scheduled auto-scan

scope · integrations:writerole · CONTRIBUTOR+

Creates a new email-settings/auto-scan attached to the given expense.

Scope: integrations:write
Min role: CONTRIBUTOR or higher
Endpoint: POST /api/expenses/email-settings/{id}/auto-scan

Example request

curl -X POST "https://guliel.com/api/expenses/email-settings/abc123/auto-scan" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "organizationId": "abc123",
  "id": "abc123",
  "cadence": "OFF"
}'

Request body

  • organizationIdreq
    string
  • idreq
    string
  • cadencereq
    enum<4>
    OFF · DAILY · WEEKLY · MONTHLY

Response (200/201)

  • connectionIdreq
    string
  • automationIdreq
    string | null
  • cadencereq
    enum<4>
    OFF · DAILY · WEEKLY · MONTHLY
  • automationStatusreq
    enum<3> | null

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
GET/api/expenses/fetch-logs#

Get fetch logs (expenses)

scope · integrations:read

Returns the fetch-logs data for the expenses feature.

Scope: integrations:read
Endpoint: GET /api/expenses/fetch-logs

Example request

curl "https://guliel.com/api/expenses/fetch-logs?organizationId=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • organizationIdreq
    string
  • connectionId
    string

Response (200/201)

  • runsreq
    array<object>
    • idreq
      string
    • connectionIdreq
      string
    • statusreq
      enum<5>
      PENDING · RUNNING · DONE · ERROR · MANUAL_STOP
    • dateFromreq
      string
    • dateToreq
      string
    • emailsScannedreq
      integer
    • emailsDetectedreq
      integer
    • expensesCreatedreq
      integer
    • errorMessagereq
      string | null
    • startedAtreq
      string
    • completedAtreq
      string | null
    • claimedAtreq
      string | nullWhen a worker claimed the run; null on a legacy sync run
    • lastProgressAtreq
      string | nullHeartbeat — bumped per processed message
    • messagesreq
      array<object>
      • idreq
        string
      • messageIdreq
        string
      • subjectreq
        string | null
      • outcomereq
        enum<5>
        CREATED · DUPLICATE · SKIPPED_NOT_EXPENSE · DROPPED_NO_DATA · FAILED
      • reasonreq
        string | nullShort human-readable disposition reason
      • processedAtreq
        string

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
POST/api/expenses/fetch-logs/{id}/stop#

Attach fetch logs/stop to an expense

scope · integrations:write

Creates a new fetch-logs/stop attached to the given expense.

Scope: integrations:write
Endpoint: POST /api/expenses/fetch-logs/{id}/stop

Example request

curl -X POST "https://guliel.com/api/expenses/fetch-logs/abc123/stop" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "id": "abc123"
}'

Request body

  • idreq
    string

Response (200/201)

  • successreq
    boolean

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
GET/api/organizations/{id}/tax-authority#

List tax authority for an organization

scope · integrations:read

Returns every tax-authority row associated with the given organization.

Scope: integrations:read
Endpoint: GET /api/organizations/{id}/tax-authority

Example request

curl "https://guliel.com/api/organizations/abc123/tax-authority?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string

Response (200/201)

  • integrationsreq
    array<object>
    • integrationIdreq
      stringStable identifier of the tax-authority integration (e.g. "israel-shaam").
    • namereq
      string
    • countryreq
      string
    • connectedreq
      boolean
    • lastValidatedAtreq
      string | null

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
DELETE/api/organizations/{id}/tax-authority/{integrationId}#

Detach tax authority from an organization

scope · integrations:writerole · MANAGER+

Removes the association without deleting the underlying record.

Scope: integrations:write
Min role: MANAGER or higher
Endpoint: DELETE /api/organizations/{id}/tax-authority/{integrationId}

Example request

curl -X DELETE "https://guliel.com/api/organizations/abc123/tax-authority/abc123?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string
  • integrationIdreq
    string

Response (200/201)

  • successreq
    boolean
  • messagereq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
GET/api/organizations/{id}/tax-authority/{integrationId}#

List tax authority for an organization

scope · integrations:readrole · MANAGER+

Returns every tax-authority row associated with the given organization.

Scope: integrations:read
Min role: MANAGER or higher
Endpoint: GET /api/organizations/{id}/tax-authority/{integrationId}

Example request

curl "https://guliel.com/api/organizations/abc123/tax-authority/abc123?id=value" \
  -H "Authorization: Bearer $GULIEL_API_KEY"

Query parameters

  • idreq
    string
  • integrationIdreq
    string

Response (200/201)

  • integrationIdreq
    string
  • namereq
    string
  • descriptionreq
    string
  • requiredFieldsreq
    array<object>
  • environmentreq
    stringsandbox | production
  • statusreq
    object
    • existsreq
      boolean
    • isActivereq
      boolean
    • isValidatedreq
      boolean
    • lastValidatedAtreq
      string | null
    • validationErrorreq
      string | null

Error responses

400Validation
401Unauthenticated
403Forbidden
500Internal
POST/api/organizations/{id}/tax-authority/{integrationId}#

Attach tax authority to an organization

scope · integrations:writerole · MANAGER+

Creates a new tax-authority attached to the given organization.

Scope: integrations:write
Min role: MANAGER or higher
Endpoint: POST /api/organizations/{id}/tax-authority/{integrationId}

Example request

curl -X POST "https://guliel.com/api/organizations/abc123/tax-authority/abc123" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "id": "abc123",
  "integrationId": "abc123",
  "credentials": {},
  "environment": "sandbox"
}'

Request body

  • idreq
    string
  • integrationIdreq
    string
  • credentialsreq
    object
  • environmentreq
    enum<2>
    sandbox · production

Response (200/201)

  • successreq
    boolean
  • messagereq
    string

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal
POST/api/organizations/{id}/tax-authority/{integrationId}/validate#

Attach tax authority/validate to an organization

scope · integrations:writerole · MANAGER+

Creates a new tax-authority/validate attached to the given organization.

Scope: integrations:write
Min role: MANAGER or higher
Endpoint: POST /api/organizations/{id}/tax-authority/{integrationId}/validate

Example request

curl -X POST "https://guliel.com/api/organizations/abc123/tax-authority/abc123/validate" \
  -H "Authorization: Bearer $GULIEL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "id": "abc123",
  "integrationId": "abc123"
}'

Request body

  • idreq
    string
  • integrationIdreq
    string

Response (200/201)

  • validreq
    boolean
  • error
    string | null
  • details
    object | null

Error responses

400Validation
401Unauthenticated
403Forbidden
429RateLimit
500Internal