Skip to content

feat(integration): add workspace_id support for workspace-scoped integrations#12

Merged
roh26it merged 1 commit intomainfrom
feat/integration-workspace-scope
Feb 26, 2026
Merged

feat(integration): add workspace_id support for workspace-scoped integrations#12
roh26it merged 1 commit intomainfrom
feat/integration-workspace-scope

Conversation

@roh26it
Copy link
Contributor

@roh26it roh26it commented Feb 26, 2026

Summary

Add support for creating workspace-level integrations by passing an optional workspace_id parameter to the portkey_integration resource.

  • Add workspace_id (optional) parameter to create workspace-scoped integrations
  • Add type (computed) attribute showing organisation or workspace
  • Update client to include WorkspaceID in create request and response
  • Add acceptance test for workspace-scoped integration
  • Update documentation with examples for both integration types

Background

The Portkey API supports creating workspace-level integrations (where the integration is scoped to a specific workspace), but the Terraform provider previously only supported organisation-level integrations.

This PR enables two ways to create workspace-scoped integrations:

  1. Using an admin API key with explicit workspace_id:
resource "portkey_integration" "openai_dev" {
  name           = "OpenAI Dev"
  ai_provider_id = "openai"
  key            = var.openai_api_key
  workspace_id   = portkey_workspace.dev.id
}
  1. Using a workspace-scoped API key (automatically scoped, no workspace_id needed)

Test plan

  • Added acceptance test TestAccIntegrationResource_workspaceScoped
  • Verified existing integration tests still pass
  • Manually tested via curl that the API correctly creates workspace-scoped integrations

Made with Cursor

…grations

Add support for creating workspace-level integrations by passing an optional
workspace_id parameter to the portkey_integration resource.

Changes:
- Add workspace_id (optional) parameter to create workspace-scoped integrations
- Add type (computed) attribute showing 'organisation' or 'workspace'
- Update client to include WorkspaceID in create request and response
- Add acceptance test for workspace-scoped integration
- Update documentation with examples for both integration types

This enables two ways to create workspace-scoped integrations:
1. Using an admin API key with explicit workspace_id parameter
2. Using a workspace-scoped API key (automatically scoped)

Made-with: Cursor
@roh26it roh26it merged commit e31fbfb into main Feb 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant