---
title: "Create an integration"
method: POST
path: "/accounts/integrations"
tags: ["Integrations"]
---

# Create an integration

`POST /accounts/integrations`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/accounts/integrations`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/docs/accounts/integrations/post.ts> (a function with typed inputs; its response is checked against the schema)

Account root or admin. Returns the first `client_secret` once.

## Request body

- CreateIntegrationRequest
  - `name` string, required
  - `environment` string
  - `scopes` IntegrationScopes: Space id to scopes. Space ids are upper-cased on write and match `^\w{1,64}$`. At most 500 spaces.

## Response `200`

Created.

- object
  - `data` IntegrationCreated, required
    - `integration` Integration, required
      - `id` string, required: Also the OAuth `client_id`.
      - `account_id` string, required
      - `name` string, required
      - `user_id` string, required: The principal user that writes are attributed to.
      - `environment` string, required: Label only in this release.
      - `scopes` IntegrationScopes, required: Space id to scopes. Space ids are upper-cased on write and match `^\w{1,64}$`. At most 500 spaces.
      - `secrets` IntegrationSecretView[], required
        - `secret_id` string, required
        - `last_4` string, required
        - `created_at` string, date-time, required
        - `created_by` string, required
        - `retires_at` string, date-time
        - `revoked_at` string, date-time
        - `last_used_at` string, date-time
      - `token_epoch` integer, required
      - `disabled` boolean, required
      - `deleted_at` string, date-time
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `created_by` string
    - `client_id` string, required
    - `client_secret` string, required: Shown once.

## Other responses

- `400`: Bad request. `code` names the cause.
- `401`: Not authenticated, the caller is not a root or admin user, or the integration token was revoked (`token_revoked`).
- `403`: Forbidden: `scope_denied`, or `integration_not_allowed` for an integration bearer outside workspaces.
- `503`: A backing store is unreachable. Retry. `code` is `storage_unavailable`.

## Changes

- **2026-10-08** `bcf3a5f49584`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/changes/accounts/integrations/post.md)

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/revisions/700eb1ace61a?raw)
