---
title: "Create Integration"
method: POST
path: "/v1/integrations/{application_id}"
tags: ["integrations"]
---

# Create Integration

`POST /v1/integrations/{application_id}`

## Request

- Base URL: `https://api.branchly.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.branchly.io/v1/integrations/{application_id}`
- Auth: HTTP bearer

## Path parameters

- `application_id` string, uuid, required

## Request body

- union
  - WordPressIntegrationCreate
    - `provider` 'wordpress', required
    - `name` string, nullable
    - `base_url` string, uri, required
    - `site_name` string, nullable
    - `credentials` union, required
      - AppPasswordCredentials
        - `auth_type` 'application_password', required
        - `username` string, required
        - `app_password` string, required
      - BasicAuthCredentials
        - `auth_type` 'basic_auth', required
        - `username` string, required
        - `password` string, required
      - ApiKeyCredentials
        - `auth_type` 'api_key', required
        - `api_key` string, required
        - `api_key_header` string
  - APIKeyIntegrationCreate
    - `provider` 'calendly', required
    - `name` string, nullable
    - `api_key` string, required
  - TokenEndpointIntegrationCreate
    - `provider` 'token_endpoint', required
    - `name` string, nullable
    - `credentials` union, required
      - APIKeyTokenCredentials: Static API key exchanged for a bearer token at the login endpoint.
        - `credential_type` 'api_key', required
        - `api_key` string, required
      - UserPasswordTokenCredentials: Username/password exchanged for a bearer token at the login endpoint.
        - `credential_type` 'user_password', required
        - `username` string, required
        - `password` string, required
    - `config` TokenEndpointConfig, required: Configuration of the login endpoint a token_endpoint integration authenticates against.
      - `token_url` string, uri, required
      - `method` 'POST' | 'GET': HTTP method for the token request: 'POST' (default) or 'GET'.
      - `auth_scheme` 'body' | 'basic_auth': How credentials are sent to the token endpoint: 'body' (default) or 'basic_auth'.
      - `body_type` 'json' | 'form_urlencoded': Request body format: 'json' (default) or 'form_urlencoded'.
      - `payload_template` object, nullable: Login request body. Mustache placeholders like {{api_key}} reference credential fields. Defaults to posting the credentials directly.
      - `credential_headers` object, nullable: Extra headers for the login request. Mustache placeholders like {{api_key}} reference credential fields.
      - `token_source` 'body' | 'cookie': Source to extract the token from: 'body' (JSON response) or 'cookie' (Set-Cookie response header).
      - `cookie_name` string, nullable: Name of the cookie to extract when token_source='cookie'.
      - `token_field` string: Dot-notation path to the bearer token in the login response.
      - `expiry_field` string, nullable: Dot-notation path to the token lifetime in seconds. Set to None if the response has no expiry.
      - `header_format` string: Header injected into authenticated requests. Must contain {{token}}.

## Response `201`

Successful Response

- IntegrationAPI
  - `id` string, uuid, required
  - `application_id` string, uuid, required
  - `name` string, nullable, required
  - `provider` 'calendly' | 'wordpress' | 'token_endpoint', required
  - `status` 'connected' | 'disconnected' | 'error', required
  - `meta` object, nullable, required
  - `token_expires_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/branchly/apis/branchly-io-api.md) · [All operations](https://skmtc.dev/branchly/apis/branchly-io-api/llms.txt) · [OpenAPI document](https://skmtc.dev/branchly/apis/branchly-io-api/revisions/9ffb024f8ec8?raw)
