# Set up ActivePieces integration with API key

`POST /api/integration/activepieces/setup`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Request body: application/json (required)

Type: object

Schema: [SetupActivepiecesIntegrationDto](https://sourcey-gauzy.pages.dev/api-reference/models/setupactivepiecesintegrationdto/index.md)

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

- `apiKey` (required)
  Type: string
  
  ActivePieces API key for authentication
  
  Example:
  
  ```json
  "sk-..."
  ```

Responses:

- 201: Successfully set up ActivePieces integration

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/integration/activepieces/setup' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "apiKey": "sk-..."
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "apiKey": "sk-..."
}`;

const response = await fetch('http://localhost:3000/api/integration/activepieces/setup', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "apiKey": "sk-..."
}'''

response = requests.post(
    'http://localhost:3000/api/integration/activepieces/setup',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
